Solver

Struct Solver 

Source
pub struct Solver<T> {
    pub sparse: Matrix<T>,
    pub ilu: Preconditioner<T>,
    pub merge_buffer: Vec<usize>,
    pub r_vec: Vec<T>,
    pub u_vec: Vec<T>,
    pub conv: Vec<T>,
    pub conv_ratio_tol: T,
    pub max_num_iteration: usize,
    pub ap_vec: Vec<T>,
    pub p_vec: Vec<T>,
}
Expand description

class of linear system solver

  • sparse - sparse square coefficient matrix
  • r_vec - residual vector (i.e., rhs vector)

Fields§

§sparse: Matrix<T>§ilu: Preconditioner<T>§merge_buffer: Vec<usize>§r_vec: Vec<T>§u_vec: Vec<T>§conv: Vec<T>§conv_ratio_tol: T§max_num_iteration: usize§ap_vec: Vec<T>§p_vec: Vec<T>

Implementations§

Source§

impl<T> Solver<T>
where T: 'static + Copy + Float + Default + AddAssign + Display + MulAssign + SubAssign, f32: AsPrimitive<T>,

Source

pub fn new() -> Self

Source

pub fn initialize(&mut self, colind: &Vec<usize>, rowptr: &Vec<usize>)

Source

pub fn begin_merge(&mut self)

set zero to the matrix

Source

pub fn end_merge(&mut self)

Source

pub fn solve_cg(&mut self)

Source

pub fn solve_pcg(&mut self)

Source

pub fn clone(&self) -> Self

Auto Trait Implementations§

§

impl<T> Freeze for Solver<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for Solver<T>
where T: RefUnwindSafe,

§

impl<T> Send for Solver<T>
where T: Send,

§

impl<T> Sync for Solver<T>
where T: Sync,

§

impl<T> Unpin for Solver<T>
where T: Unpin,

§

impl<T> UnwindSafe for Solver<T>
where T: UnwindSafe,

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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
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.