Skip to main content

coupling_components

Function coupling_components 

Source
pub fn coupling_components(hessian: ArrayView2<'_, f64>) -> Vec<usize>
Expand description

Coupling components of a symmetric coefficient Hessian: the connected components of the graph whose vertices are coefficient indices 0..p and whose edges are the structurally nonzero off-diagonal entries of H (#779).

Returns a length-p vector of component labels in 0..num_components, where two indices share a label iff they are connected through a chain of nonzero H[i,j] couplings. This is the exact structural partition the cone-of-influence sensitivity reuse is keyed on: a smoothing-parameter move whose stationarity-gradient derivative ∂g/∂ρ is supported only inside one component can change β = -H⁻¹ ∂g/∂ρ only inside that same component, so the sensitivity of every other component is provably unchanged and may be reused unrecomputed (lazy/local propagation).

The nonzero test is exact (!= 0.0), matching the structural-coupling gate used elsewhere for the joint inner Hessian: a tolerance would risk dropping a genuine (small) coupling edge and silently biasing the propagated sensitivity — the failure mode #779/#740 explicitly guard against. A block-diagonal H yields the all-singletons partition (one component per block-decoupled coordinate); a fully coupled H yields a single component (no shortcut, the full joint solve is required — and is what the non-coned path performs).