Skip to content

Commit

Permalink
Fix default specialization
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisRackauckas committed Dec 27, 2023
1 parent 3b3d217 commit d6b9117
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/systems/diffeqs/abstractodesystem.jl
Original file line number Diff line number Diff line change
Expand Up @@ -912,6 +912,10 @@ function DiffEqBase.ODEProblem(sys::AbstractODESystem, args...; kwargs...)
ODEProblem{true}(sys, args...; kwargs...)
end

function DiffEqBase.ODEProblem(sys::AbstractODESystem, u0map::StaticArray, args...; kwargs...)
ODEProblem{false, SciMLBase.FullSpecialize}(sys, u0map, args...; kwargs...)

Check warning on line 916 in src/systems/diffeqs/abstractodesystem.jl

View check run for this annotation

Codecov / codecov/patch

src/systems/diffeqs/abstractodesystem.jl#L915-L916

Added lines #L915 - L916 were not covered by tests
end

function DiffEqBase.ODEProblem{true}(sys::AbstractODESystem, args...; kwargs...)
ODEProblem{true, SciMLBase.AutoSpecialize}(sys, args...; kwargs...)
end
Expand Down
5 changes: 3 additions & 2 deletions test/static_arrays.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Catalyst, StaticArrays, Test
using ModelingToolkit, StaticArrays, Test

@parameters σ ρ β
@variables t x(t) y(t) z(t)
Expand All @@ -21,7 +21,8 @@ p = @SVector [σ => 28.0,
β => 8 / 3]

tspan = (0.0, 100.0)
prob_mtk = ODEProblem{false, SciMLBase.FullSpecialize}(sys, u0, tspan, p)
prob_mtk = ODEProblem(sys, u0, tspan, p)

@test !SciMLBase.isinplace(prob_mtk)
@test prob_mtk.u0 isa SArray
@test prob_mtk.p isa SArray

0 comments on commit d6b9117

Please sign in to comment.