pub struct YBusSparse { /* private fields */ }Expand description
A finalized, frozen Y-bus: consolidated per-row admittance neighbors (for
sparse-aware assembly of the linear initial guess and the Jacobian) plus
a ready-to-use sparse matrix (for power_injections’s mat-vec, needed
every Newton-Raphson iteration). Built once via YBus::finish.
Implementations§
Source§impl YBusSparse
impl YBusSparse
pub fn n(&self) -> usize
Sourcepub fn row(&self, i: usize) -> &[(usize, Complex<f64>)]
pub fn row(&self, i: usize) -> &[(usize, Complex<f64>)]
The (col, value) pairs for row i’s actual admittance neighbors
(including the diagonal), sorted by column index.
Sourcepub fn get(&self, i: usize, j: usize) -> Complex<f64>
pub fn get(&self, i: usize, j: usize) -> Complex<f64>
The value at (i, j), or zero if there’s no entry there.
pub fn mul_vec(&self, v: &[Complex<f64>]) -> Vec<Complex<f64>>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for YBusSparse
impl RefUnwindSafe for YBusSparse
impl Send for YBusSparse
impl Sync for YBusSparse
impl Unpin for YBusSparse
impl UnsafeUnpin for YBusSparse
impl UnwindSafe for YBusSparse
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> ⓘ
Converts
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> ⓘ
Converts
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