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

pub struct SparseColumnArray {
    // some fields omitted
}

A sparse matrix with entries arranged column-wise.

Methods

impl SparseColumnArray
[src]

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

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 SparseColumnArray
[src]

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

impl Encodable for SparseColumnArray
[src]

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

impl IndexableMatrix for SparseColumnArray
[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 SparseColumnArray
[src]

fn from(array: &Array) -> SparseColumnArray

Performs the conversion.

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

fn from(array: &SparseRowArray) -> SparseColumnArray

Performs the conversion.

impl<'a> ColumnIterable for &'a SparseColumnArray
[src]

type Item = SparseArrayView<'a>

type Output = SparseArrayIterator<'a>

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

Iterate over columns of a the matrix.

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

Iterate over a subset of columns of the matrix.

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

View a column of the matrix.