Skip to content

Commit

Permalink
Merge pull request #46 from AayushSabharwal/as/split-false
Browse files Browse the repository at this point in the history
fix: use `split=false` when jit-ing system, rely on defaults
  • Loading branch information
ChrisRackauckas authored Nov 20, 2024
2 parents 7a14a42 + 1b2f134 commit fcb7dd3
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions R/diffeqr.R
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,10 @@ jitoptimize_ode <- function (de,prob){
mtk <- julia_pkg_import("ModelingToolkit",functions)

odesys = mtk$modelingtoolkitize(prob)
odesys = mtk$complete(odesys)

JuliaCall::julia_assign("odesys", odesys)
jul_f = JuliaCall::julia_eval("jitf = ODEFunction(odesys,jac=true)")
JuliaCall::julia_assign("u0", prob$u0)
JuliaCall::julia_assign("p", prob$p)
JuliaCall::julia_assign("tspan", prob$tspan)
new_prob <- JuliaCall::julia_eval("ODEProblem(jitf, u0, tspan, p)")
new_prob <- JuliaCall::julia_eval("ODEProblem(complete(odesys, split=false), [], tspan; jac=true)")
}

#' Jit Optimize an SDEProblem
Expand Down Expand Up @@ -106,13 +102,9 @@ jitoptimize_sde <- function (de,prob){
mtk <- julia_pkg_import("ModelingToolkit",functions)

sdesys = mtk$modelingtoolkitize(prob)
sdesys = mtk$complete(sdesys)
JuliaCall::julia_assign("sdesys", sdesys)
jul_f = JuliaCall::julia_eval("jitf = SDEFunction(sdesys,jac=true)")
JuliaCall::julia_assign("u0", prob$u0)
JuliaCall::julia_assign("p", prob$p)
JuliaCall::julia_assign("tspan", prob$tspan)
new_prob <- JuliaCall::julia_eval("SDEProblem(jitf, jitf.g, u0, tspan, p)")
new_prob <- JuliaCall::julia_eval("SDEProblem(complete(sdesys, split=false), [], tspan; jac=true)")
}

#' Setup DiffEqGPU
Expand Down

0 comments on commit fcb7dd3

Please sign in to comment.