Skip to content

Commit

Permalink
Merge pull request #21 from JuliaDiffEq/ChrisRackauckas-patch-2
Browse files Browse the repository at this point in the history
Fix saveat
  • Loading branch information
ChrisRackauckas committed Oct 5, 2017
2 parents dbb6543 + 2943da2 commit 3deb10a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/common.jl
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,11 @@ function solve{uType,duType,tType,isinplace,LinearSolver}(
T = tspan[end]

if typeof(saveat) <: Number
saveat_vec = convert(Vector{tType},saveat+tspan[1]:saveat:(tspan[end]-saveat))
# Exclude the endpoint because of floating point issues
if (tspan[1]:saveat:tspan[end])[end] == tspan[end]
saveat_vec = convert(Vector{tType},collect(tType,tspan[1]+saveat:saveat:tspan[end]))
else
saveat_vec = convert(Vector{tType},collect(tType,tspan[1]+saveat:saveat:(tspan[end]-saveat)))
end
else
saveat_vec = convert(Vector{tType},collect(saveat))
end
Expand Down

0 comments on commit 3deb10a

Please sign in to comment.