jacobian_block
Stable function · Serialize as a document block
Tier: stable · Kind: function · Topic: Serialize as a document block
| Julia | Python | Rust |
|---|---|---|
| not exported | jacobian_block | jacobian_block |
Julia
Julia does not export this function.
Python
jacobian_block(obj, model_name: str | None = None, wrt: str = 'states', cse: bool = True, cse_min_nodes: int = 12) -> dict
The §4 jacobians block for one model: entries (template-CSE’d by
default), the structure classification, and the block-local
expression_templates, plus the factorization plan where one exists
for the detected structure (per-cell block LU with Markowitz ordering).
Example (block)
block = earthsci_astdiff.jacobian_block(file)
assert block["structure"] == "block_diagonal"
assert block["factorization"]["type"] == "block_diagonal_lu"
json.dumps(block) # a plain, serializable dict
Rust
pub fn jacobian_block(file: &EsmFile, model_name: Option<&str>, wrt: Wrt, cse: bool, cse_min_nodes: usize) -> Result<Value, BandError>
The jacobians block for one model (spec §4): entries (template-CSE’d when
cse is set, hoisting subtrees of at least cse_min_nodes nodes), the
structure classification, and the factorization plan where one exists.
Example (block)
let block = jacobian_block(&file, None, Wrt::States, true, 12)?;
assert_eq!(block["structure"], "block_diagonal");
assert_eq!(block["factorization"]["type"], "block_diagonal_lu");