Struct rustlearn::array::sparse::SparseRowArray [] [src]

pub struct SparseRowArray {
    // some fields omitted
}

A sparse matrix with entries arranged row-wise.

Methods

impl SparseRowArray
[src]

fn zeros(rows: usize, cols: usize) -> SparseRowArray

Initialise an empty (rows by cols) matrix.

fn nnz(&self) -> usize

Return the number of nonzero entries.

fn todense(&self) -> Array

Trait Implementations

impl Decodable for SparseRowArray
[src]

fn decode<__D: Decoder>(__arg_0: &mut __D) -> Result<SparseRowArray, __D::Error>

impl Encodable for SparseRowArray
[src]

fn encode<__S: Encoder>(&self, __arg_0: &mut __S) -> Result<(), __S::Error>

impl IndexableMatrix for SparseRowArray
[src]

fn rows(&self) -> usize

Return the number of rows of the matrix.

fn cols(&self) -> usize

Return the number of columns of the matrix.

unsafe fn get_unchecked(&self, row: usize, column: usize) -> f32

Get the value of the entry at (row, column) without bounds checking.

unsafe fn get_unchecked_mut(&mut self, row: usize, column: usize) -> &mut f32

Get a mutable reference to the value of the entry at (row, column) without bounds checking. Read more

unsafe fn set_unchecked(&mut self, row: usize, column: usize, value: f32)

Set the value of the entry at (row, column) to value without bounds checking.

fn get(&self, row: usize, column: usize) -> f32

Get the value of the entry at (row, column). Read more

fn get_mut(&mut self, row: usize, column: usize) -> &mut f32

Get a mutable reference to value of the entry at (row, column). Read more

fn set(&mut self, row: usize, column: usize, value: f32)

Set the value of the entry at (row, column) to value. Read more

impl<'a> From<&'a Array> for SparseRowArray
[src]

fn from(array: &Array) -> SparseRowArray

Performs the conversion.

impl<'a> From<&'a SparseColumnArray> for SparseRowArray
[src]

fn from(array: &SparseColumnArray) -> SparseRowArray

Performs the conversion.

impl<'a> RowIterable for &'a SparseRowArray
[src]

type Item = SparseArrayView<'a>

type Output = SparseArrayIterator<'a>

fn iter_rows(self) -> SparseArrayIterator<'a>

Iterate over rows of the matrix.

fn iter_rows_range(self, range: Range<usize>) -> SparseArrayIterator<'a>

Iterate over a subset of rows of the matrix.

fn view_row(self, idx: usize) -> SparseArrayView<'a>

View a row of the matrix.

impl RowIndex<Vec<usize>> for SparseRowArray
[src]

type Output = SparseRowArray

fn get_rows(&self, index: &Vec<usize>) -> SparseRowArray