SolverUMFPACK

Struct SolverUMFPACK 

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

Wraps the UMFPACK solver for sparse linear systems

Warning: This solver may “run out of memory” for very large matrices.

Implementations§

Source§

impl SolverUMFPACK

Source

pub fn new() -> Result<Self, StrError>

Allocates a new instance

Trait Implementations§

Source§

impl Drop for SolverUMFPACK

Source§

fn drop(&mut self)

Tells the c-code to release memory

Source§

impl LinSolTrait for SolverUMFPACK

Source§

fn factorize( &mut self, mat: &CooMatrix, params: Option<LinSolParams>, ) -> Result<(), StrError>

Performs the factorization (and analysis/initialization if needed)

§Input
  • mat – the coefficient matrix A. The matrix must be square (nrow = ncol) and, if symmetric, the symmetric flag must be Sym::YesFull
  • params – configuration parameters; None => use default
§Notes
  1. The structure of the matrix (nrow, ncol, nnz, sym) must be exactly the same among multiple calls to factorize. The values may differ from call to call, nonetheless.
  2. The first call to factorize will define the structure which must be kept the same for the next calls.
  3. If the structure of the matrix needs to be changed, the solver must be “dropped” and a new solver allocated.
  4. For symmetric matrices, UMFPACK requires Sym::YesFull
Source§

fn solve( &mut self, x: &mut Vector, rhs: &Vector, verbose: bool, ) -> Result<(), StrError>

Computes the solution of the linear system

Solves the linear system:

  A   · x = rhs
(m,m)  (m)  (m)
§Output
  • x – the vector of unknown values with dimension equal to mat.nrow
§Input
  • mat – the coefficient matrix A; it must be square and, if symmetric, Sym::YesFull.
  • rhs – the right-hand side vector with know values an dimension equal to mat.nrow
  • verbose – shows messages

Warning: the matrix must be same one used in factorize.

Source§

fn update_stats(&self, stats: &mut StatsLinSol)

Updates the stats structure (should be called after solve)

Source§

fn get_ns_init(&self) -> u128

Returns the nanoseconds spent on initialize

Source§

fn get_ns_fact(&self) -> u128

Returns the nanoseconds spent on factorize

Source§

fn get_ns_solve(&self) -> u128

Returns the nanoseconds spent on solve

Source§

impl Send for SolverUMFPACK

Enforce Send on the Rust structure

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