Skip to content

Commit

Permalink
update unstable check
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisRackauckas committed Apr 29, 2017
1 parent 0ecdbb5 commit ab2a726
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/constants.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@
@inline UNITLESS_ABS2(x) = abs2(x)/(typeof(x)(one(x))*typeof(x)(one(x)))
@inline ODE_DEFAULT_NORM(u) = sqrt(sum(UNITLESS_ABS2,u) / length(u))
@inline ODE_DEFAULT_PROG_MESSAGE(dt,t,u) = "dt="*string(dt)*"\nt="*string(t)*"\nmax u="*string(maximum(abs.(u)))
@inline ODE_DEFAULT_UNSTABLE_CHECK(dt,t,u) = any(isnan,u)
@inline ODE_DEFAULT_UNSTABLE_CHECK(dt,t,u) = false
(p::typeof(ODE_DEFAULT_UNSTABLE_CHECK))(dt,t,u::AbstractFloat) = isnan(u)
(p::typeof(ODE_DEFAULT_UNSTABLE_CHECK)){T<:AbstractFloat}(dt,t,u::AbstractArray{T}) = any(isnan,u)
(p::typeof(ODE_DEFAULT_UNSTABLE_CHECK))(dt,t,u::ArrayPartition) = any(isnan,chain(u.x...))

0 comments on commit ab2a726

Please sign in to comment.