Skip to content

Commit

Permalink
Hot fix in init_psol and set_psol! (#198)
Browse files Browse the repository at this point in the history
* Fix set_psol!, init_psol

* Bump patch version
  • Loading branch information
PerezHz committed Aug 6, 2024
1 parent c697308 commit 998c42d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "TaylorIntegration"
uuid = "92b13dbe-c966-51a2-8445-caca9f8a7d42"
repo = "https://github.com/PerezHz/TaylorIntegration.jl.git"
version = "0.16.0"
version = "0.16.1"

[deps]
DiffEqBase = "2b5f629d-d688-5b77-993f-72d75c75574e"
Expand Down
14 changes: 4 additions & 10 deletions src/integrator/taylorinteg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,11 @@ where the Taylor polynomials associated to the solution will be stored, correspo
field `:p` in [`TaylorSolution`](@ref). See also [`init_psol`](@ref).
"""
@inline function set_psol!(::Val{true}, psol::Array{Taylor1{U},1}, nsteps::Int, x::Taylor1{U}) where {U<:Number}
@inbounds for k in eachindex(x)
TaylorSeries.identity!(psol[nsteps], x, k)
end
@inbounds psol[nsteps] = deepcopy(x)
return nothing
end
@inline function set_psol!(::Val{true}, psol::Array{Taylor1{U},2}, nsteps::Int, x::Vector{Taylor1{U}}) where {U<:Number}
@inbounds for i in eachindex(x)
for k in eachindex(x[i])
TaylorSeries.identity!(psol[i, nsteps], x[i], k)
end
end
@inbounds psol[:,nsteps] .= deepcopy.(x)
return nothing
end
@inline set_psol!(::Val{false}, args...) = nothing
Expand All @@ -43,10 +37,10 @@ associated to the solution will be stored, corresponding to field `:p` in
[`TaylorSolution`](@ref).
"""
@inline function init_psol(::Val{true}, xv::Array{U,1}, x::Taylor1{U}) where {U<:Number}
return [zero(x) for _ in axes(xv, 1)]
return Array{Taylor1{U}}(undef, size(xv, 1)-1)
end
@inline function init_psol(::Val{true}, xv::Array{U,2}, x::Array{Taylor1{U},1}) where {U<:Number}
return [zero(x[1]) for _ in axes(xv, 1), _ in axes(xv, 2)]
return Array{Taylor1{U}}(undef, size(xv, 1), size(xv, 2)-1)
end

# init_psol
Expand Down

2 comments on commit 998c42d

@PerezHz
Copy link
Owner Author

@PerezHz PerezHz commented on 998c42d Aug 6, 2024

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/112483

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.16.1 -m "<description of version>" 998c42d7366fdb179c821123b0d455972ea545a3
git push origin v0.16.1

Please sign in to comment.