Trait rusty_machine::linalg::matrix::slice::BaseSlice [] [src]

pub trait BaseSlice<T> {
    fn rows(&self) -> usize;
    fn cols(&self) -> usize;
    fn row_stride(&self) -> usize;
    fn as_ptr(&self) -> *const T;
    unsafe fn get_unchecked(&self, index: [usize; 2]) -> &T;
}

Trait for Matrix Slices.

Required Methods

fn rows(&self) -> usize

Rows in the slice.

fn cols(&self) -> usize

Columns in the slice.

fn row_stride(&self) -> usize

Row stride in the slice.

fn as_ptr(&self) -> *const T

Top left index of the slice.

unsafe fn get_unchecked(&self, index: [usize; 2]) -> &T

Get a reference to a point in the slice without bounds checking.

Implementors