Skip to content

Commit

Permalink
Merge pull request #24 from pedrohnv/dev
Browse files Browse the repository at this point in the history
Release 0.2.1
  • Loading branch information
pedrohnv authored Oct 25, 2024
2 parents 093a02e + 5d7aeee commit 3951ea1
Show file tree
Hide file tree
Showing 11 changed files with 448 additions and 7 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
## [0.2.1]

### Fixed

- variable `Npairs` to `Npoles` in `recommended_init_poles`
- prevent InexactError if `f` or `poles` were `Float`

## [0.2.0] - 2024-10-08

Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "RationalVectorFitting"
uuid = "52b1e31a-230f-50d6-be04-0f5494ddfff6"
authors = ["Pedro H. N. Vieira <phnvieira@proton.me>"]
version = "0.2.0"
version = "0.2.1"

[deps]
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Expand Down
46 changes: 46 additions & 0 deletions docs/src/ex1.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
46 changes: 46 additions & 0 deletions docs/src/ex2.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
46 changes: 46 additions & 0 deletions docs/src/ex3-mag.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
52 changes: 52 additions & 0 deletions docs/src/ex3-phase.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
64 changes: 64 additions & 0 deletions docs/src/ex4-1.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
64 changes: 64 additions & 0 deletions docs/src/ex4-2.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
64 changes: 64 additions & 0 deletions docs/src/ex4-3.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
54 changes: 54 additions & 0 deletions docs/src/ex4-4.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 5 additions & 5 deletions src/RationalVectorFitting.jl
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,17 @@ end


"""
recommended_init_poles(s, Npairs) -> init_poles
recommended_init_poles(s, Npoles) -> init_poles
Builds a vector of recommended initial poles sorted by [`cplxpair`](@ref).
"""
function recommended_init_poles(s, Npairs)
function recommended_init_poles(s, Npoles)
s0 = imag(s[1])
if isapprox(s0, 0.0)
s0 = imag(s[2])
end
s1 = imag(s[end])
init_poles = [(-0.01 + 1.0im) * sk for sk in range(s0, s1, length = Npairs ÷ 2)]
init_poles = [(-0.01 + 1.0im) * sk for sk in range(s0, s1, length = Npoles ÷ 2)]
init_poles = sort!([init_poles; conj.(init_poles)], by = cplxpair)
return init_poles
end
Expand Down Expand Up @@ -206,7 +206,7 @@ See also [`vector_fitting`](@ref), [`pole_identification`](@ref).
function residue_identification(s, f, poles, weight)
Ns = length(s)
Np = length(poles)
residues = similar(poles)
residues = similar(poles, ComplexF64)
Nrows = 2 * Ns
Ncols = Np + 2
A1_cplx = zeros(ComplexF64, Ns, Ncols)
Expand Down Expand Up @@ -316,7 +316,7 @@ function vector_fitting(
residues = zeros(ComplexF64, Np, Nc)
d = zeros(Nc)
h = zeros(Nc)
fitted = similar(f)
fitted = similar(f, ComplexF64)
local error_norm = Inf
for iter = 1:maxiter
if error_norm < tol
Expand Down

2 comments on commit 3951ea1

@pedrohnv
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/118066

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.2.1 -m "<description of version>" 3951ea15f90896ad95d949ddbf2ba7751d4497ab
git push origin v0.2.1

Please sign in to comment.