pub struct ShiftInvert<T: Real = f64> {
sigma: T,
n: usize,
lu: Lu<T>,
work: SparseVec<T>,
m: CscMatrix<T>,
r: Vec<T>,
d: Vec<T>,
}Expand description
x ↦ (A − σI)⁻¹ x for a square sparse A, by the threshold LU of
xingo-sparse (Lu<T> over the columns of A − σI, factorized once),
with one step of iterative refinement per application (Algorithm R: two
solves and one product with A − σI, which the operator keeps). The
operator of eigs_near (Algorithm SG of Chapter 12.6.2).
Fields§
§sigma: T§n: usize§lu: Lu<T>§work: SparseVec<T>§m: CscMatrix<T>M = A − σI (Algorithm R).
r: Vec<T>The residual r of step R2.
d: Vec<T>The correction d = F⁻¹r of step R3.
Implementations§
Source§impl<T: Real> ShiftInvert<T>
impl<T: Real> ShiftInvert<T>
Sourcepub fn new(
a: &CscMatrix<T>,
sigma: T,
opts: LuOptions,
) -> Result<Self, StatlaError>
pub fn new( a: &CscMatrix<T>, sigma: T, opts: LuOptions, ) -> Result<Self, StatlaError>
Factorize A − σI.
§Errors
StatlaError::InvalidArgument (not square; options outside the
domain xingo-sparse asserts), StatlaError::NonFinite (a,
sigma), StatlaError::Lu (a structurally invalid a, or
singular: σ is, numerically, an eigenvalue).
Trait Implementations§
Source§impl<T: Real> LinearOperator<T> for ShiftInvert<T>
impl<T: Real> LinearOperator<T> for ShiftInvert<T>
Source§fn apply_block(
&mut self,
x: MatRef<'_, T>,
y: MatMut<'_, T>,
) -> Result<(), OperatorError>
fn apply_block( &mut self, x: MatRef<'_, T>, y: MatMut<'_, T>, ) -> Result<(), OperatorError>
Y ← A X for a block of columns; the default loops over
LinearOperator::apply. Dense and sparse implementations
override it (one pass over A for l columns — the cost that
matters in crate::rsvd()). Read moreAuto Trait Implementations§
impl<T> Freeze for ShiftInvert<T>where
T: Freeze,
impl<T> RefUnwindSafe for ShiftInvert<T>where
T: RefUnwindSafe,
impl<T> Send for ShiftInvert<T>where
T: Send,
impl<T> Sync for ShiftInvert<T>where
T: Sync,
impl<T> Unpin for ShiftInvert<T>where
T: Unpin,
impl<T> UnsafeUnpin for ShiftInvert<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for ShiftInvert<T>where
T: UnwindSafe,
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