Trait rds::array::NDData [] [src]

pub trait NDData<T> {
    fn shape(&self) -> &[usize];
    fn strides(&self) -> &[usize];
    fn get_data(&self) -> &[T];

    fn dim(&self) -> usize { ... }
    fn size(&self) -> usize { ... }
    fn idx<'a>(&'a self, idx: &[usize]) -> &'a T { ... }
}

A trait for struture giving immutable access to a N-dimensional array of type T

Required Methods

Return a slice of length N where each element is the length of the dimension. For a 2 dimensional matrix, the first dimension is the number of rows and the second dimension is the number of columns.

Return a slice of length N where each element is the stride of the dimension.

Return the underlying storage array as a slice.

Provided Methods

Return N, the number of dimensions.

Return the total number of element of the N-dimensional array.

Take a slice of length N representing an N-dimensional index in the array and return a reference to the element at this position.

Implementors