[][src]Trait shine_graph::smat::MatrixMask

pub trait MatrixMask {
    fn clear(&mut self);
fn add(&mut self, row: usize, column: usize) -> (DataPosition, bool);
fn remove(
        &mut self,
        row: usize,
        column: usize
    ) -> Option<(DataPosition, DataRange)>;
fn get_data_range(&self, row: usize) -> DataRange;
fn lower_bound_column_position(
        &self,
        column: usize,
        range: DataRange
    ) -> Option<(usize, DataPosition)>;
fn get_column_index(&self, pos: DataPosition) -> usize; }

Sparse (Square) Row matrix mask to manage the location of the non-zero items

Required methods

fn clear(&mut self)

Remove all the items.

fn add(&mut self, row: usize, column: usize) -> (DataPosition, bool)

Store an item and return a tuple where

  • the first item is its position in the flattened array
  • the second item is true if it was an unoccupied item, false otherwise.

fn remove(
    &mut self,
    row: usize,
    column: usize
) -> Option<(DataPosition, DataRange)>

Remove an item and return its position in the flattened array and the new range for the this row

fn get_data_range(&self, row: usize) -> DataRange

Return the range of position for the given row in the flattened array.

fn lower_bound_column_position(
    &self,
    column: usize,
    range: DataRange
) -> Option<(usize, DataPosition)>

Find the first valid column index and its position that is not less than the provided index.

fn get_column_index(&self, pos: DataPosition) -> usize

Gets the column index of item stored at the given position in the flattend array.

Loading content...

Implementors

impl MatrixMask for CSMatrixMask[src]

impl MatrixMask for HCSMatrixMask[src]

Loading content...