Struct rds::array::NDSlice
[−]
[src]
pub struct NDSlice<'a, T: 'a> { /* fields omitted */ }
Structure representing an immutable borrow of a n-dimensional array sub slice.
Trait Implementations
impl<'a, T> NDData<T> for NDSlice<'a, T>
[src]
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. Read more
fn strides(&self) -> &[usize]
Return a slice of length N where each element is the stride of the dimension.
fn get_data(&self) -> &[T]
Return the underlying storage array as a slice.
fn dim(&self) -> usize
Return N, the number of dimensions.
fn size(&self) -> usize
Return the total number of element of the N-dimensional array.
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. Read more
impl<'a, T: 'a> NDSliceable<'a, T> for NDSlice<'a, T>
[src]
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. Read more
impl<'a, 'b, T> Index<&'b [usize]> for NDSlice<'a, T>
[src]
type Output = T
The returned type after indexing
fn index<'c>(&'c self, idx: &'b [usize]) -> &'c T
The method for the indexing (container[index]
) operation
impl<'a, 'b, T> Index<&'b [usize; 1]> for NDSlice<'a, T>
[src]
type Output = T
The returned type after indexing
fn index<'c>(&'c self, idx: &'b [usize; 1]) -> &'c T
The method for the indexing (container[index]
) operation
impl<'a, 'b, T> Index<&'b [usize; 2]> for NDSlice<'a, T>
[src]
type Output = T
The returned type after indexing
fn index<'c>(&'c self, idx: &'b [usize; 2]) -> &'c T
The method for the indexing (container[index]
) operation
impl<'a, 'b, T> Index<&'b [usize; 3]> for NDSlice<'a, T>
[src]
type Output = T
The returned type after indexing
fn index<'c>(&'c self, idx: &'b [usize; 3]) -> &'c T
The method for the indexing (container[index]
) operation
impl<'a, T: PartialEq, O: NDData<T> + Sized> PartialEq<O> for NDSlice<'a, T>
[src]
fn eq(&self, other: &O) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0
This method tests for !=
.
impl<'a, T: Eq> Eq for NDSlice<'a, T>
[src]
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>,
[src]
NDArray<T>: Blas<T>,
type Output = NDArray<T>
The resulting type after applying the +
operator
fn add(self, rhs: &'a R) -> NDArray<T>
The method for the +
operator
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>,
[src]
NDArray<T>: Blas<T>,
type Output = NDArray<T>
The resulting type after applying the -
operator
fn sub(self, rhs: &'a R) -> NDArray<T>
The method for the -
operator
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>,
[src]
NDArray<T>: Blas<T>,
type Output = NDArray<T>
The resulting type after applying the *
operator
fn mul(self, rhs: &'a R) -> NDArray<T>
The method for the *
operator