jac_prototype
Stable function · Evaluate the Jacobian
Tier: stable · Kind: function · Topic: Evaluate the Jacobian
| Julia | Python | Rust |
|---|---|---|
jac_prototype | not exported | not exported |
Julia
jac_prototype(jac::JacobianEvaluator)
jac_prototype(input; wrt, model_name)
jac_prototype(jac::JacobianEvaluator) -> SparseMatrixCSC{Float64,Int}
jac_prototype(input; wrt = :states, model_name = nothing)
A freshly zeroed sparse prototype on the structural pattern — the object to
pass as ODEFunction(f!; jac_prototype = …). Stored (structural) zeros are
kept so the pattern is point-independent.
Example (prepare)
jac = prepare_jacobian(file) # differentiate and compile once
J = jac_prototype(jac) # sparse matrix on the fixed pattern
u = fill(2.0, 12)
p = jac.p_default # the document's parameter values
jac(J, u, p, 0.0) # fill J in place, at any (u, p, t)
@assert size(J) == (12, 12)
@assert nnz(J) == 24
@assert J[1, 1] == -0.04
Python
Python does not export this function.
Rust
Rust does not export this function.