@@ -455,6 +455,7 @@ SplitFunction{iip,specialize}(f1,f2;
455
455
jvp = __has_jvp(f1) ? f1.jvp : nothing,
456
456
vjp = __has_vjp(f1) ? f1.vjp : nothing,
457
457
jac_prototype = __has_jac_prototype(f1) ? f1.jac_prototype : nothing,
458
+ W_prototype = __has_W_prototype(f1) ? f1.W_prototype : nothing,
458
459
sparsity = __has_sparsity(f1) ? f1.sparsity : jac_prototype,
459
460
paramjac = __has_paramjac(f1) ? f1.paramjac : nothing,
460
461
colorvec = __has_colorvec(f1) ? f1.colorvec : nothing,
@@ -484,6 +485,11 @@ the usage of the `SplitFunction`. These include:
484
485
as the prototype and integrators will specialize on this structure where possible. Non-structured
485
486
sparsity patterns should use a `SparseMatrixCSC` with a correct sparsity pattern for the Jacobian.
486
487
The default is `nothing`, which means a dense Jacobian.
488
+ - `W_prototype`: a prototype matrix matching the type that matches the W matrix. For example,
489
+ if the Jacobian is tridiagonal, and the mass_matrix is diagonal, then an appropriately sized `Tridiagonal`
490
+ matrix can be used as the prototype and integrators will specialize on this structure where possible. Non-structured
491
+ sparsity patterns should use a `SparseMatrixCSC` with a correct sparsity pattern for the W matrix.
492
+ The default is `nothing`, which means a W of appropriate type for the jacobian and linear solver
487
493
- `paramjac(pJ,u,p,t)`: returns the parameter Jacobian ``\f rac{df_1}{dp}``.
488
494
- `colorvec`: a color vector according to the SparseDiffTools.jl definition for the sparsity
489
495
pattern of the `jac_prototype`. This specializes the Jacobian construction when using
@@ -3080,7 +3086,7 @@ SDEFunction(f::SDEFunction; kwargs...) = f
3080
3086
3081
3087
@add_kwonly function SplitSDEFunction (f1, f2, g, mass_matrix, cache, analytic, tgrad, jac,
3082
3088
jvp, vjp,
3083
- jac_prototype, Wfact, Wfact_t, paramjac, observed,
3089
+ jac_prototype, W_prototype, Wfact, Wfact_t, paramjac, observed,
3084
3090
colorvec, sys)
3085
3091
f1 = f1 isa AbstractSciMLOperator ? f1 : SDEFunction (f1)
3086
3092
f2 = SDEFunction (f2)
@@ -3091,7 +3097,7 @@ SDEFunction(f::SDEFunction; kwargs...) = f
3091
3097
typeof (Wfact), typeof (Wfact_t), typeof (paramjac), typeof (observed),
3092
3098
typeof (colorvec),
3093
3099
typeof (sys)}(f1, f2, mass_matrix, cache, analytic, tgrad, jac,
3094
- jac_prototype, Wfact, Wfact_t, paramjac, observed, colorvec, sys)
3100
+ jac_prototype, W_prototype, Wfact, Wfact_t, paramjac, observed, colorvec, sys)
3095
3101
end
3096
3102
3097
3103
function SplitSDEFunction {iip, specialize} (f1, f2, g;
0 commit comments