[][src]Struct ohsl::matrix::Sparse

pub struct Sparse<T> { /* fields omitted */ }

Implementations

impl<T: Clone + Number> Sparse<T>[src]

pub fn empty(rows: usize, cols: usize) -> Self[src]

Create a new sparse matrix where all values are zero

pub fn new(
    rows: usize,
    cols: usize,
    mut triplets: &mut Vector<Triplet<T>>
) -> Self
[src]

Create a new sparse matrix from a Vector of Triplets

pub fn rows(&self) -> usize[src]

Return the number of rows in the sparse matrix

pub fn cols(&self) -> usize[src]

Return the number of columns in the sparse matrix

pub fn nonzero(&self) -> usize[src]

Return the number of nonzero values

pub fn val(&self) -> Vector<T>[src]

Return the Vector of nonzero values

pub fn row_index(&self) -> Vector<usize>[src]

Return the vector of row indices

pub fn col_start(&self) -> Vector<usize>[src]

Return the vector of pointers to start of columns

pub fn scale(&mut self, scalar: T)[src]

Scale the Sparse matrix by a constant factor

pub fn multiply(&self, x: &Vector<T>) -> Vector<T>[src]

Multiply the Sparse matrix by a Vector to the right

pub fn transpose_multiply(&self, x: &Vector<T>) -> Vector<T>[src]

Multiply the transpose of the Sparse matrix by a Vector to the right

pub fn col_index(&self) -> Vector<usize>[src]

Return a Vector of column indices relating to each value (triplet form)

pub fn insert(&mut self, row: usize, col: usize, value: T)[src]

Insert a nonzero element into the SparseMatrix

impl Sparse<f64>[src]

pub fn solve_bicg(
    &self,
    b: Vec64,
    guess: Vec64,
    max_iter: usize,
    tol: f64
) -> Vec64
[src]

Solve the system of equations Ax=b using the biconjugate gradient method

pub fn solve_bicgstab(
    &self,
    b: Vec64,
    guess: Vec64,
    max_iter: usize,
    tol: f64
) -> Vec64
[src]

Solve the system of equations Ax=b using the stabilised biconjugate gradient method

Auto Trait Implementations

impl<T> RefUnwindSafe for Sparse<T> where
    T: RefUnwindSafe
[src]

impl<T> Send for Sparse<T> where
    T: Send
[src]

impl<T> Sync for Sparse<T> where
    T: Sync
[src]

impl<T> Unpin for Sparse<T> where
    T: Unpin
[src]

impl<T> UnwindSafe for Sparse<T> where
    T: UnwindSafe
[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

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