Struct NDSlice

Source
pub struct NDSlice<'a, T: 'a> { /* private fields */ }
Expand description

Structure representing an immutable borrow of a n-dimensional array sub slice.

Trait Implementations§

Source§

impl<'a, 'b, 'c, T: Clone + Display + From<f32>, R: NDData<T> + Sized> Add<&'a R> for &'b NDSlice<'c, T>
where NDArray<T>: Blas<T>,

Source§

type Output = NDArray<T>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &'a R) -> NDArray<T>

Performs the + operation. Read more
Source§

impl<'a, 'b, T> Index<&'b [usize]> for NDSlice<'a, T>

Source§

type Output = T

The returned type after indexing.
Source§

fn index<'c>(&'c self, idx: &'b [usize]) -> &'c T

Performs the indexing (container[index]) operation. Read more
Source§

impl<'a, 'b, T> Index<&'b [usize; 1]> for NDSlice<'a, T>

Source§

type Output = T

The returned type after indexing.
Source§

fn index<'c>(&'c self, idx: &'b [usize; 1]) -> &'c T

Performs the indexing (container[index]) operation. Read more
Source§

impl<'a, 'b, T> Index<&'b [usize; 2]> for NDSlice<'a, T>

Source§

type Output = T

The returned type after indexing.
Source§

fn index<'c>(&'c self, idx: &'b [usize; 2]) -> &'c T

Performs the indexing (container[index]) operation. Read more
Source§

impl<'a, 'b, T> Index<&'b [usize; 3]> for NDSlice<'a, T>

Source§

type Output = T

The returned type after indexing.
Source§

fn index<'c>(&'c self, idx: &'b [usize; 3]) -> &'c T

Performs the indexing (container[index]) operation. Read more
Source§

impl<'a, 'b, 'c, T: Clone + Display + From<f32>, R: NDData<T> + Sized> Mul<&'a R> for &'b NDSlice<'c, T>
where NDArray<T>: Blas<T>,

Source§

type Output = NDArray<T>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &'a R) -> NDArray<T>

Performs the * operation. Read more
Source§

impl<'a, T> NDData<T> for NDSlice<'a, T>

Source§

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

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.
Source§

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

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

fn get_data(&self) -> &[T]

Return the underlying storage array as a slice.
Source§

fn dim(&self) -> usize

Return N, the number of dimensions.
Source§

fn size(&self) -> usize

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

fn idx<'a>(&'a self, idx: &[usize]) -> &'a T

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

impl<'a, T: 'a> NDSliceable<'a, T> for NDSlice<'a, T>

Source§

fn slice(&'a self, idx: &[usize]) -> NDSlice<'a, T>

Take a slice of length < N representing the sub slice index and return immutable borrow of the sub slice as an NDSlice. Because the storage is in row-major order and the slice need to be contiguous in the underlying storage array it means, for example, only the rows of a matrix can be borrowed.
Source§

impl<'a, T: PartialEq, O: NDData<T> + Sized> PartialEq<O> for NDSlice<'a, T>

Source§

fn eq(&self, other: &O) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a, T> SizedBuffer for NDSlice<'a, T>

Source§

impl<'a, 'b, 'c, T: Clone + Display + From<f32>, R: NDData<T> + Sized> Sub<&'a R> for &'b NDSlice<'c, T>
where NDArray<T>: Blas<T>,

Source§

type Output = NDArray<T>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: &'a R) -> NDArray<T>

Performs the - operation. Read more
Source§

impl<'a, T: Eq> Eq for NDSlice<'a, T>

Auto Trait Implementations§

§

impl<'a, T> Freeze for NDSlice<'a, T>

§

impl<'a, T> RefUnwindSafe for NDSlice<'a, T>
where T: RefUnwindSafe,

§

impl<'a, T> Send for NDSlice<'a, T>
where T: Sync,

§

impl<'a, T> Sync for NDSlice<'a, T>
where T: Sync,

§

impl<'a, T> Unpin for NDSlice<'a, T>

§

impl<'a, T> UnwindSafe for NDSlice<'a, T>
where T: RefUnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.