pub struct Dim<R: Unsigned> {
pub shape: Vec<usize>,
/* private fields */
}Fields§
§shape: Vec<usize>Implementations§
Source§impl<R: Unsigned> Dim<R>
impl<R: Unsigned> Dim<R>
pub fn new(dim: &[usize]) -> Result<Self, DimError>
pub fn shape(&self) -> Vec<usize>
pub fn get_number_elements(&self) -> usize
pub fn get_indexes(&self, n: &usize) -> Self
pub fn get_flat_pos<R2: Unsigned>( &self, indexes: &Dim<R2>, ) -> Result<usize, DimError>
pub fn remove_element(self, index: usize) -> Dim<Sub1<R>>
pub fn remove_element_notyped(self, index: usize) -> Dim<UTerm>
pub fn insert_element(self, index: usize, element: usize) -> Dim<Add1<R>>
pub fn insert_element_notyped(self, index: usize, element: usize) -> Dim<UTerm>
Sourcepub fn path_shape<R2: Unsigned>(&self, n: usize) -> Result<Dim<R2>, DimError>
pub fn path_shape<R2: Unsigned>(&self, n: usize) -> Result<Dim<R2>, DimError>
Paths a shape of rank R with ones in the left until is rank R2.
pub fn rev_cast_pos<R1: Unsigned, R2: Unsigned>( small_shape: &Dim<R1>, indexes: &Dim<R2>, ) -> Result<usize, DimError>
pub fn broadcast_shape<R2: Unsigned>( &self, other: &Dim<R2>, ) -> Result<Dim<Maximum<R, R2>>, DimError>
pub fn broadcast_shape_notyped<R2: Unsigned>( &self, other: &Dim<R2>, ) -> Result<Dim<UTerm>, DimError>
pub fn len(&self) -> usize
pub fn reverse(&self) -> Self
Trait Implementations§
impl<R: Eq + Unsigned> Eq for Dim<R>
impl<R: Unsigned> StructuralPartialEq for Dim<R>
Auto Trait Implementations§
impl<R> Freeze for Dim<R>
impl<R> RefUnwindSafe for Dim<R>where
R: RefUnwindSafe,
impl<R> Send for Dim<R>where
R: Send,
impl<R> Sync for Dim<R>where
R: Sync,
impl<R> Unpin for Dim<R>where
R: Unpin,
impl<R> UnwindSafe for Dim<R>where
R: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more