Skip to main content

ShiftInvert

Struct ShiftInvert 

Source
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>

Source

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).

Source

pub fn sigma(&self) -> T

The shift.

Source§

impl<T: Real> ShiftInvert<T>

Source

fn lu_solve(&mut self, x: &[T], y: &mut [T])

y ← F⁻¹x by ftran (row-indexed in, column-indexed out).

Trait Implementations§

Source§

impl<T: Debug + Real> Debug for ShiftInvert<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T: Real> LinearOperator<T> for ShiftInvert<T>

Source§

fn nrows(&self) -> usize

Rows of A (length of y).
Source§

fn ncols(&self) -> usize

Columns of A (length of x).
Source§

fn apply(&mut self, x: &[T], y: &mut [T]) -> Result<(), OperatorError>

y ← A x. Read more
Source§

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 more

Auto 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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.