Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add initialization support #84

Merged
merged 3 commits into from
Dec 14, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat: add initialization_data, sys to SDEFunctionWrapper
AayushSabharwal committed Dec 3, 2024
commit 3c333b79a50eef9f093c460bf0401f281793d684
20 changes: 7 additions & 13 deletions src/functionwrapper.jl
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@ end
(g::SDEDiffusionTermWrapper{false})(u, p, t) = g.g(u, g.h, p, t)

struct SDEFunctionWrapper{iip, F, G, H, TMM, Ta, Tt, TJ, JVP, VJP, JP, SP, TW, TWt, TPJ, GG,
TCV} <: DiffEqBase.AbstractRODEFunction{iip}
TCV, ID, S} <: DiffEqBase.AbstractRODEFunction{iip}
f::F
g::G
h::H
@@ -26,6 +26,8 @@ struct SDEFunctionWrapper{iip, F, G, H, TMM, Ta, Tt, TJ, JVP, VJP, JP, SP, TW, T
paramjac::TPJ
ggprime::GG
colorvec::TCV
initialization_data::ID
sys::S
end

(f::SDEFunctionWrapper{true})(du, u, p, t) = f.f(du, u, f.h, p, t)
@@ -53,17 +55,9 @@ function wrap_functions_and_history(f::SDDEFunction, g, h)
typeof(f.analytic), typeof(f.tgrad), typeof(jac), typeof(f.jvp),
typeof(f.vjp), typeof(f.jac_prototype), typeof(f.sparsity),
typeof(f.Wfact), typeof(f.Wfact_t), typeof(f.paramjac),
typeof(f.ggprime), typeof(f.colorvec)}(f.f, gwh, h,
f.mass_matrix,
f.analytic,
f.tgrad, jac,
f.jvp, f.vjp,
f.jac_prototype,
f.sparsity,
f.Wfact,
f.Wfact_t,
f.paramjac,
f.ggprime,
f.colorvec),
typeof(f.ggprime), typeof(f.colorvec), typeof(f.initialization_data),
typeof(f.sys)}(f.f, gwh, h, f.mass_matrix, f.analytic, f.tgrad, jac,
f.jvp, f.vjp, f.jac_prototype, f.sparsity, f.Wfact, f.Wfact_t, f.paramjac,
f.ggprime, f.colorvec, f.initialization_data, f.sys),
gwh
end