Type Definition sprs::TriMatI[][src]

type TriMatI<N, I> = TriMatBase<Vec<I>, Vec<N>>;

Implementations

impl<N, I: SpIndex> TriMatI<N, I>[src]

pub fn new(shape: (usize, usize)) -> Self[src]

Create a new triplet matrix of shape (nb_rows, nb_cols)

pub fn with_capacity(shape: (usize, usize), cap: usize) -> Self[src]

Create a new triplet matrix of shape (nb_rows, nb_cols), and pre-allocate cap elements on the backing storage

pub fn from_triplets(
    shape: (usize, usize),
    row_inds: Vec<I>,
    col_inds: Vec<I>,
    data: Vec<N>
) -> Self
[src]

Create a triplet matrix from its raw components. All arrays should have the same length.

Panics

  • if the arrays don’t have the same length
  • if either the row or column indices are out of bounds.

pub fn add_triplet(&mut self, row: usize, col: usize, val: N)[src]

Append a non-zero triplet to this matrix.

pub fn reserve(&mut self, cap: usize)[src]

Reserve cap additional non-zeros

pub fn reserve_exact(&mut self, cap: usize)[src]

Reserve exactly cap non-zeros