Skip to content

Commit

Permalink
allow starting forwardrecurrence! from a shifted start for adaptive (#…
Browse files Browse the repository at this point in the history
…216)

* allow starting forwardrecurrence! from a shifted start for adaptive

* Update clenshaw.jl
  • Loading branch information
dlfivefifty authored Apr 4, 2023
1 parent 5369e42 commit 14d2bbb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "FastTransforms"
uuid = "057dd010-8810-581a-b7be-e3fc3b93f78c"
version = "0.15.2"
version = "0.15.3"

[deps]
AbstractFFTs = "621f4979-c628-5d54-868e-fcf4e3e8185c"
Expand Down
10 changes: 9 additions & 1 deletion src/clenshaw.jl
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,14 @@ function _forwardrecurrence!(v::AbstractVector, A::AbstractVector, B::AbstractVe
v[1] = p0
N == 1 && return v
v[2] = p1
@inbounds for n = 2:N-1
_forwardrecurrence!(v, A, B, C, x, 2:N)
end

function _forwardrecurrence!(v::AbstractVector, A::AbstractVector, B::AbstractVector, C::AbstractVector, x, kr::AbstractUnitRange)
n₀, N = first(kr), last(kr)
@boundscheck N > length(v) && throw(BoundsError(v, N))
p0, p1 = v[n₀-1], v[n₀]
@inbounds for n = n₀:N-1
p1,p0 = _forwardrecurrence_next(n, A, B, C, x, p0, p1),p1
v[n+1] = p1
end
Expand All @@ -38,6 +45,7 @@ end




forwardrecurrence(N::Integer, A::AbstractVector, B::AbstractVector, C::AbstractVector, x) =
forwardrecurrence!(Vector{promote_type(eltype(A),eltype(B),eltype(C),typeof(x))}(undef, N), A, B, C, x)

Expand Down

2 comments on commit 14d2bbb

@dlfivefifty
Copy link
Member 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/81026

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.15.3 -m "<description of version>" 14d2bbbcf3478d955bea0bc42a3edeff9385da08
git push origin v0.15.3

Please sign in to comment.