pub struct DiisCoeffSolver {
convergence: f64,
max_coeff_sum: f64,
}Expand description
DIIS coefficient solver using SR1 inverse updates.
Implements the DIISC algorithm. Solves the DIIS equations iteratively while maintaining A⁻¹.
Fields§
§convergence: f64Convergence tolerance
max_coeff_sum: f64Maximum coefficient sum allowed
Implementations§
Source§impl DiisCoeffSolver
impl DiisCoeffSolver
Sourcepub fn new(convergence: f64) -> Self
pub fn new(convergence: f64) -> Self
Creates a new solver with specified convergence tolerance.
Sourcepub fn solve(
&self,
a: &TriangularMatrix,
a_inv: &mut TriangularMatrix,
coeffs: &mut [f64],
n_start: usize,
n_total: usize,
) -> Result<usize, GdiisError>
pub fn solve( &self, a: &TriangularMatrix, a_inv: &mut TriangularMatrix, coeffs: &mut [f64], n_start: usize, n_total: usize, ) -> Result<usize, GdiisError>
Solves for DIIS coefficients using iterative SR1 updates.
§Arguments
a- Lower triangular overlap matrix A[i,j] = <e_i, e_j>a_inv- Inverse of A (maintained via SR1 updates)coeffs- Initial coefficient guess (modified in place)n_start- Starting number of vectors (with existing solution)n_total- Total number of vectors to solve for
§Returns
Number of vectors actually used, or error if failed.
Sourcefn sr1_update(
&self,
a_inv: &mut TriangularMatrix,
dy: &[f64],
dx: &[f64],
n: usize,
) -> Result<(), GdiisError>
fn sr1_update( &self, a_inv: &mut TriangularMatrix, dy: &[f64], dx: &[f64], n: usize, ) -> Result<(), GdiisError>
SR1 update for inverse matrix.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DiisCoeffSolver
impl RefUnwindSafe for DiisCoeffSolver
impl Send for DiisCoeffSolver
impl Sync for DiisCoeffSolver
impl Unpin for DiisCoeffSolver
impl UnsafeUnpin for DiisCoeffSolver
impl UnwindSafe for DiisCoeffSolver
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<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.