pub struct ArrayN<T> { /* private fields */ }Expand description
Owned dynamic-rank row-major array.
Implementations§
Source§impl<T> ArrayN<T>
impl<T> ArrayN<T>
Sourcepub fn from_vec(shape: Vec<usize>, data: Vec<T>) -> Result<Self>
pub fn from_vec(shape: Vec<usize>, data: Vec<T>) -> Result<Self>
Build an array from row-major data.
Sourcepub fn as_mut_slice(&mut self) -> &mut [T]
pub fn as_mut_slice(&mut self) -> &mut [T]
Borrow the backing slice mutably.
Sourcepub fn view(&self) -> ArrayViewN<'_, T>
pub fn view(&self) -> ArrayViewN<'_, T>
Immutable dynamic-rank view.
Sourcepub fn view_mut(&mut self) -> ArrayViewMutN<'_, T>
pub fn view_mut(&mut self) -> ArrayViewMutN<'_, T>
Mutable dynamic-rank view.
Sourcepub fn slice_axis(&self, axis: usize, index: usize) -> Result<ArrayViewN<'_, T>>
pub fn slice_axis(&self, axis: usize, index: usize) -> Result<ArrayViewN<'_, T>>
Fix one axis at index, returning a lower-rank immutable view.
Sourcepub fn slice_axis_mut(
&mut self,
axis: usize,
index: usize,
) -> Result<ArrayViewMutN<'_, T>>
pub fn slice_axis_mut( &mut self, axis: usize, index: usize, ) -> Result<ArrayViewMutN<'_, T>>
Fix one axis at index, returning a lower-rank mutable view.
Trait Implementations§
impl<T> StructuralPartialEq for ArrayN<T>
Auto Trait Implementations§
impl<T> Freeze for ArrayN<T>
impl<T> RefUnwindSafe for ArrayN<T>where
T: RefUnwindSafe,
impl<T> Send for ArrayN<T>where
T: Send,
impl<T> Sync for ArrayN<T>where
T: Sync,
impl<T> Unpin for ArrayN<T>where
T: Unpin,
impl<T> UnsafeUnpin for ArrayN<T>
impl<T> UnwindSafe for ArrayN<T>where
T: 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