diff --git a/Project.toml b/Project.toml index 01e557c70..4440630af 100644 --- a/Project.toml +++ b/Project.toml @@ -77,7 +77,7 @@ Parameters = "0.12.0" PreallocationTools = "0.4" PrecompileTools = "1" Printf = "1.9" -RecursiveArrayTools = "2" +RecursiveArrayTools = "2, 3" Reexport = "1.0" SciMLBase = "2.7.0" SciMLOperators = "0.2, 0.3" diff --git a/src/common_defaults.jl b/src/common_defaults.jl index f6fa92d08..a941857ed 100644 --- a/src/common_defaults.jl +++ b/src/common_defaults.jl @@ -6,6 +6,9 @@ end @inline function UNITLESS_ABS2(x::AbstractArray) mapreduce(UNITLESS_ABS2, abs2_and_sum, x, init = zero(real(value(eltype(x))))) end +@inline function UNITLESS_ABS2(x::RecursiveArrayTools.AbstractVectorOfArray) + mapreduce(UNITLESS_ABS2, abs2_and_sum, x.u, init = zero(real(value(eltype(x))))) +end @inline function UNITLESS_ABS2(x::RecursiveArrayTools.ArrayPartition) mapreduce(UNITLESS_ABS2, abs2_and_sum, x.x, init = zero(real(value(eltype(x))))) end @@ -64,7 +67,11 @@ end Base.FastMath.sqrt_fast(real(sum(abs2 ∘ f, u)) / max(length(u), 1)) end -@inline function ODE_DEFAULT_NORM(u::AbstractArray, t) +@inline function ODE_DEFAULT_NORM(u::Union{ + AbstractArray, + RecursiveArrayTools.AbstractVectorOfArray, + }, + t) Base.FastMath.sqrt_fast(UNITLESS_ABS2(u) / max(recursive_length(u), 1)) end @@ -90,7 +97,8 @@ end @inline NAN_CHECK(x::Number) = isnan(x) @inline NAN_CHECK(x::Float64) = isnan(x) || (x > 1e50) @inline NAN_CHECK(x::Enum) = false -@inline NAN_CHECK(x::AbstractArray) = any(NAN_CHECK, x) +@inline NAN_CHECK(x::Union{AbstractArray, RecursiveArrayTools.AbstractVectorOfArray}) = any(NAN_CHECK, + x) @inline NAN_CHECK(x::RecursiveArrayTools.ArrayPartition) = any(NAN_CHECK, x.x) @inline function NAN_CHECK(x::SparseArrays.AbstractSparseMatrixCSC) any(NAN_CHECK, SparseArrays.nonzeros(x)) diff --git a/src/fastpow.jl b/src/fastpow.jl index c70fa888d..b66ee2ae2 100644 --- a/src/fastpow.jl +++ b/src/fastpow.jl @@ -55,7 +55,7 @@ const EXP2FT = (Float32(0x1.6a09e667f3bcdp-1), TBLBITS = UInt32(4) TBLSIZE = UInt32(1 << TBLBITS) - redux = Float32(0x1.8p23f) / TBLSIZE + redux = Float32(0x1.8p23) / TBLSIZE P1 = Float32(0x1.62e430p-1) P2 = Float32(0x1.ebfbe0p-3) P3 = Float32(0x1.c6b348p-5) diff --git a/test/plot_vars.jl b/test/plot_vars.jl index 6f755d6e4..342e31f8c 100644 --- a/test/plot_vars.jl +++ b/test/plot_vars.jl @@ -18,7 +18,6 @@ dt = 0.1 sol = solve(prob, InternalEuler.FwdEulerAlg(), tstops = 0:dt:1) syms = [:x, :y, :z] -@test SciMLBase.has_syms(prob.f) == true @test SciMLBase.interpret_vars([(0, 1), (1, 3), (4, 5)], sol, syms) == [ (SciMLBase.DEFAULT_PLOT_FUNC, 0, 1), (SciMLBase.DEFAULT_PLOT_FUNC, 1, 3),