Skip to content

Commit

Permalink
Merge pull request #140 from JuliaDiffEq/ChrisRackauckas-patch-1
Browse files Browse the repository at this point in the history
Fix saveat
  • Loading branch information
ChrisRackauckas committed Oct 4, 2017
2 parents 45509da + e9f6612 commit 90f1a6e
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 @@ -47,8 +47,11 @@ function solve{uType,tType,isinplace,AlgType<:ODEjlAlgorithm}(
u0 = prob.u0

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 90f1a6e

Please sign in to comment.