Skip to content

Commit

Permalink
Merge pull request #161 from JuliaDiffEq/myb/Wfact
Browse files Browse the repository at this point in the history
Fix Wfact
  • Loading branch information
ChrisRackauckas authored Jul 30, 2019
2 parents a96227d + 336c737 commit 9811e5a
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/systems/diffeqs/diffeqsystem.jl
Original file line number Diff line number Diff line change
Expand Up @@ -232,14 +232,14 @@ function DiffEqBase.ODEFunction{iip}(sys::ODESystem, dvs, ps,

if Wfact
_Wfact,_Wfact_t = eval.(generate_factorized_W(sys, dvs, ps))
Wfact_f_safe(u,p,t) = ModelingToolkit.fast_invokelatest(_Wfact,Matrix{eltype(u)},u,p,t)
Wfact_f_safe(J,u,p,t) = ModelingToolkit.fast_invokelatest(_Wfact,Nothing,J,u,p,t)
Wfact_f_t_safe(u,p,t) = ModelingToolkit.fast_invokelatest(_Wfact,Matrix{eltype(u)},u,p,t)
Wfact_f_t_safe(J,u,p,t) = ModelingToolkit.fast_invokelatest(_Wfact,Nothing,J,u,p,t)
Wfact_f(u,p,t) = _Wfact(u,p,t)
Wfact_f(J,u,p,t) = _Wfact(J,u,p,t)
Wfact_f_t(u,p,t) = _Wfact_t(u,p,t)
Wfact_f_t(J,u,p,t) = _Wfact_t(J,u,p,t)
Wfact_f_safe(u,p,gam,t) = ModelingToolkit.fast_invokelatest(_Wfact,Matrix{eltype(u)},u,p,gam,t)
Wfact_f_safe(J,u,p,gam,t) = ModelingToolkit.fast_invokelatest(_Wfact,Nothing,J,u,p,gam,t)
Wfact_f_t_safe(u,p,gam,t) = ModelingToolkit.fast_invokelatest(_Wfact,Matrix{eltype(u)},u,p,gam,t)
Wfact_f_t_safe(J,u,p,gam,t) = ModelingToolkit.fast_invokelatest(_Wfact,Nothing,J,u,p,gam,t)
Wfact_f(u,p,gam,t) = _Wfact(u,p,gam,t)
Wfact_f(J,u,p,gam,t) = _Wfact(J,u,p,gam,t)
Wfact_f_t(u,p,gam,t) = _Wfact_t(u,p,gam,t)
Wfact_f_t(J,u,p,gam,t) = _Wfact_t(J,u,p,gam,t)
else
Wfact_f_safe = nothing
Wfact_f_t_safe = nothing
Expand All @@ -254,7 +254,7 @@ function DiffEqBase.ODEFunction{iip}(sys::ODESystem, dvs, ps,
else
ODEFunction{iip}(out_f,jac=jac_f,
Wfact = Wfact_f,
Wfact_t = Wfact_t_f)
Wfact_t = Wfact_f_t)
end
end

Expand Down

0 comments on commit 9811e5a

Please sign in to comment.