pub struct BlockLu { /* private fields */ }Expand description
A numeric block LU factorization, computed against a BlockSymbolic’s
known structure — either freshly analyzed (factorize) or reusing an
existing BlockSymbolic across calls (refactor, the cheap path used
once per Newton-Raphson iteration).
Simplification, clearly scoped: this uses the diagonal entry as the
pivot for each column directly — no partial pivoting (row swapping).
Partial pivoting on a sparse block matrix would mean swapping entries
across every already-factored column’s stored structure, potentially
inserting or removing sparse entries (new fill-in from the swap itself),
a substantially larger and more fragile undertaking than the rest of this
module. Power-system Y-bus/Jacobian matrices are normally diagonally
dominant enough for this to succeed; factorization returns None
(treated as singular, same contract as sparse::RealSparseSystem) if a
diagonal pivot is ever too close to singular, rather than silently
producing a wrong answer.
Relies on the Y-bus/Jacobian’s sparsity pattern being structurally
symmetric (if bus i affects bus k, bus k affects bus i too, since
branch admittance couples both directions) for BlockSymbolic::analyze’s
structural reachability search, which uses BlockAdjacency::row for both
row and column structural lookups on that assumption. The numeric scatter
step below needs actual column values though (block(i, j) != block(j, i) in general for this matrix), so it reads
BlockAdjacency::col rather than reusing row values under the same
assumption.
Implementations§
Source§impl BlockLu
impl BlockLu
Sourcepub fn factorize(adj: &BlockAdjacency) -> Option<Self>
pub fn factorize(adj: &BlockAdjacency) -> Option<Self>
Analyzes adj’s structure and factorizes it in one step. Prefer
refactor when solving the same sparsity pattern repeatedly (e.g.
across Newton-Raphson iterations) — it skips the colamd ordering
and elimination-graph reachability search entirely, reusing a cached
BlockSymbolic instead.
Sourcepub fn refactor(symbolic: &BlockSymbolic, adj: &BlockAdjacency) -> Option<Self>
pub fn refactor(symbolic: &BlockSymbolic, adj: &BlockAdjacency) -> Option<Self>
Numeric-only refactorization against symbolic’s known structure —
no ordering or reachability recomputation, just walking the already
known l_struct/u_struct positions and computing their (new)
numeric values. Returns None if any diagonal pivot is singular.
adj must have the exact same sparsity pattern symbolic was built
from (values may differ) — this is not re-validated, matching
sparse::RealSparseSystem::factor_and_solve’s same-pattern
requirement.
Auto Trait Implementations§
impl Freeze for BlockLu
impl RefUnwindSafe for BlockLu
impl Send for BlockLu
impl Sync for BlockLu
impl Unpin for BlockLu
impl UnsafeUnpin for BlockLu
impl UnwindSafe for BlockLu
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T, U> Imply<T> for U
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more