Skip to content

Commit

Permalink
make default unstable_check just return false
Browse files Browse the repository at this point in the history
  • Loading branch information
oscardssmith committed Jun 7, 2024
1 parent 5fa2b7c commit f7ae11c
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions src/common_defaults.jl
Original file line number Diff line number Diff line change
Expand Up @@ -106,20 +106,7 @@ function NAN_CHECK(x::SparseArrays.AbstractSparseMatrixCSC)
any(NAN_CHECK, SparseArrays.nonzeros(x))
end

INFINITE_OR_GIANT(x::Number) = !isfinite(x)
function INFINITE_OR_GIANT(x::Union{
AbstractArray, RecursiveArrayTools.AbstractVectorOfArray})
any(
INFINITE_OR_GIANT, x)
end
INFINITE_OR_GIANT(x::RecursiveArrayTools.ArrayPartition) = any(INFINITE_OR_GIANT, x.x)
function INFINITE_OR_GIANT(x::SparseArrays.AbstractSparseMatrixCSC)
any(INFINITE_OR_GIANT, SparseArrays.nonzeros(x))
end
ODE_DEFAULT_UNSTABLE_CHECK(dt, u, p, t) = false
function ODE_DEFAULT_UNSTABLE_CHECK(dt, u::Union{Number, AbstractArray{<:Number}}, p, t)
INFINITE_OR_GIANT(u)
end

# Nonlinear Solve Norm (norm(_, 2))
NONLINEARSOLVE_DEFAULT_NORM(u::Union{AbstractFloat, Complex}) = @fastmath abs(u)
Expand Down

0 comments on commit f7ae11c

Please sign in to comment.