NeumannSolver

Struct NeumannSolver 

Source
pub struct NeumannSolver { /* private fields */ }
Expand description

Neumann series solver implementation.

Solves systems of the form Ax = b by reformulating as (I - M)x = D^(-1)b where M = I - D^(-1)A and D is the diagonal of A.

The solution is computed using the Neumann series: x = (I - M)^(-1) D^(-1) b = Σ_{k=0}^∞ M^k D^(-1) b

For diagonally dominant matrices, ||M|| < 1, ensuring convergence.

Implementations§

Source§

impl NeumannSolver

Source

pub fn new(max_terms: usize, series_tolerance: Precision) -> Self

Create a new Neumann series solver.

§Arguments
  • max_terms - Maximum number of series terms (default: 50)
  • series_tolerance - Tolerance for series truncation (default: 1e-8)
§Example
use sublinear_solver::NeumannSolver;

let solver = NeumannSolver::new(16, 1e-8);
Source

pub fn default() -> Self

Create a solver with default parameters.

Source

pub fn high_precision() -> Self

Create a solver optimized for high precision.

Source

pub fn fast() -> Self

Create a solver optimized for speed.

Source

pub fn with_adaptive_truncation(self, enable: bool) -> Self

Configure adaptive truncation.

Source

pub fn with_power_caching(self, enable: bool) -> Self

Configure matrix power caching.

Trait Implementations§

Source§

impl Clone for NeumannSolver

Source§

fn clone(&self) -> NeumannSolver

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for NeumannSolver

Source§

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

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

impl SolverAlgorithm for NeumannSolver

Source§

fn solve( &self, matrix: &dyn Matrix, b: &[Precision], options: &SolverOptions, ) -> Result<SolverResult>

Custom solve implementation that provides matrix access to steps.

Source§

type State = NeumannState

Solver-specific state type
Source§

fn initialize( &self, matrix: &dyn Matrix, b: &[Precision], options: &SolverOptions, ) -> Result<Self::State>

Initialize the solver state for a given problem.
Source§

fn step(&self, state: &mut Self::State) -> Result<StepResult>

Perform a single iteration step.
Source§

fn is_converged(&self, state: &Self::State) -> bool

Check if the current state meets convergence criteria.
Source§

fn extract_solution(&self, state: &Self::State) -> Vec<Precision>

Extract the current solution from the state.
Source§

fn update_rhs( &self, state: &mut Self::State, delta_b: &[(usize, Precision)], ) -> Result<()>

Update the right-hand side for incremental solving.
Source§

fn algorithm_name(&self) -> &'static str

Get the algorithm name for identification.

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V