pub struct AugmentedKrylov { /* private fields */ }Expand description
Augmented Krylov subspace solver (augmented GMRES).
§Overview
Given an augmentation subspace W (external knowledge vectors – e.g., from previous solves or approximate eigenvectors), solves A x = b in the space x_0 + span(W) + K_m(A, r_0).
The solver uses standard GMRES (Arnoldi + least-squares) for the Krylov portion, and incorporates augmentation vectors by projecting the residual onto the range of A*W before each GMRES cycle.
After convergence, an updated augmentation subspace is extracted from the last Krylov basis for use in subsequent solves.
Implementations§
Source§impl AugmentedKrylov
impl AugmentedKrylov
Sourcepub fn new(config: AugmentedKrylovConfig) -> Self
pub fn new(config: AugmentedKrylovConfig) -> Self
Create an AugmentedKrylov solver with the given configuration.
Sourcepub fn with_defaults() -> Self
pub fn with_defaults() -> Self
Create with default configuration.
Sourcepub fn solve<F>(
&self,
matvec: F,
b: &[f64],
x0: Option<&[f64]>,
augmentation: &[Vec<f64>],
) -> Result<AugmentedKrylovResult, SparseError>
pub fn solve<F>( &self, matvec: F, b: &[f64], x0: Option<&[f64]>, augmentation: &[Vec<f64>], ) -> Result<AugmentedKrylovResult, SparseError>
Solve A x = b with augmented Krylov subspace.
§Arguments
matvec- Closure for the matrix-vector product y = A x.b- Right-hand side.x0- Optional initial guess.augmentation- External vectors to augment the Krylov space. These are incorporated by projecting the residual onto span(A*W) at each restart. Pass an empty slice for standard (non-augmented) GMRES.
§Returns
An AugmentedKrylovResult containing the solution and updated augmentation
vectors.
Auto Trait Implementations§
impl Freeze for AugmentedKrylov
impl RefUnwindSafe for AugmentedKrylov
impl Send for AugmentedKrylov
impl Sync for AugmentedKrylov
impl Unpin for AugmentedKrylov
impl UnsafeUnpin for AugmentedKrylov
impl UnwindSafe for AugmentedKrylov
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
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