Skip to content

Commit

Permalink
Fix saveat
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisRackauckas committed Oct 4, 2017
1 parent dbb6543 commit 2943da2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/common.jl
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 2943da2

Please sign in to comment.