pub struct ComplexSparseSystem { /* private fields */ }Expand description
A complex sparse system whose sparsity pattern and values are both fixed across repeated solves, so the whole factorization — not merely the symbolic half — is computed once and reused.
This is the stronger guarantee RealSparseSystem cannot make: Newton’s
Jacobian changes numerically every iteration, so only the ordering can be
cached. The iterative-linear state estimator
(gridoxide’s se::iterative) is different — its system matrix
depends on the measurement set and on the assumption that voltage
magnitudes stay near their initial values, so it is genuinely constant and
only the right-hand side moves. That is exactly what makes the method
cheaper per iteration than Newton-Raphson, and it is why this type exists.
Implementations§
Source§impl ComplexSparseSystem
impl ComplexSparseSystem
Sourcepub fn new(n: usize, entries: &[(usize, usize, Complex<f64>)]) -> Option<Self>
pub fn new(n: usize, entries: &[(usize, usize, Complex<f64>)]) -> Option<Self>
Factorizes once. Returns None if the matrix is singular or malformed.
Sourcepub fn solve(&self, rhs: &[Complex<f64>]) -> Option<Vec<Complex<f64>>>
pub fn solve(&self, rhs: &[Complex<f64>]) -> Option<Vec<Complex<f64>>>
Solves A x = b against the cached factorization.
Singularity is checked on the result rather than reported by faer,
which returns NaN-poisoned values instead of an error — the same
contract solve_complex documents.
Sourcepub fn solve_adjoint(&self, rhs: &[Complex<f64>]) -> Option<Vec<Complex<f64>>>
pub fn solve_adjoint(&self, rhs: &[Complex<f64>]) -> Option<Vec<Complex<f64>>>
Solves Aᴴ x = b — the conjugate transpose — against the same cached
factorization.
No second factorization is involved, for the reason
RealFactorization::solve_transpose documents: an LU = PAQ
decomposition solves the transposed system by running the same
triangular factors in the opposite order.
The conjugate transpose rather than the plain one, because that is the
form the question comes in. A left eigenvector satisfies
wᴴ A = λ wᴴ, i.e. Aᴴ w = λ̄ w, and left eigenvectors are what
participation factors and eigenvalue sensitivities are built from
(dynamics::smallsignal). faer offers it directly as
solve_adjoint_in_place, so nothing here has to conjugate by hand.
Auto Trait Implementations§
impl Freeze for ComplexSparseSystem
impl RefUnwindSafe for ComplexSparseSystem
impl Send for ComplexSparseSystem
impl Sync for ComplexSparseSystem
impl Unpin for ComplexSparseSystem
impl UnsafeUnpin for ComplexSparseSystem
impl UnwindSafe for ComplexSparseSystem
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