Trait scirust::matrix::traits::MatrixBuffer [] [src]

pub trait MatrixBuffer<T: MagmaBase> {
    fn as_ptr(&self) -> *const T;
    fn as_mut_ptr(&mut self) -> *mut T;
    fn cell_to_offset(&self, r: usize, c: usize) -> isize;

    fn start_offset(&self) -> isize { ... }
}

Defines the low level interface to the internal memory buffer of a matrix implementation. Use it with caution.

Required Methods

fn as_ptr(&self) -> *const T

Returns a constant pointer to matrix's buffer

fn as_mut_ptr(&mut self) -> *mut T

Returns a mutable pointer to matrix's buffer

fn cell_to_offset(&self, r: usize, c: usize) -> isize

Maps a cell index to actual offset in buffer

Provided Methods

fn start_offset(&self) -> isize

Returns the offset of the first cell in the buffer

Implementors