Struct NDSliceMut

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

Structure representing an mutable 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 NDSliceMut<'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: Clone + Display + From<f32>, R: NDData<T> + Sized> AddAssign<&'a R> for NDSliceMut<'b, T>
where NDSliceMut<'b, T>: Blas<T>,

Source§

fn add_assign(&mut self, rhs: &'a R)

Performs the += operation. Read more
Source§

impl<'a, 'b, T> Index<&'b [usize]> for NDSliceMut<'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 NDSliceMut<'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 NDSliceMut<'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 NDSliceMut<'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, T: Clone + Display> IndexMut<&'b [usize]> for NDSliceMut<'a, T>

Source§

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

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

impl<'a, 'b, T: Clone + Display> IndexMut<&'b [usize; 1]> for NDSliceMut<'a, T>

Source§

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

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

impl<'a, 'b, T: Clone + Display> IndexMut<&'b [usize; 2]> for NDSliceMut<'a, T>

Source§

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

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

impl<'a, 'b, T: Clone + Display> IndexMut<&'b [usize; 3]> for NDSliceMut<'a, T>

Source§

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

Performs the mutable 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 NDSliceMut<'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, 'b, T: Clone + Display + From<f32>, I: NDData<T> + Sized> MulAssign<&'b I> for NDSliceMut<'a, T>
where NDSliceMut<'a, T>: Blas<T> + NDData<T>,

Source§

fn mul_assign(&mut self, rhs: &'b I)

Performs the *= operation. Read more
Source§

impl<'a, T> NDData<T> for NDSliceMut<'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: Clone + Display> NDDataMut<T> for NDSliceMut<'a, T>

Source§

fn get_data_mut(&mut self) -> &mut [T]

Return the underlying storage array as a mutable slice.
Source§

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

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

fn transpose(&mut self)

Perform a generic transpose. All the dimensions need to be the same.
Source§

fn assign(&mut self, other: &dyn NDData<T>)

Assign another NDData to the NDDataMut. The shapes need to be identical.
Source§

impl<'a, T: 'a> NDSliceable<'a, T> for NDSliceMut<'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: 'a> NDSliceableMut<'a, T> for NDSliceMut<'a, T>

Source§

fn slice_mut(&'a mut self, idx: &[usize]) -> NDSliceMut<'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 NDSliceMut<'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 NDSliceMut<'a, T>

Source§

impl<'a, T: Clone + Display> SizedBufferMut for NDSliceMut<'a, T>
where NDSliceMut<'a, T>: SizedBuffer,

Source§

unsafe fn get_raw_ptr_mut(&mut self) -> *mut c_void

Source§

impl<'a, 'b, 'c, T: Clone + Display + From<f32>, R: NDData<T> + Sized> Sub<&'a R> for &'b NDSliceMut<'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, 'b, T: Clone + Display + From<f32>, R: NDData<T> + Sized> SubAssign<&'a R> for NDSliceMut<'b, T>
where NDSliceMut<'b, T>: Blas<T>,

Source§

fn sub_assign(&mut self, rhs: &'a R)

Performs the -= operation. Read more
Source§

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

Auto Trait Implementations§

§

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

§

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

§

impl<'a, T> Send for NDSliceMut<'a, T>
where T: Send,

§

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

§

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

§

impl<'a, T> !UnwindSafe for NDSliceMut<'a, T>

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<R> Blas<c32> for R
where R: NDDataMut<c32>,

Source§

fn asum(&self) -> c32

Compute an element-wise sum of the N-dimensional array.
Source§

fn nrm2(&self) -> c32

Compute the euclidian norm of the N-dimensional array.
Source§

fn scal(&mut self, a: c32)

Scale the N-dimensional array by a factor a.
Source§

fn axpy(&mut self, a: c32, x: &dyn NDData<c32>)

Compute y += a * x where y is this array, x is a N-dimensional array of the same size as y and a is a scalar.
Source§

fn dot(&self, x: &dyn NDData<c32>) -> c32

Compute the dot product of this array and x.
Source§

fn gemv( &mut self, alpha: c32, a: &dyn NDData<c32>, x: &dyn NDData<c32>, beta: c32, )

Compute y = alpha * a * x + beta * y where y is this array, x is a one dimensional array, a a two dimensional array and alpha and beta are scalars. Automatically determine whether a need to be transposed.
Source§

fn gemm( &mut self, alpha: c32, a: &dyn NDData<c32>, b: &dyn NDData<c32>, beta: c32, )

Compute y = alpha * a * x + beta * y where y is this array, a and b are two dimensional arrays and alpha and beta are scalars. Automatically determine whether a and b need to be transposed.
Source§

impl<R> Blas<c64> for R
where R: NDDataMut<c64>,

Source§

fn asum(&self) -> c64

Compute an element-wise sum of the N-dimensional array.
Source§

fn nrm2(&self) -> c64

Compute the euclidian norm of the N-dimensional array.
Source§

fn scal(&mut self, a: c64)

Scale the N-dimensional array by a factor a.
Source§

fn axpy(&mut self, a: c64, x: &dyn NDData<c64>)

Compute y += a * x where y is this array, x is a N-dimensional array of the same size as y and a is a scalar.
Source§

fn dot(&self, x: &dyn NDData<c64>) -> c64

Compute the dot product of this array and x.
Source§

fn gemv( &mut self, alpha: c64, a: &dyn NDData<c64>, x: &dyn NDData<c64>, beta: c64, )

Compute y = alpha * a * x + beta * y where y is this array, x is a one dimensional array, a a two dimensional array and alpha and beta are scalars. Automatically determine whether a need to be transposed.
Source§

fn gemm( &mut self, alpha: c64, a: &dyn NDData<c64>, b: &dyn NDData<c64>, beta: c64, )

Compute y = alpha * a * x + beta * y where y is this array, a and b are two dimensional arrays and alpha and beta are scalars. Automatically determine whether a and b need to be transposed.
Source§

impl<R> Blas<f32> for R
where R: NDDataMut<f32>,

Source§

fn asum(&self) -> f32

Compute an element-wise sum of the N-dimensional array.
Source§

fn nrm2(&self) -> f32

Compute the euclidian norm of the N-dimensional array.
Source§

fn scal(&mut self, a: f32)

Scale the N-dimensional array by a factor a.
Source§

fn axpy(&mut self, a: f32, x: &dyn NDData<f32>)

Compute y += a * x where y is this array, x is a N-dimensional array of the same size as y and a is a scalar.
Source§

fn dot(&self, x: &dyn NDData<f32>) -> f32

Compute the dot product of this array and x.
Source§

fn gemv( &mut self, alpha: f32, a: &dyn NDData<f32>, x: &dyn NDData<f32>, beta: f32, )

Compute y = alpha * a * x + beta * y where y is this array, x is a one dimensional array, a a two dimensional array and alpha and beta are scalars. Automatically determine whether a need to be transposed.
Source§

fn gemm( &mut self, alpha: f32, a: &dyn NDData<f32>, b: &dyn NDData<f32>, beta: f32, )

Compute y = alpha * a * x + beta * y where y is this array, a and b are two dimensional arrays and alpha and beta are scalars. Automatically determine whether a and b need to be transposed.
Source§

impl<R> Blas<f64> for R
where R: NDDataMut<f64>,

Source§

fn asum(&self) -> f64

Compute an element-wise sum of the N-dimensional array.
Source§

fn nrm2(&self) -> f64

Compute the euclidian norm of the N-dimensional array.
Source§

fn scal(&mut self, a: f64)

Scale the N-dimensional array by a factor a.
Source§

fn axpy(&mut self, a: f64, x: &dyn NDData<f64>)

Compute y += a * x where y is this array, x is a N-dimensional array of the same size as y and a is a scalar.
Source§

fn dot(&self, x: &dyn NDData<f64>) -> f64

Compute the dot product of this array and x.
Source§

fn gemv( &mut self, alpha: f64, a: &dyn NDData<f64>, x: &dyn NDData<f64>, beta: f64, )

Compute y = alpha * a * x + beta * y where y is this array, x is a one dimensional array, a a two dimensional array and alpha and beta are scalars. Automatically determine whether a need to be transposed.
Source§

fn gemm( &mut self, alpha: f64, a: &dyn NDData<f64>, b: &dyn NDData<f64>, beta: f64, )

Compute y = alpha * a * x + beta * y where y is this array, a and b are two dimensional arrays and alpha and beta are scalars. Automatically determine whether a and b need to be transposed.
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.