AbstractShape

Trait AbstractShape 

Source
pub trait AbstractShape<Coord, Vector> {
    // Required methods
    fn size(&self) -> Coord;
    fn linearize(&self, p: Vector) -> Coord;
    fn delinearize(&self, i: Coord) -> Vector;
}
Expand description

The shape of an array with unspecified dimensionality.

Required Methods§

Source

fn size(&self) -> Coord

The number of elements in an array with this shape.

Source

fn linearize(&self, p: Vector) -> Coord

Translates a vector V (with an unspecified number of dimensions) into a single number T that can be used for linear indexing.

Source

fn delinearize(&self, i: Coord) -> Vector

The inverse of linearize.

Implementors§

Source§

impl<S, const N: usize> AbstractShape<<S as Shape<N>>::Coord, [<S as Shape<N>>::Coord; N]> for S
where S: Shape<N>,