Trait ella_common::shape::Shape

source ·
pub trait Shape: Debug + Send + Sync + Clone + Eq + PartialEq + IndexMut<usize, Output = usize> + AsRef<[usize]> + AsMut<[usize]> + 'static {
    type Smaller: Shape;
    type Larger: Shape + RemoveAxis;

    const NDIM: Option<usize>;

    // Required methods
    fn ndim(&self) -> usize;
    fn size(&self) -> usize;
    fn zeros(ndim: usize) -> Self;

    // Provided methods
    fn slice(&self) -> &[usize] { ... }
    fn slice_mut(&mut self) -> &mut [usize] { ... }
    fn as_dyn(&self) -> Dyn { ... }
    fn broadcast<In, Out>(&self, other: &In) -> Result<Out>
       where In: Shape,
             Out: Shape { ... }
    fn indices(&self) -> ShapeIndexIter<Self>  { ... }
    fn axis(&self, axis: Axis) -> usize { ... }
}

Required Associated Types§

Required Associated Constants§

Required Methods§

source

fn ndim(&self) -> usize

source

fn size(&self) -> usize

source

fn zeros(ndim: usize) -> Self

Provided Methods§

source

fn slice(&self) -> &[usize]

source

fn slice_mut(&mut self) -> &mut [usize]

source

fn as_dyn(&self) -> Dyn

source

fn broadcast<In, Out>(&self, other: &In) -> Result<Out>where In: Shape, Out: Shape,

source

fn indices(&self) -> ShapeIndexIter<Self>

source

fn axis(&self, axis: Axis) -> usize

Implementors§

source§

impl Shape for Const<{ _ }>

source§

const NDIM: Option<usize> = _

§

type Smaller = Const<{$n - 1}>

§

type Larger = Const<{$n + 1}>

source§

impl Shape for Const<{ _ }>

source§

const NDIM: Option<usize> = _

§

type Smaller = Const<0>

§

type Larger = Const<{$n + 1}>

source§

impl Shape for Const<{ _ }>

source§

const NDIM: Option<usize> = _

§

type Smaller = Const<{$n - 1}>

§

type Larger = Const<{$n + 1}>

source§

impl Shape for Const<{ _ }>

source§

const NDIM: Option<usize> = _

§

type Smaller = Const<{$n - 1}>

§

type Larger = Const<{$n + 1}>

source§

impl Shape for Const<{ _ }>

source§

const NDIM: Option<usize> = _

§

type Smaller = Const<{$n - 1}>

§

type Larger = Const<{$n + 1}>

source§

impl Shape for Const<{ _ }>

source§

const NDIM: Option<usize> = _

§

type Smaller = Const<{$n - 1}>

§

type Larger = Dyn

source§

impl Shape for Const<{ _ }>

source§

const NDIM: Option<usize> = _

§

type Smaller = Const<{$n - 1}>

§

type Larger = Const<{$n + 1}>

source§

impl Shape for Dyn

source§

const NDIM: Option<usize> = None

§

type Smaller = Dyn

§

type Larger = Dyn