pub struct SpectralRadiusComputer {
pub max_iters: u32,
pub tol: f64,
}Expand description
Computes the spectral radius of a square matrix via the power method.
The power method applied to ||A^k||^{1/k} converges monotonically down to r(A) by the Gelfand formula.
Fields§
§max_iters: u32Maximum number of iterations for the power iteration.
tol: f64Convergence tolerance: stop when successive estimates differ by less
than tol.
Implementations§
Source§impl SpectralRadiusComputer
impl SpectralRadiusComputer
Sourcepub fn new(max_iters: u32, tol: f64) -> Self
pub fn new(max_iters: u32, tol: f64) -> Self
Create a new computer with given iteration count and tolerance.
Sourcepub fn compute(&self, mat: &SquareMatrix) -> f64
pub fn compute(&self, mat: &SquareMatrix) -> f64
Compute the spectral radius of mat using the Gelfand formula
r(A) = inf_k ||A^k||^{1/k}.
Returns the best estimate found within max_iters steps.
Sourcepub fn power_vector_method(&self, mat: &SquareMatrix, init: &[f64]) -> f64
pub fn power_vector_method(&self, mat: &SquareMatrix, init: &[f64]) -> f64
Use the power-vector method: iterate v_{k+1} = A v_k / ||A v_k|| and track ||A v_k|| to estimate the dominant eigenvalue magnitude.
Trait Implementations§
Source§impl Clone for SpectralRadiusComputer
impl Clone for SpectralRadiusComputer
Source§fn clone(&self) -> SpectralRadiusComputer
fn clone(&self) -> SpectralRadiusComputer
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for SpectralRadiusComputer
impl RefUnwindSafe for SpectralRadiusComputer
impl Send for SpectralRadiusComputer
impl Sync for SpectralRadiusComputer
impl Unpin for SpectralRadiusComputer
impl UnsafeUnpin for SpectralRadiusComputer
impl UnwindSafe for SpectralRadiusComputer
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