Project

EarthSciASTDiff

Analytical sparse Jacobians for EarthSciAST (.esm) models by symbolic differentiation of the expression AST.

Contents

This is the documentation for the older version v0.7.0. For the latest release, see v0.8.0.

column_lines

Stable function · Sparsity and structure

Tier: stable · Kind: function · Topic: Sparsity and structure

JuliaPythonRust
column_linescolumn_linescolumn_lines

Julia

column_lines(entries::Vector{JacEntry}, sv::SysView, axis::String)
column_lines(entries, sv, axis::String) -> Union{NamedTuple, Nothing}

The per-line structure of a state Jacobian whose couplings all stay within one line along index set axis, or nothing when one does not: every band couples two array states of one common shape that holds axis once, and at every band point the column equals the row in every other dimension. A point reading past the axis is a ghost read and does not count. Returns (axis, dim, line_length, block_vars, kl, ku, pattern, rank1, rank1_undecided): kl / ku the largest distances below / above the diagonal any point reaches along the axis, and pattern their name — "dense" (both span the line), "lower", "upper", "banded" or "diag_plus_rank1" — read off the exact band points, never probed, with rank1 the rank-one terms of a "diag_plus_rank1" line block (esm-jacobian-spec.md §6; empty otherwise).

Structure-only entries (§2.1) carry no coefficient to factor. When every entry off distance 0 has the shape of a rank-one term and one of them has no coefficient, whether the line block is "diag_plus_rank1" depends on the coefficients: rank1_undecided is then true, pattern names the bandwidth alone and rank1 is empty, and plan_factorization refuses to plan from it.

Source

Python

column_lines(entries: list[JacEntry], sv: SysView, axis: str) -> dict | None

The per-line structure of a state Jacobian whose couplings all stay within one line along index set axis, or None when one does not (structure.jl column_lines): every band couples two array states of one common shape that holds axis once, and at every band point the column equals the row in every other dimension. A point reading past the axis is a ghost read and does not count. Returns a dict with axis, dim (1-based), line_length, block_vars, kl / ku (the largest distances below / above the diagonal any point reaches along the axis) and pattern — "dense", "lower", "upper", "banded" or "diag_plus_rank1" — read off the exact band points, never probed, with rank1 the rank-one terms of a "diag_plus_rank1" line block (spec §6; empty otherwise).

Source

Rust

pub fn column_lines(entries: &[JacEntry], sv: &SysView<'_>, ctx: &Ctx, axis: &str) -> Result<Option<ColumnLines>, BandError>

The per-line structure of a state Jacobian along index set axis, or None when a coupling leaves its line: every band couples two array states of one common shape that holds axis once, and at every band point the column equals the row in every other dimension. A point reading past the axis is a ghost read and does not count. kl / ku and their pattern name are read off the exact band points (guards applied), never probed.

Source · Rust docs