Array

Struct Array 

Source
pub struct Array<ArrayImpl, const NDIM: usize>(/* private fields */);
Expand description

The basic tuple type defining an array.

Implementations§

Source§

impl<ArrayImpl, const ADIM: usize> Array<ArrayImpl, ADIM>

Source

pub fn insert_empty_axis<const NDIM: usize>( self, axis_position: AxisPosition, ) -> Array<ArrayAppendAxis<ArrayImpl, ADIM, NDIM>, NDIM>
where NumberType<ADIM>: IsSmallerByOne<NDIM>,

Insert empty axis

Source§

impl<ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>

Source

pub fn with_container_type<TypeHint: ContainerTypeRepr + ArrayFromContainerType + RowMajorArrayFromContainerType>( self, ) -> Array<WithEvalType<ArrayImpl, TypeHint, NDIM>, NDIM>

Coerce the array to a specific item type and dimension.

Source§

impl<ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>

Source

pub fn into_flat(self) -> Array<ArrayFlatView<ArrayImpl, NDIM>, 1>

Return a flattened 1d view onto the array. The view is flattened in column-major order.

Source§

impl<ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>

Source

pub fn into_shared(self) -> ArraySharedRef<ArrayImpl, NDIM>

Create a non thread-safe runtime shared reference from the array

Use borrow and borrow_mut to access the underlying array.

The rational of this function is to obtain a cloneable shared reference structure to the original array with runtime borrow checking when compile-time checking is not sufficient.

This function is not thread-safe. For a thread-safe variant use Array::into_shared_atomic.

Source

pub fn into_shared_atomic(self) -> ArrayAtomicSharedRef<ArrayImpl, NDIM>

Create an atomic thread-safe runtime shared reference from the array Use borrow and borrow_mut to access the underlying array.

The rational of this function is to obtain a cloneable shared reference structure to the original array with runtime borrow checking when compile-time checking is not sufficient.

This function is thread-safe. For a slightly faster non thread-safe variant use Array::into_shared.

Source§

impl<ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>

Source

pub fn new(arr: ArrayImpl) -> Self

Instantiate a new array from an ArrayImpl structure.

Source

pub fn imp(&self) -> &ArrayImpl

Return a reference to the implementation.

Source

pub fn imp_mut(&mut self) -> &mut ArrayImpl

Return a mutable reference to the implementation.

Source

pub fn into_imp(self) -> ArrayImpl

Extract the inner implementation.

Source

pub fn r(&self) -> Array<ArrayRef<'_, ArrayImpl, NDIM>, NDIM>

Create an owned reference to the array.

Source

pub fn r_mut(&mut self) -> Array<ArrayRefMut<'_, ArrayImpl, NDIM>, NDIM>

Create an owned mutable reference to the array.

Source§

impl<ArrayImpl: Shape<NDIM>, const NDIM: usize> Array<ArrayImpl, NDIM>

Source

pub fn number_of_elements(&self) -> usize

Return the number of elements in the array.

Source§

impl<Item: Copy + Default, const NDIM: usize> Array<BaseArray<VectorContainer<Item>, NDIM>, NDIM>

Source

pub fn from_shape(shape: [usize; NDIM]) -> Self

Create a new heap allocated array from a given shape.

Source

pub fn from_shape_and_vec(shape: [usize; NDIM], data: Vec<Item>) -> Self

Create a new heap allocated array by providing a shape and a vector of data.

The number of elements in the vector must be compatible with the given shape. Otherwise, an assertion error is triggered.

Source§

impl<Item: Copy + Default, const NDIM: usize, const ALIGNMENT: usize> Array<BaseArray<AlignedVectorContainer<Item, ALIGNMENT>, NDIM>, NDIM>

Source

pub fn from_shape(shape: [usize; NDIM]) -> Self

Create a new heap allocated array from a given shape.

Source

pub fn from_shape_and_avec( shape: [usize; NDIM], data: AVec<Item, ConstAlign<ALIGNMENT>>, ) -> Self

Create a new heap allocated array by providing a shape and a vector of data.

The number of elements in the vector must be compatible with the given shape. Otherwise, an assertion error is triggered.

Source§

impl<Item: Copy + Default> Array<BaseArray<VectorContainer<Item>, 2>, 2>

Source

pub fn from_iter_aij<Iter: Iterator<Item = ([usize; 2], Item)>>( shape: [usize; 2], iter: Iter, ) -> DynArray<Item, 2>

Create a new dense matrix with shape shape filled with values from the iterator iter.

Source§

impl<Item: Copy + Default, const ALIGNMENT: usize> Array<BaseArray<AlignedVectorContainer<Item, ALIGNMENT>, 2>, 2>

Source

pub fn from_iter_aij<Iter: Iterator<Item = ([usize; 2], Item)>>( shape: [usize; 2], iter: Iter, ) -> AlignedDynArray<Item, 2, ALIGNMENT>

Create a new dense matrix with shape shape filled with values from the iterator iter.

Source§

impl<Item: Copy + Default, const NDIM: usize> Array<StridedBaseArray<VectorContainer<Item>, NDIM>, NDIM>

Source

pub fn from_shape_and_stride( shape: [usize; NDIM], stride: [usize; NDIM], ) -> Self

Create a new heap allocated array from a given shape and stride.

Source§

impl<Item: Copy + Default, const NDIM: usize> Array<StridedBaseArray<VectorContainer<Item>, NDIM>, NDIM>

Source

pub fn row_major(shape: [usize; NDIM]) -> Self

Create a new heap allocated row-major array.

Source§

impl<ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>
where ArrayImpl: Shape<NDIM>,

Source

pub fn shape(&self) -> [usize; NDIM]

Return the shape of an array.

§Traits:
Source§

impl<ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>
where ArrayImpl: Shape<NDIM>,

Source

pub fn len(&self) -> usize

Return the length of an array.

For more than one dimension the length is the number of elements.

§Traits:
Source

pub fn is_empty(&self) -> bool

Return true if the array is empty.

This is equivalent to at least one dimension being zero.

§Traits:
Source§

impl<ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>
where ArrayImpl: UnsafeRandomAccessByValue<NDIM>,

Source

pub unsafe fn get_value_unchecked( &self, multi_index: [usize; NDIM], ) -> ArrayImpl::Item

Get an element by value.

§Safety

multi_index must be in range.

§Traits
Source§

impl<ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>
where ArrayImpl: UnsafeRandomAccessByRef<NDIM>,

Source

pub unsafe fn get_unchecked( &self, multi_index: [usize; NDIM], ) -> &ArrayImpl::Item

Get an element by reference.

§Safety

multi_index must be in range.

§Traits
Source§

impl<ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>
where ArrayImpl: UnsafeRandomAccessMut<NDIM>,

Source

pub unsafe fn get_unchecked_mut( &mut self, multi_index: [usize; NDIM], ) -> &mut ArrayImpl::Item

Get an element by mutable reference.

§Safety

multi_index must be in range.

§Traits
Source§

impl<ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>
where ArrayImpl: RandomAccessByValue<NDIM>,

Source

pub fn get_value(&self, multi_index: [usize; NDIM]) -> Option<ArrayImpl::Item>

Get an element by value.

§Traits
Source§

impl<ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>
where ArrayImpl: RandomAccessByRef<NDIM>,

Source

pub fn get(&self, multi_index: [usize; NDIM]) -> Option<&ArrayImpl::Item>

Get an element by reference.

§Traits
Source§

impl<ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>
where ArrayImpl: RandomAccessMut<NDIM>,

Source

pub fn get_mut( &mut self, multi_index: [usize; NDIM], ) -> Option<&mut ArrayImpl::Item>

Get an element by mutable reference.

§Traits
Source§

impl<ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>
where ArrayImpl: RawAccess,

Source

pub fn data(&self) -> Option<&[ArrayImpl::Item]>

Return the raw data as slice.

§Traits
Source§

impl<ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>
where ArrayImpl: RawAccessMut,

Source

pub fn data_mut(&mut self) -> Option<&mut [ArrayImpl::Item]>

Return the raw data as slice.

§Traits
Source§

impl<ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>
where ArrayImpl: Stride<NDIM>,

Source

pub fn stride(&self) -> [usize; NDIM]

Return the stride.

§Traits
Source§

impl<ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>
where ArrayImpl: Stride<NDIM> + Shape<NDIM>,

Source

pub fn memory_layout(&self) -> MemoryLayout

Return the memory layout

The possible memory layouts are defined in MemoryLayout.

Source

pub fn is_contiguous(&self) -> bool

Return true of the memory layout is contiguous, otherwise false.

A memory layout is contiguous if it is either row or column major.

Source§

impl<ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>
where ArrayImpl: ResizeInPlace<NDIM>,

Source

pub fn resize_in_place(&mut self, shape: [usize; NDIM])

Resize the array to the new shape.

The content of the array will be lost upon resizing.

§Traits
Source§

impl<'a, Item, const NDIM: usize> Array<BaseArray<SliceContainer<'a, Item>, NDIM>, NDIM>
where Item: Copy + Default,

Source

pub fn from_shape(slice: &'a [Item], shape: [usize; NDIM]) -> Self

Create a new array from slice with a given shape.

Source§

impl<'a, Item, const NDIM: usize> Array<BaseArray<SliceContainerMut<'a, Item>, NDIM>, NDIM>
where Item: Copy + Default,

Source

pub fn from_shape(slice: &'a mut [Item], shape: [usize; NDIM]) -> Self

Create a new array from mutable slice with a given shape.

Source§

impl<'a, Item, const NDIM: usize> Array<StridedBaseArray<SliceContainer<'a, Item>, NDIM>, NDIM>
where Item: Copy + Default,

Source

pub fn from_shape_and_stride( slice: &'a [Item], shape: [usize; NDIM], stride: [usize; NDIM], ) -> Self

Create a new array from slice with a given shape and stride.

Source§

impl<'a, Item, const NDIM: usize> Array<StridedBaseArray<SliceContainerMut<'a, Item>, NDIM>, NDIM>
where Item: Copy + Default,

Source

pub fn from_shape_and_stride( slice: &'a mut [Item], shape: [usize; NDIM], stride: [usize; NDIM], ) -> Self

Create a new array from slice with a given shape and stride.

Source§

impl<Item, const NDIM: usize> Array<BaseArray<VectorContainer<Item>, NDIM>, NDIM>
where Item: Copy + Default,

Source

pub fn new_from<ArrayImpl>(arr: &Array<ArrayImpl, NDIM>) -> Self
where ArrayImpl: UnsafeRandom1DAccessByValue<Item = Item> + Shape<NDIM>,

Create a new array and fill with values from arr.

Source§

impl<Item, const NDIM: usize> Array<StridedBaseArray<VectorContainer<Item>, NDIM>, NDIM>
where Item: Copy + Default,

Source

pub fn new_from<ArrayImpl>( stride: [usize; NDIM], arr: &Array<ArrayImpl, NDIM>, ) -> Self
where ArrayImpl: UnsafeRandom1DAccessByValue<Item = Item> + Shape<NDIM>,

Create a new strided array with stride and fill with values from arr.

Source

pub fn row_major_from<ArrayImpl>(arr: &Array<ArrayImpl, NDIM>) -> Self
where ArrayImpl: UnsafeRandom1DAccessByValue<Item = Item> + Shape<NDIM>,

Create a new row-major array from existing array arr.

Source§

impl<ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>
where ArrayImpl: UnsafeRandom1DAccessByValue + Shape<NDIM>,

Source

pub fn iter_value(&self) -> ArrayDefaultIteratorByValue<'_, ArrayImpl, NDIM>

Iterate through the array by value.

The iterator always proceeds in column-major order.

§Traits
Source§

impl<ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>
where ArrayImpl: UnsafeRandom1DAccessByRef + Shape<NDIM>,

Source

pub fn iter_ref(&self) -> ArrayDefaultIteratorByRef<'_, ArrayImpl, NDIM>

Iterate through the array by reference.

The iterator always proceeds in column-major order.

§Traits
Source§

impl<ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>
where ArrayImpl: UnsafeRandom1DAccessMut + Shape<NDIM>,

Source

pub fn iter_mut(&mut self) -> ArrayDefaultIteratorMut<'_, ArrayImpl, NDIM>

Iterate through the array by mutable reference.

The iterator always proceeds in column-major order.

§Traits
Source§

impl<Item, ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>
where ArrayImpl: UnsafeRandomAccessByValue<NDIM, Item = Item> + Shape<NDIM>,

Source

pub fn diag_iter_value(&self) -> ArrayDiagIteratorByValue<'_, ArrayImpl, NDIM>

Iterate through the diagonal of the array by value.

§Traits
Source§

impl<Item, ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>
where ArrayImpl: UnsafeRandomAccessByRef<NDIM, Item = Item> + Shape<NDIM>,

Source

pub fn diag_iter_ref(&self) -> ArrayDiagIteratorByRef<'_, ArrayImpl, NDIM>

Iterate through the diagonal of the array by reference.

§Traits
Source§

impl<Item, ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>
where ArrayImpl: UnsafeRandomAccessMut<NDIM, Item = Item> + Shape<NDIM>,

Source

pub fn diag_iter_mut(&mut self) -> ArrayDiagIteratorMut<'_, ArrayImpl, NDIM>

Iterate through the diagonal of the array by mutable reference.

§Traits
Source§

impl<Item, ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>
where ArrayImpl: UnsafeRandom1DAccessMut<Item = Item> + Shape<NDIM>,

Source

pub fn fill_from<ArrayImplOther>(&mut self, other: &Array<ArrayImplOther, NDIM>)
where ArrayImplOther: UnsafeRandom1DAccessByValue<Item = Item> + Shape<NDIM>,

Fill from another array.

#Traits

Source§

impl<Item, ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>
where Const<NDIM>: ToUInt, <Const<NDIM> as ToUInt>::Output: Unsigned + NonZero, ArrayImpl: UnsafeRandom1DAccessByValue<Item = Item> + UnsafeRandomAccessByValue<NDIM, Item = Item> + Shape<NDIM>,

Source

pub fn multislice_iter<const SDIM: usize, const OUTDIM: usize>( &self, axes: [usize; SDIM], ) -> MultisliceIterator<'_, Item, ArrayImpl, NDIM, SDIM, OUTDIM>
where Const<SDIM>: ToUInt, Const<OUTDIM>: ToUInt, <Const<SDIM> as ToUInt>::Output: Unsigned + NonZero, <Const<OUTDIM> as ToUInt>::Output: Unsigned + NonZero, NumberType<SDIM>: IsSmallerThan<NDIM>, PInt<U<OUTDIM>>: Add<PInt<U<SDIM>>, Output = PInt<U<NDIM>>>, PInt<U<NDIM>>: Sub<PInt<U<SDIM>>>,

Create a new multislice iterator.

Given an array arr with dimensions [2, 3, 4, 5]. Calling self.multislice_iter with axes = [0, 2] returns an iterator over values of the type (indices, slice), where indices is a [2; usize] array taking all possible axis indices in axes 0 and 2, and slice is the output of arr.multislice([0, 2], [indices]).

Source§

impl<Item, ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>
where Const<NDIM>: ToUInt, <Const<NDIM> as ToUInt>::Output: Unsigned + NonZero, ArrayImpl: UnsafeRandom1DAccessMut<Item = Item> + UnsafeRandomAccessMut<NDIM, Item = Item> + Shape<NDIM>,

Source

pub fn multislice_iter_mut<const SDIM: usize, const OUTDIM: usize>( &mut self, axes: [usize; SDIM], ) -> MultisliceIteratorMut<'_, Item, ArrayImpl, NDIM, SDIM, OUTDIM>
where Const<SDIM>: ToUInt, Const<OUTDIM>: ToUInt, <Const<SDIM> as ToUInt>::Output: Unsigned + NonZero, <Const<OUTDIM> as ToUInt>::Output: Unsigned + NonZero, NumberType<SDIM>: IsSmallerThan<NDIM>, PInt<U<OUTDIM>>: Add<PInt<U<SDIM>>, Output = PInt<U<NDIM>>>, PInt<U<NDIM>>: Sub<PInt<U<SDIM>>>,

Create a new mutable multislice iterator.

Given an array arr with dimensions [2, 3, 4, 5]. Calling self.multislice_iter_mut with axes = [0, 2] returns an iterator over values of the type (indices, slice), where indices is a [2; usize] array taking all possible axis indices in axes 0 and 2, and slice is the output of arr.multislice([0, 2], [indices]).

Source§

impl<ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>
where ArrayImpl: UnsafeRandom1DAccessMut + Shape<NDIM>,

Source

pub fn fill_from_iter<Iter>(&mut self, iter: Iter)
where Iter: Iterator<Item = ArrayImpl::Item>,

Fill from an iterator.

Note that the array only fills as many values as the other iterator provides.

§Traits
Source§

impl<ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>
where ArrayImpl: ResizeInPlace<NDIM> + Shape<NDIM> + UnsafeRandom1DAccessMut,

Source

pub fn fill_from_resize<ArrayImplOther>( &mut self, other: &Array<ArrayImplOther, NDIM>, )
where ArrayImplOther: Shape<NDIM> + UnsafeRandom1DAccessByValue<Item = ArrayImpl::Item>,

Fill from another array and resize if necessary.

This method is especially useful together with empty_array.

#Traits

Source§

impl<ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>
where ArrayImpl: UnsafeRandom1DAccessMut + Shape<NDIM>,

Source

pub fn fill_with_value(&mut self, value: ArrayImpl::Item)

Fill array with a given value.

§Traits
Source§

impl<ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>
where ArrayImpl: UnsafeRandom1DAccessMut + Shape<NDIM>,

Source

pub fn set_zero(&mut self)

Set the elements of the array to zero.

Source§

impl<ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>
where ArrayImpl: UnsafeRandom1DAccessMut + UnsafeRandomAccessMut<NDIM> + Shape<NDIM>, ArrayImpl::Item: One,

Source

pub fn set_identity(&mut self)

Set all off-diagonal elements to zero and the diagonal to one.

Source§

impl<ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>
where ArrayImpl: UnsafeRandomAccessByValue<NDIM> + Shape<NDIM>, ArrayImpl::Item: Sum,

Source

pub fn trace(&self) -> ArrayImpl::Item

Compute the sum of the diagonal values of the array.

Note: The Item type must support the trait std::iter::Sum.

§Traits
Source§

impl<Item, ArrayImpl> Array<ArrayImpl, 1>
where ArrayImpl: UnsafeRandom1DAccessByValue<Item = Item> + Shape<1>, ArrayImpl::Item: Conj<Output = Item> + Mul<Output = ArrayImpl::Item> + Add<Output = Item>,

Source

pub fn inner<ArrayImplOther>( &self, other: &Array<ArrayImplOther, 1>, ) -> Option<Item>
where ArrayImplOther: UnsafeRandom1DAccessByValue<Item = Item> + Shape<1>,

Compute the inner product of two 1d arrays.

The elements of other are taken as conjugate.

Returns None if the arrays are empty.

Note: The Item type must support the traits Conj, std::iter::Sum and std::ops::Mul.

§Traits
Source§

impl<Item, ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>
where ArrayImpl: UnsafeRandom1DAccessByValue<Item = Item> + Shape<NDIM>, Item: Abs, <Item as Abs>::Output: Max<Output = <Item as Abs>::Output>,

Source

pub fn max_abs(&self) -> Option<<Item as Abs>::Output>

Compute the maximum absolute value over all elements.

Note: The item type must support Abs and the output of Abs must support Max.

The function returns None if the array is empty.

§Traits
Source§

impl<Item, ArrayImpl> Array<ArrayImpl, 1>
where ArrayImpl: UnsafeRandom1DAccessByValue<Item = Item> + Shape<1>, Item: Abs, <Item as Abs>::Output: Add<Output = <Item as Abs>::Output>,

Source

pub fn norm_1(&self) -> Option<<Item as Abs>::Output>

Compute the 1-norm of a 1d array.

The function returns None if the array is empty.

Note: The item type must support Abs and the output of Abs must support std::ops::Add.

§Traits
Source§

impl<Item, ArrayImpl> Array<ArrayImpl, 1>
where ArrayImpl: UnsafeRandom1DAccessByValue<Item = Item> + Shape<1>, Item: AbsSquare, <Item as AbsSquare>::Output: Sqrt<Output = <Item as AbsSquare>::Output> + Add<Output = <Item as AbsSquare>::Output>,

Source

pub fn norm_2(&self) -> Option<<Item as AbsSquare>::Output>

Compute the 2-norm of a 1d array.

Note: The item type must support AbsSquare. The output of AbsSquare must support std::ops::Add and Sqrt.

§Traits
Source§

impl<Item, ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>
where ArrayImpl: UnsafeRandom1DAccessByValue<Item = Item> + Shape<NDIM>, Item: AbsSquare, <Item as AbsSquare>::Output: Sqrt<Output = <Item as AbsSquare>::Output> + Add<Output = <Item as AbsSquare>::Output> + Copy + Default,

Source

pub fn norm_fro(&self) -> Option<<Item as AbsSquare>::Output>

Compute the Frobenius-Norm of a nd array.

Note: The item type must support AbsSquare. The output of AbsSquare must support std::ops::Add, Sqrt, Copy, and Default.

§Traits
Source§

impl<ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>
where ArrayImpl: UnsafeRandom1DAccessByValue + Shape<NDIM>,

Source

pub fn into_type<T>( self, ) -> Array<ArrayUnaryOperator<ArrayImpl::Item, T, ArrayImpl, fn(ArrayImpl::Item) -> T, NDIM>, NDIM>
where ArrayImpl::Item: Into<T>,

Convert an array into the new item type T.

Note: It is required that ArrayImpl::Item: Into<T>.

§Traits
Source§

impl<ArrayImpl> Array<ArrayImpl, 2>
where ArrayImpl: Shape<2> + UnsafeRandomAccessByValue<2>,

Source

pub fn col_iter(&self) -> ColIterator<'_, ArrayImpl, 2>

Return a column iterator for a 2d array.

§Traits
Source§

impl<ArrayImpl> Array<ArrayImpl, 2>
where ArrayImpl: Shape<2> + UnsafeRandomAccessMut<2>,

Source

pub fn col_iter_mut(&mut self) -> ColIteratorMut<'_, ArrayImpl, 2>

Return a mutable column iterator for a 2d array.

§Traits
Source§

impl<ArrayImpl> Array<ArrayImpl, 2>
where ArrayImpl: Shape<2> + UnsafeRandomAccessByValue<2>,

Source

pub fn row_iter(&self) -> RowIterator<'_, ArrayImpl, 2>

Return a row iterator for a 2d array.

§Traits
Source§

impl<ArrayImpl> Array<ArrayImpl, 2>
where ArrayImpl: Shape<2> + UnsafeRandomAccessByValue<2>,

Source

pub fn row_iter_mut(&mut self) -> RowIteratorMut<'_, ArrayImpl, 2>

Return a mutable row iterator for a 2d array.

§Traits
Source§

impl<ArrayImpl> Array<ArrayImpl, 2>
where ArrayImpl: UnsafeRandom1DAccessByValue + Shape<2>,

Source

pub fn iter_aij_value( &self, ) -> impl Iterator<Item = ([usize; 2], ArrayImpl::Item)> + '_

Return an iterator of the form (i, j, data).

Here, i is the row, j is the column, and data is the associated element returned by value.

§Traits
Source§

impl<ArrayImpl> Array<ArrayImpl, 2>
where ArrayImpl: UnsafeRandom1DAccessByRef + Shape<2>,

Source

pub fn iter_aij_ref( &self, ) -> impl Iterator<Item = ([usize; 2], &ArrayImpl::Item)> + '_

Return an iterator of the form (i, j, &data).

Here, i is the row, j is the column, and &data is the reference to the associated element.

§Traits
Source§

impl<ArrayImpl> Array<ArrayImpl, 2>
where ArrayImpl: UnsafeRandom1DAccessMut + Shape<2>,

Source

pub fn iter_aij_mut( &mut self, ) -> impl Iterator<Item = ([usize; 2], &mut ArrayImpl::Item)> + '_

Return an iterator of the form (i, j, &mut data).

Here, i is the row, j is the column, and &data is the mutable reference to the associated element.

§Traits
Source§

impl<ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>

Source

pub fn cast<Target>(self) -> Array<ArrayCast<Target, ArrayImpl, NDIM>, NDIM>

Cast array to type T.

The cast is done through num::cast::cast and source and target types need to support casting through that function.

Source§

impl<ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>

Source

pub fn coerce_dim<const CDIM: usize>( self, ) -> RlstResult<Array<CoerceArray<ArrayImpl, NDIM, CDIM>, CDIM>>

Coerce the array to a specific dimension.

This is useful to coerce from a generic dimension parameter to a specific number of dimensions.

Source§

impl<ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>
where ArrayImpl: Shape<NDIM>,

Source

pub fn permute_axes( self, permutation: [usize; NDIM], ) -> Array<ArrayTranspose<ArrayImpl, NDIM>, NDIM>

Permute axes of an array.

The permutation gives the new ordering of the axes.

Source

pub fn transpose(self) -> Array<ArrayTranspose<ArrayImpl, NDIM>, NDIM>

Transpose an array.

The transpose of an n-dimensional array reverses the order of the axes.

Source§

impl<Item, ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>
where Item: RandScalar + RlstScalar, ArrayImpl: UnsafeRandom1DAccessMut<Item = Item> + Shape<NDIM>, StandardNormal: Distribution<Item::Real>, StandardUniform: Distribution<Item::Real>,

Source

pub fn fill_from_standard_normal<R: Rng>(&mut self, rng: &mut R)

Fill an array with normally distributed random numbers.

§Traits
Source

pub fn fill_from_equally_distributed<R: Rng>(&mut self, rng: &mut R)

Fill an array with equally distributed random numbers.

§Traits
Source

pub fn fill_from_seed_equally_distributed(&mut self, seed: usize)

Fill an array with equally distributed random numbers using a given seed.

§Traits
Source

pub fn fill_from_seed_normally_distributed(&mut self, seed: usize)

Fill an array with normally distributed random numbers using a given seed.

§Traits
Source§

impl<ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>

Source

pub fn reverse_axis( self, axis: usize, ) -> Array<ReverseAxis<ArrayImpl, NDIM>, NDIM>

Reverse a single axis of the array.

Source§

impl<ArrayImpl, const ADIM: usize> Array<ArrayImpl, ADIM>
where ArrayImpl: Shape<ADIM>,

Source

pub fn slice<const OUTDIM: usize>( self, axis: usize, index: usize, ) -> Array<ArraySlice<ArrayImpl, ADIM, OUTDIM>, OUTDIM>
where NumberType<ADIM>: IsGreaterByOne<OUTDIM>, NumberType<OUTDIM>: IsGreaterZero,

Create a slice from a given array.

Consider an array arr with shape [a0, a1, a2, a3, ...]. The function call arr.slice(2, 3) returns a one dimension smaller array indexed by [a0, a1, 3, a3, ...]. Hence, the dimension 2 has been fixed to always have the value 3.

§Examples

If arr is a matrix then the first column of the matrix is obtained from arr.slice(1, 0), while the third row of the matrix is obtained from arr.slice(0, 2).

Source

pub fn multislice<const SDIM: usize, const OUTDIM: usize>( self, axes: [usize; SDIM], indices: [usize; SDIM], ) -> Array<Multislice<ArrayImpl, ADIM, SDIM, OUTDIM>, OUTDIM>
where NumberType<SDIM>: IsSmallerThan<ADIM>, NumberDifference<ADIM, SDIM>: SubtractEqual<OUTDIM>,

Create a multislice from a given array.

A multislice works like Array::slice but allows the slicing along multiple dimensions at the same time. The axes array determines which axes are fixed and the indices array determines the value in each fixed axis. The dimension SDIM is the number of axes along which we slice. The parameter OUTDIM is the number of dimensions after slicing.

Source§

impl<ArrayImpl> Array<ArrayImpl, 2>
where ArrayImpl: Shape<2>,

Source

pub fn row(self, row_index: usize) -> Array<ArraySlice<ArrayImpl, 2, 1>, 1>

Return the row with index row_index from a two-dimensional array.

Source

pub fn col(self, col_index: usize) -> Array<ArraySlice<ArrayImpl, 2, 1>, 1>

Return the column with index col_index from a two-dimensional array.

Source§

impl<ArrayImpl: Shape<NDIM>, const NDIM: usize> Array<ArrayImpl, NDIM>

Source

pub fn into_subview( self, offset: [usize; NDIM], shape: [usize; NDIM], ) -> Array<ArraySubView<ArrayImpl, NDIM>, NDIM>

Move the array into a subview specified by an offset and shape of the subview.

The offset is the starting index of the subview and the shape is the number of indices in each dimension of the subview.

Source§

impl<ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>

Source

pub fn unary_op<OpItem, OpTarget, Op: Fn(OpItem) -> OpTarget>( self, op: Op, ) -> Array<ArrayUnaryOperator<OpItem, OpTarget, ArrayImpl, Op, NDIM>, NDIM>

Create a new array by applying the unitary operator op to each element of self.

Source§

impl<Item: Default + Copy + Mul<Output = Item>, ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>
where ArrayImpl: BaseItem<Item = Item>,

Source

pub fn scalar_mul( self, scalar: Item, ) -> Array<ArrayScalarMult<Item, ArrayImpl, NDIM>, NDIM>

Multiple the array with a given scalar.

Note: The Item type must support std::ops::Mul.

Source§

impl<Item: Conj, ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>
where ArrayImpl: BaseItem<Item = Item>,

Source

pub fn conj( self, ) -> Array<ArrayUnaryOperator<Item, <Item as Conj>::Output, ArrayImpl, fn(Item) -> <Item as Conj>::Output, NDIM>, NDIM>

Componentwise apply conj to the array.

Source§

impl<Item: Abs, ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>
where ArrayImpl: BaseItem<Item = Item>,

Source

pub fn abs( self, ) -> Array<ArrayUnaryOperator<Item, <Item as Abs>::Output, ArrayImpl, fn(Item) -> <Item as Abs>::Output, NDIM>, NDIM>

Componentwise apply abs to the array.

Source§

impl<Item: Square, ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>
where ArrayImpl: BaseItem<Item = Item>,

Source

pub fn square( self, ) -> Array<ArrayUnaryOperator<Item, <Item as Square>::Output, ArrayImpl, fn(Item) -> <Item as Square>::Output, NDIM>, NDIM>

Componentwise apply square to the array.

Source§

impl<Item: AbsSquare, ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>
where ArrayImpl: BaseItem<Item = Item>,

Source

pub fn abs_square( self, ) -> Array<ArrayUnaryOperator<Item, <Item as AbsSquare>::Output, ArrayImpl, fn(Item) -> <Item as AbsSquare>::Output, NDIM>, NDIM>

Componentwise apply abs_square to the array.

Source§

impl<Item: Sqrt, ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>
where ArrayImpl: BaseItem<Item = Item>,

Source

pub fn sqrt( self, ) -> Array<ArrayUnaryOperator<Item, <Item as Sqrt>::Output, ArrayImpl, fn(Item) -> <Item as Sqrt>::Output, NDIM>, NDIM>

Componentwise apply sqrt to the array.

Source§

impl<Item: Exp, ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>
where ArrayImpl: BaseItem<Item = Item>,

Source

pub fn exp( self, ) -> Array<ArrayUnaryOperator<Item, <Item as Exp>::Output, ArrayImpl, fn(Item) -> <Item as Exp>::Output, NDIM>, NDIM>

Componentwise apply exp to the array.

Source§

impl<Item: Ln, ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>
where ArrayImpl: BaseItem<Item = Item>,

Source

pub fn ln( self, ) -> Array<ArrayUnaryOperator<Item, <Item as Ln>::Output, ArrayImpl, fn(Item) -> <Item as Ln>::Output, NDIM>, NDIM>

Componentwise apply ln to the array.

Source§

impl<Item: Recip, ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>
where ArrayImpl: BaseItem<Item = Item>,

Source

pub fn recip( self, ) -> Array<ArrayUnaryOperator<Item, <Item as Recip>::Output, ArrayImpl, fn(Item) -> <Item as Recip>::Output, NDIM>, NDIM>

Componentwise apply recip to the array.

Source§

impl<Item: Sin, ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>
where ArrayImpl: BaseItem<Item = Item>,

Source

pub fn sin( self, ) -> Array<ArrayUnaryOperator<Item, <Item as Sin>::Output, ArrayImpl, fn(Item) -> <Item as Sin>::Output, NDIM>, NDIM>

Componentwise apply sin to the array.

Source§

impl<Item: Cos, ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>
where ArrayImpl: BaseItem<Item = Item>,

Source

pub fn cos( self, ) -> Array<ArrayUnaryOperator<Item, <Item as Cos>::Output, ArrayImpl, fn(Item) -> <Item as Cos>::Output, NDIM>, NDIM>

Componentwise apply cos to the array.

Source§

impl<Item: Tan, ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>
where ArrayImpl: BaseItem<Item = Item>,

Source

pub fn tan( self, ) -> Array<ArrayUnaryOperator<Item, <Item as Tan>::Output, ArrayImpl, fn(Item) -> <Item as Tan>::Output, NDIM>, NDIM>

Componentwise apply tan to the array.

Source§

impl<Item: Asin, ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>
where ArrayImpl: BaseItem<Item = Item>,

Source

pub fn asin( self, ) -> Array<ArrayUnaryOperator<Item, <Item as Asin>::Output, ArrayImpl, fn(Item) -> <Item as Asin>::Output, NDIM>, NDIM>

Componentwise apply asin to the array.

Source§

impl<Item: Acos, ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>
where ArrayImpl: BaseItem<Item = Item>,

Source

pub fn acos( self, ) -> Array<ArrayUnaryOperator<Item, <Item as Acos>::Output, ArrayImpl, fn(Item) -> <Item as Acos>::Output, NDIM>, NDIM>

Componentwise apply acos to the array.

Source§

impl<Item: Atan, ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>
where ArrayImpl: BaseItem<Item = Item>,

Source

pub fn atan( self, ) -> Array<ArrayUnaryOperator<Item, <Item as Atan>::Output, ArrayImpl, fn(Item) -> <Item as Atan>::Output, NDIM>, NDIM>

Componentwise apply atan to the array.

Source§

impl<Item: Sinh, ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>
where ArrayImpl: BaseItem<Item = Item>,

Source

pub fn sinh( self, ) -> Array<ArrayUnaryOperator<Item, <Item as Sinh>::Output, ArrayImpl, fn(Item) -> <Item as Sinh>::Output, NDIM>, NDIM>

Componentwise apply sinh to the array.

Source§

impl<Item: Cosh, ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>
where ArrayImpl: BaseItem<Item = Item>,

Source

pub fn cosh( self, ) -> Array<ArrayUnaryOperator<Item, <Item as Cosh>::Output, ArrayImpl, fn(Item) -> <Item as Cosh>::Output, NDIM>, NDIM>

Componentwise apply cosh to the array.

Source§

impl<Item: Tanh, ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>
where ArrayImpl: BaseItem<Item = Item>,

Source

pub fn tanh( self, ) -> Array<ArrayUnaryOperator<Item, <Item as Tanh>::Output, ArrayImpl, fn(Item) -> <Item as Tanh>::Output, NDIM>, NDIM>

Componentwise apply tanh to the array.

Source§

impl<Item: Asinh, ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>
where ArrayImpl: BaseItem<Item = Item>,

Source

pub fn asinh( self, ) -> Array<ArrayUnaryOperator<Item, <Item as Asinh>::Output, ArrayImpl, fn(Item) -> <Item as Asinh>::Output, NDIM>, NDIM>

Componentwise apply asinh to the array.

Source§

impl<Item: Acosh, ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>
where ArrayImpl: BaseItem<Item = Item>,

Source

pub fn acosh( self, ) -> Array<ArrayUnaryOperator<Item, <Item as Acosh>::Output, ArrayImpl, fn(Item) -> <Item as Acosh>::Output, NDIM>, NDIM>

Componentwise apply acosh to the array.

Source§

impl<Item: Atanh, ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>
where ArrayImpl: BaseItem<Item = Item>,

Source

pub fn atanh( self, ) -> Array<ArrayUnaryOperator<Item, <Item as Atanh>::Output, ArrayImpl, fn(Item) -> <Item as Atanh>::Output, NDIM>, NDIM>

Componentwise apply atanh to the array.

Source§

impl<Item, ArrayImpl> Array<ArrayImpl, 2>
where ArrayImpl: RawAccess<Item = Item> + Stride<2> + Shape<2>, Item: Gemm + Copy + Default + One + Zero,

Source

pub fn dot<ArrayImplOther, const NDIM: usize>( &self, other: &Array<ArrayImplOther, NDIM>, ) -> DynArray<Item, NDIM>
where ArrayImplOther: RawAccess<Item = Item> + Shape<NDIM> + Stride<NDIM>,

Compute the matrix-matrix product of self with other.

Source§

impl<Item, ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>
where ArrayImpl: UnsafeRandomAccessMut<NDIM, Item = Item>, Item: Copy,

Source

pub unsafe fn swap_unsafe(&mut self, pos1: [usize; NDIM], pos2: [usize; NDIM])

Swap the elements at the positions pos1 and pos2

§Safety

pos1 and pos2 must not be out of bounds.

Source§

impl<Item, ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>
where ArrayImpl: UnsafeRandomAccessMut<NDIM, Item = Item> + Shape<NDIM>, Item: Copy,

Source

pub fn swap( &mut self, pos1: [usize; NDIM], pos2: [usize; NDIM], ) -> RlstResult<()>

Swap the elements at the positions pos1 and pos2.

Returns an error if either pos1 or pos2 is out of bounds.

Source§

impl<Item, const NDIM: usize> Array<BaseArray<ArrayContainer<Item, 1>, NDIM>, NDIM>
where Item: Copy + Default,

Source

pub fn one_element_array() -> Self

Create an empty 1-element array of the given dimension.

Trait Implementations§

Source§

impl<ArrayImpl1, ArrayImpl2, const NDIM: usize> Add<Array<ArrayImpl2, NDIM>> for Array<ArrayImpl1, NDIM>
where ArrayImpl1: Shape<NDIM>, ArrayImpl2: Shape<NDIM>,

Source§

type Output = Array<ArrayAddition<ArrayImpl1, ArrayImpl2, NDIM>, NDIM>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Array<ArrayImpl2, NDIM>) -> Self::Output

Performs the + operation. Read more
Source§

impl<Item, ArrayImpl1, ArrayImpl2, const NDIM: usize> AddAssign<Array<ArrayImpl2, NDIM>> for Array<ArrayImpl1, NDIM>
where ArrayImpl1: Shape<NDIM> + UnsafeRandom1DAccessMut<Item = Item>, ArrayImpl2: Shape<NDIM> + UnsafeRandom1DAccessByValue<Item = Item>, Item: AddAssign,

Source§

fn add_assign(&mut self, rhs: Array<ArrayImpl2, NDIM>)

Performs the += operation. Read more
Source§

impl<Item, ArrayImplX, ArrayImplY, ArrayImpl> AsMatrixApply<Array<ArrayImplX, 1>, Array<ArrayImplY, 1>> for Array<ArrayImpl, 2>
where Item: Gemm + Copy, ArrayImplX: RawAccess<Item = Item> + Stride<1> + Shape<1>, ArrayImplY: RawAccessMut<Item = Item> + Stride<1> + Shape<1>, ArrayImpl: RawAccess<Item = Item> + Stride<2> + Shape<2>,

Source§

fn apply( &self, alpha: Self::Item, x: &Array<ArrayImplX, 1>, beta: Self::Item, y: &mut Array<ArrayImplY, 1>, )

Compute the matvec y -> alpha * self * x + beta * y with self a matrix.
Source§

impl<Item, ArrayImplX, ArrayImplY> AsMatrixApply<Array<ArrayImplX, 1>, Array<ArrayImplY, 1>> for CsrMatrix<Item>
where Item: Default + Mul<Output = Item> + AddAssign<Item> + Add<Output = Item> + Copy + One, ArrayImplX: UnsafeRandomAccessByValue<1, Item = Item> + Shape<1>, ArrayImplY: UnsafeRandom1DAccessMut<Item = Item> + Shape<1>,

Source§

fn apply( &self, alpha: Self::Item, x: &Array<ArrayImplX, 1>, beta: Self::Item, y: &mut Array<ArrayImplY, 1>, )

Compute the matvec y -> alpha * self * x + beta * y with self a matrix.
Source§

impl<Item, ArrayImplX, ArrayImplY, ArrayImpl> AsMatrixApply<Array<ArrayImplX, 2>, Array<ArrayImplY, 2>> for Array<ArrayImpl, 2>
where Item: Gemm + Copy, ArrayImplX: RawAccess<Item = Item> + Stride<2> + Shape<2>, ArrayImplY: RawAccessMut<Item = Item> + Stride<2> + Shape<2>, ArrayImpl: RawAccess<Item = Item> + Stride<2> + Shape<2>,

Source§

fn apply( &self, alpha: Self::Item, x: &Array<ArrayImplX, 2>, beta: Self::Item, y: &mut Array<ArrayImplY, 2>, )

Compute the matvec y -> alpha * self * x + beta * y with self a matrix.
Source§

impl<Item, ArrayImplX, ArrayImplY> AsMatrixApply<Array<ArrayImplX, 2>, Array<ArrayImplY, 2>> for CsrMatrix<Item>
where Item: Copy, for<'b> Self: BaseItem<Item = Item> + AsMatrixApply<Array<ArraySlice<ArrayRef<'b, ArrayImplX, 2>, 2, 1>, 1>, Array<ArraySlice<ArrayRefMut<'b, ArrayImplY, 2>, 2, 1>, 1>>, ArrayImplX: UnsafeRandomAccessByValue<2, Item = Item> + Shape<2>, ArrayImplY: UnsafeRandomAccessMut<2, Item = Item> + Shape<2>,

Source§

fn apply( &self, alpha: Self::Item, x: &Array<ArrayImplX, 2>, beta: Self::Item, y: &mut Array<ArrayImplY, 2>, )

Compute the matvec y -> alpha * self * x + beta * y with self a matrix.
Source§

impl<ArrayImpl, const NDIM: usize> BaseItem for Array<ArrayImpl, NDIM>
where ArrayImpl: BaseItem,

Source§

type Item = <ArrayImpl as BaseItem>::Item

Item type.
Source§

impl<Item, ArrayImpl> Cholesky for Array<ArrayImpl, 2>
where ArrayImpl: UnsafeRandom1DAccessByValue<Item = Item> + Shape<2>, Item: Lapack,

Source§

type Item = Item

Item type of the array.
Source§

fn cholesky(&self, uplo: UpLo) -> RlstResult<DynArray<Self::Item, 2>>

Compute the Cholesky decomposition of a positive definite matrix. Read more
Source§

impl<Item, ArrayImpl, RhsArrayImpl, const NDIM: usize> CholeskySolve<Array<RhsArrayImpl, NDIM>> for Array<ArrayImpl, 2>
where ArrayImpl: UnsafeRandom1DAccessByValue<Item = Item> + Shape<2>, RhsArrayImpl: UnsafeRandom1DAccessByValue<Item = Item> + Shape<NDIM>, Item: Lapack,

Source§

type Output = Array<BaseArray<VectorContainer<Item>, NDIM>, NDIM>

The output type of the Cholesky solver.
Source§

fn cholesky_solve( &self, uplo: UpLo, rhs: &Array<RhsArrayImpl, NDIM>, ) -> RlstResult<Self::Output>

Solve a positive definite system of linear equations using Cholesky factorization. Read more
Source§

impl<ArrayImpl: Shape<NDIM>, const NDIM: usize> Debug for Array<ArrayImpl, NDIM>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<ArrayImpl1, ArrayImpl2, const NDIM: usize> Div<Array<ArrayImpl2, NDIM>> for Array<ArrayImpl1, NDIM>
where ArrayImpl1: Shape<NDIM>, ArrayImpl2: Shape<NDIM>,

Source§

type Output = Array<CmpWiseDivision<ArrayImpl1, ArrayImpl2, NDIM>, NDIM>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Array<ArrayImpl2, NDIM>) -> Self::Output

Performs the / operation. Read more
Source§

impl<Item, ArrayImpl, const NDIM: usize> Div<Item> for Array<ArrayImpl, NDIM>
where ArrayImpl: Shape<NDIM> + BaseItem<Item = Item>, Item: Recip<Output = Item> + Div<Output = Item>,

Source§

type Output = Array<ArrayScalarMult<Item, ArrayImpl, NDIM>, NDIM>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Item) -> Self::Output

Performs the / operation. Read more
Source§

impl<Item, ArrayImpl1, ArrayImpl2, const NDIM: usize> DivAssign<Array<ArrayImpl2, NDIM>> for Array<ArrayImpl1, NDIM>
where ArrayImpl1: Shape<NDIM> + UnsafeRandom1DAccessMut<Item = Item>, ArrayImpl2: Shape<NDIM> + UnsafeRandom1DAccessByValue<Item = Item>, Item: DivAssign,

Source§

fn div_assign(&mut self, rhs: Array<ArrayImpl2, NDIM>)

Performs the /= operation. Read more
Source§

impl<Item, ArrayImpl, const NDIM: usize> DivAssign<Item> for Array<ArrayImpl, NDIM>
where ArrayImpl: Shape<NDIM> + UnsafeRandom1DAccessMut<Item = Item>, Item: DivAssign + Copy,

Source§

fn div_assign(&mut self, rhs: Item)

Performs the /= operation. Read more
Source§

impl<Item, ArrayImpl> EigenvalueDecomposition for Array<ArrayImpl, 2>
where ArrayImpl: UnsafeRandom1DAccessByValue<Item = Item> + Shape<2>, Item: Lapack,

Source§

type Item = Item

The item type of the matrix.
Source§

fn eigenvalues( &self, ) -> RlstResult<DynArray<<Self::Item as RlstScalar>::Complex, 1>>

Return the eigenvalues of the matrix.
Source§

fn schur( &self, ) -> RlstResult<(DynArray<Self::Item, 2>, DynArray<Self::Item, 2>)>

Compute the Schur decomposition of the matrix. Returns a tuple containing: Read more
Source§

fn eig( &self, mode: EigMode, ) -> RlstResult<(DynArray<<Self::Item as RlstScalar>::Complex, 1>, Option<DynArray<<Self::Item as RlstScalar>::Complex, 2>>, Option<DynArray<<Self::Item as RlstScalar>::Complex, 2>>)>

Compute the eigenvalues and eigenvectors of the matrix. Read more
Source§

impl<Item, ArrayImpl, const NDIM: usize> EvaluateArray<Item, NDIM> for Array<ArrayImpl, NDIM>
where Item: Copy + Default, ArrayImpl: UnsafeRandom1DAccessByValue<Item = Item> + Shape<NDIM> + ContainerType,

Source§

type OutputImpl = <<ArrayImpl as ContainerType>::Type as ArrayFromContainerType>::OutputImpl<Item, NDIM>

The output implementation type of the evaluated object.
Source§

fn eval(&self) -> Array<Self::OutputImpl, NDIM>

Evaluate the object.
Source§

impl<Item, ArrayImpl, const NDIM: usize> EvaluateRowMajorArray<Item, NDIM> for Array<ArrayImpl, NDIM>
where Item: Copy + Default, ArrayImpl: UnsafeRandom1DAccessByValue<Item = Item> + Shape<NDIM> + ContainerType,

Source§

type OutputImpl = <<ArrayImpl as ContainerType>::Type as RowMajorArrayFromContainerType>::OutputImpl<Item, NDIM>

The output implementation type of the evaluated array.
Source§

fn eval_row_major(&self) -> Array<Self::OutputImpl, NDIM>

Evaluate the array into a new row-major array.
Source§

impl<'a, ArrayImpl: BaseItem + Shape<2>> From<&'a Array<ArrayImpl, 2>> for Operator<ArrayOperator<'a, ArrayImpl>>
where ArrayOperator<'a, ArrayImpl>: OperatorBase,

Source§

fn from(value: &'a Array<ArrayImpl, 2>) -> Self

Converts to this type from the input type.
Source§

impl<ArrayImpl, const NDIM: usize> Index<[usize; NDIM]> for Array<ArrayImpl, NDIM>
where ArrayImpl: RandomAccessByRef<NDIM>,

Source§

type Output = <ArrayImpl as BaseItem>::Item

The returned type after indexing.
Source§

fn index(&self, index: [usize; NDIM]) -> &Self::Output

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

impl<ArrayImpl, const NDIM: usize> IndexMut<[usize; NDIM]> for Array<ArrayImpl, NDIM>
where Array<ArrayImpl, NDIM>: Index<[usize; NDIM], Output = ArrayImpl::Item>, ArrayImpl: RandomAccessMut<NDIM>,

Source§

fn index_mut(&mut self, index: [usize; NDIM]) -> &mut ArrayImpl::Item

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

impl<Item, ArrayImpl> Inverse for Array<ArrayImpl, 2>
where ArrayImpl: UnsafeRandom1DAccessByValue<Item = Item> + Shape<2>, Item: Copy + Default + Getri + Getrf,

Source§

type Output = Array<BaseArray<VectorContainer<Item>, 2>, 2>

The item type of the inverse.
Source§

fn inverse(&self) -> RlstResult<DynArray<Item, 2>>

Compute the inverse of a matrix.
Source§

impl<ArrayImpl> Linspace<f32> for Array<ArrayImpl, 1>
where ArrayImpl: MutableArrayImpl<f32, 1>,

Source§

fn linspace(&mut self, a: f32, b: f32)

Fill an array with equidistant points with start a and last value b. Read more
Source§

impl<ArrayImpl> Linspace<f64> for Array<ArrayImpl, 1>
where ArrayImpl: MutableArrayImpl<f64, 1>,

Source§

fn linspace(&mut self, a: f64, b: f64)

Fill an array with equidistant points with start a and last value b. Read more
Source§

impl<Item, ArrayImpl> Lu for Array<ArrayImpl, 2>
where Item: Lapack, ArrayImpl: UnsafeRandom1DAccessByValue<Item = Item> + Shape<2>,

Source§

type Item = Item

Item type of the LU decomposition.
Source§

fn lu(&self) -> RlstResult<LuDecomposition<Item>>

Compute the LU decomposition of a matrix.
Source§

impl<ArrayImpl, const NDIM: usize> Mul<Array<ArrayImpl, NDIM>> for c32

Source§

type Output = Array<ArrayScalarMult<Complex<f32>, ArrayImpl, NDIM>, NDIM>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Array<ArrayImpl, NDIM>) -> Self::Output

Performs the * operation. Read more
Source§

impl<ArrayImpl, const NDIM: usize> Mul<Array<ArrayImpl, NDIM>> for c64

Source§

type Output = Array<ArrayScalarMult<Complex<f64>, ArrayImpl, NDIM>, NDIM>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Array<ArrayImpl, NDIM>) -> Self::Output

Performs the * operation. Read more
Source§

impl<ArrayImpl, const NDIM: usize> Mul<Array<ArrayImpl, NDIM>> for f32

Source§

type Output = Array<ArrayScalarMult<f32, ArrayImpl, NDIM>, NDIM>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Array<ArrayImpl, NDIM>) -> Self::Output

Performs the * operation. Read more
Source§

impl<ArrayImpl, const NDIM: usize> Mul<Array<ArrayImpl, NDIM>> for f64

Source§

type Output = Array<ArrayScalarMult<f64, ArrayImpl, NDIM>, NDIM>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Array<ArrayImpl, NDIM>) -> Self::Output

Performs the * operation. Read more
Source§

impl<ArrayImpl, const NDIM: usize> Mul<Array<ArrayImpl, NDIM>> for i16

Source§

type Output = Array<ArrayScalarMult<i16, ArrayImpl, NDIM>, NDIM>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Array<ArrayImpl, NDIM>) -> Self::Output

Performs the * operation. Read more
Source§

impl<ArrayImpl, const NDIM: usize> Mul<Array<ArrayImpl, NDIM>> for i32

Source§

type Output = Array<ArrayScalarMult<i32, ArrayImpl, NDIM>, NDIM>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Array<ArrayImpl, NDIM>) -> Self::Output

Performs the * operation. Read more
Source§

impl<ArrayImpl, const NDIM: usize> Mul<Array<ArrayImpl, NDIM>> for i64

Source§

type Output = Array<ArrayScalarMult<i64, ArrayImpl, NDIM>, NDIM>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Array<ArrayImpl, NDIM>) -> Self::Output

Performs the * operation. Read more
Source§

impl<ArrayImpl, const NDIM: usize> Mul<Array<ArrayImpl, NDIM>> for i8

Source§

type Output = Array<ArrayScalarMult<i8, ArrayImpl, NDIM>, NDIM>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Array<ArrayImpl, NDIM>) -> Self::Output

Performs the * operation. Read more
Source§

impl<ArrayImpl, const NDIM: usize> Mul<Array<ArrayImpl, NDIM>> for u16

Source§

type Output = Array<ArrayScalarMult<u16, ArrayImpl, NDIM>, NDIM>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Array<ArrayImpl, NDIM>) -> Self::Output

Performs the * operation. Read more
Source§

impl<ArrayImpl, const NDIM: usize> Mul<Array<ArrayImpl, NDIM>> for u32

Source§

type Output = Array<ArrayScalarMult<u32, ArrayImpl, NDIM>, NDIM>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Array<ArrayImpl, NDIM>) -> Self::Output

Performs the * operation. Read more
Source§

impl<ArrayImpl, const NDIM: usize> Mul<Array<ArrayImpl, NDIM>> for u64

Source§

type Output = Array<ArrayScalarMult<u64, ArrayImpl, NDIM>, NDIM>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Array<ArrayImpl, NDIM>) -> Self::Output

Performs the * operation. Read more
Source§

impl<ArrayImpl, const NDIM: usize> Mul<Array<ArrayImpl, NDIM>> for u8

Source§

type Output = Array<ArrayScalarMult<u8, ArrayImpl, NDIM>, NDIM>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Array<ArrayImpl, NDIM>) -> Self::Output

Performs the * operation. Read more
Source§

impl<ArrayImpl, const NDIM: usize> Mul<Array<ArrayImpl, NDIM>> for usize

Source§

type Output = Array<ArrayScalarMult<usize, ArrayImpl, NDIM>, NDIM>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Array<ArrayImpl, NDIM>) -> Self::Output

Performs the * operation. Read more
Source§

impl<ArrayImpl1, ArrayImpl2, const NDIM: usize> Mul<Array<ArrayImpl2, NDIM>> for Array<ArrayImpl1, NDIM>
where ArrayImpl1: Shape<NDIM>, ArrayImpl2: Shape<NDIM>,

Source§

type Output = Array<CmpWiseProduct<ArrayImpl1, ArrayImpl2, NDIM>, NDIM>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Array<ArrayImpl2, NDIM>) -> Self::Output

Performs the * operation. Read more
Source§

impl<ArrayImpl, const NDIM: usize> Mul<Complex<f32>> for Array<ArrayImpl, NDIM>
where ArrayImpl: Shape<NDIM> + BaseItem<Item = c32>,

Source§

type Output = Array<ArrayScalarMult<Complex<f32>, ArrayImpl, NDIM>, NDIM>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: c32) -> Self::Output

Performs the * operation. Read more
Source§

impl<ArrayImpl, const NDIM: usize> Mul<Complex<f64>> for Array<ArrayImpl, NDIM>
where ArrayImpl: Shape<NDIM> + BaseItem<Item = c64>,

Source§

type Output = Array<ArrayScalarMult<Complex<f64>, ArrayImpl, NDIM>, NDIM>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: c64) -> Self::Output

Performs the * operation. Read more
Source§

impl<ArrayImpl, const NDIM: usize> Mul<f32> for Array<ArrayImpl, NDIM>
where ArrayImpl: Shape<NDIM> + BaseItem<Item = f32>,

Source§

type Output = Array<ArrayScalarMult<f32, ArrayImpl, NDIM>, NDIM>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: f32) -> Self::Output

Performs the * operation. Read more
Source§

impl<ArrayImpl, const NDIM: usize> Mul<f64> for Array<ArrayImpl, NDIM>
where ArrayImpl: Shape<NDIM> + BaseItem<Item = f64>,

Source§

type Output = Array<ArrayScalarMult<f64, ArrayImpl, NDIM>, NDIM>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: f64) -> Self::Output

Performs the * operation. Read more
Source§

impl<ArrayImpl, const NDIM: usize> Mul<i16> for Array<ArrayImpl, NDIM>
where ArrayImpl: Shape<NDIM> + BaseItem<Item = i16>,

Source§

type Output = Array<ArrayScalarMult<i16, ArrayImpl, NDIM>, NDIM>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: i16) -> Self::Output

Performs the * operation. Read more
Source§

impl<ArrayImpl, const NDIM: usize> Mul<i32> for Array<ArrayImpl, NDIM>
where ArrayImpl: Shape<NDIM> + BaseItem<Item = i32>,

Source§

type Output = Array<ArrayScalarMult<i32, ArrayImpl, NDIM>, NDIM>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: i32) -> Self::Output

Performs the * operation. Read more
Source§

impl<ArrayImpl, const NDIM: usize> Mul<i64> for Array<ArrayImpl, NDIM>
where ArrayImpl: Shape<NDIM> + BaseItem<Item = i64>,

Source§

type Output = Array<ArrayScalarMult<i64, ArrayImpl, NDIM>, NDIM>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: i64) -> Self::Output

Performs the * operation. Read more
Source§

impl<ArrayImpl, const NDIM: usize> Mul<i8> for Array<ArrayImpl, NDIM>
where ArrayImpl: Shape<NDIM> + BaseItem<Item = i8>,

Source§

type Output = Array<ArrayScalarMult<i8, ArrayImpl, NDIM>, NDIM>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: i8) -> Self::Output

Performs the * operation. Read more
Source§

impl<ArrayImpl, const NDIM: usize> Mul<u16> for Array<ArrayImpl, NDIM>
where ArrayImpl: Shape<NDIM> + BaseItem<Item = u16>,

Source§

type Output = Array<ArrayScalarMult<u16, ArrayImpl, NDIM>, NDIM>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: u16) -> Self::Output

Performs the * operation. Read more
Source§

impl<ArrayImpl, const NDIM: usize> Mul<u32> for Array<ArrayImpl, NDIM>
where ArrayImpl: Shape<NDIM> + BaseItem<Item = u32>,

Source§

type Output = Array<ArrayScalarMult<u32, ArrayImpl, NDIM>, NDIM>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: u32) -> Self::Output

Performs the * operation. Read more
Source§

impl<ArrayImpl, const NDIM: usize> Mul<u64> for Array<ArrayImpl, NDIM>
where ArrayImpl: Shape<NDIM> + BaseItem<Item = u64>,

Source§

type Output = Array<ArrayScalarMult<u64, ArrayImpl, NDIM>, NDIM>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: u64) -> Self::Output

Performs the * operation. Read more
Source§

impl<ArrayImpl, const NDIM: usize> Mul<u8> for Array<ArrayImpl, NDIM>
where ArrayImpl: Shape<NDIM> + BaseItem<Item = u8>,

Source§

type Output = Array<ArrayScalarMult<u8, ArrayImpl, NDIM>, NDIM>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: u8) -> Self::Output

Performs the * operation. Read more
Source§

impl<ArrayImpl, const NDIM: usize> Mul<usize> for Array<ArrayImpl, NDIM>
where ArrayImpl: Shape<NDIM> + BaseItem<Item = usize>,

Source§

type Output = Array<ArrayScalarMult<usize, ArrayImpl, NDIM>, NDIM>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: usize) -> Self::Output

Performs the * operation. Read more
Source§

impl<Item, ArrayImpl1, ArrayImpl2, const NDIM: usize> MulAdd<Item, Array<ArrayImpl2, NDIM>> for Array<ArrayImpl1, NDIM>
where ArrayImpl1: BaseItem<Item = Item> + Shape<NDIM>, ArrayImpl2: BaseItem<Item = Item> + Shape<NDIM>, Item: MulAdd<Output = Item> + Copy,

Source§

fn mul_add( self, a: Item, b: Array<ArrayImpl2, NDIM>, ) -> Array<MulAddImpl<ArrayImpl1, ArrayImpl2, Item, NDIM>, NDIM>
where ArrayImpl1: BaseItem<Item = Item> + Shape<NDIM>, ArrayImpl2: BaseItem<Item = Item> + Shape<NDIM>, Item: MulAdd<Output = Item> + Copy,

Compentwie form self * a + b, where a is a scalar and b is another array. The implementation depdends on the MulAdd trait from the num crate for the componets of the arrays.

Source§

type Output = Array<MulAddImpl<ArrayImpl1, ArrayImpl2, Item, NDIM>, NDIM>

The resulting type after applying the fused multiply-add.
Source§

impl<Item, ArrayImpl1, ArrayImpl2, const NDIM: usize> MulAssign<Array<ArrayImpl2, NDIM>> for Array<ArrayImpl1, NDIM>
where ArrayImpl1: Shape<NDIM> + UnsafeRandom1DAccessMut<Item = Item>, ArrayImpl2: Shape<NDIM> + UnsafeRandom1DAccessByValue<Item = Item>, Item: MulAssign,

Source§

fn mul_assign(&mut self, rhs: Array<ArrayImpl2, NDIM>)

Performs the *= operation. Read more
Source§

impl<Item, ArrayImpl, const NDIM: usize> MulAssign<Item> for Array<ArrayImpl, NDIM>
where ArrayImpl: Shape<NDIM> + UnsafeRandom1DAccessMut<Item = Item>, Item: MulAssign + Copy,

Source§

fn mul_assign(&mut self, rhs: Item)

Performs the *= operation. Read more
Source§

impl<Item: Gemm, ArrayImpl: RawAccessMut<Item = Item> + Stride<1> + Shape<1>, ArrayImplFirst: Shape<1> + Stride<1> + RawAccess<Item = Item>, ArrayImplSecond: Shape<2> + Stride<2> + RawAccess<Item = Item>> MultInto<Array<ArrayImplFirst, 1>, Array<ArrayImplSecond, 2>> for Array<ArrayImpl, 1>

Source§

fn mult_into( self, transa: TransMode, transb: TransMode, alpha: Item, arr_a: Array<ArrayImplFirst, 1>, arr_b: Array<ArrayImplSecond, 2>, beta: Item, ) -> Self

Multiply into
Source§

fn simple_mult_into(self, arr_a: First, arr_b: Second) -> Self
where Self: Sized, Self::Item: One + Zero,

Multiply First * Second and sum into Self
Source§

impl<Item: Gemm, ArrayImpl: RawAccessMut<Item = Item> + Stride<1> + Shape<1>, ArrayImplFirst: RawAccess<Item = Item> + Stride<2> + Shape<2>, ArrayImplSecond: RawAccess<Item = Item> + Stride<1> + Shape<1>> MultInto<Array<ArrayImplFirst, 2>, Array<ArrayImplSecond, 1>> for Array<ArrayImpl, 1>

Source§

fn mult_into( self, transa: TransMode, transb: TransMode, alpha: Item, arr_a: Array<ArrayImplFirst, 2>, arr_b: Array<ArrayImplSecond, 1>, beta: Item, ) -> Self

Multiply into
Source§

fn simple_mult_into(self, arr_a: First, arr_b: Second) -> Self
where Self: Sized, Self::Item: One + Zero,

Multiply First * Second and sum into Self
Source§

impl<Item: Gemm, ArrayImpl: RawAccessMut<Item = Item> + Stride<2> + Shape<2>, ArrayImplFirst: RawAccess<Item = Item> + Stride<2> + Shape<2>, ArrayImplSecond: RawAccess<Item = Item> + Stride<2> + Shape<2>> MultInto<Array<ArrayImplFirst, 2>, Array<ArrayImplSecond, 2>> for Array<ArrayImpl, 2>

Source§

fn mult_into( self, transa: TransMode, transb: TransMode, alpha: Item, arr_a: Array<ArrayImplFirst, 2>, arr_b: Array<ArrayImplSecond, 2>, beta: Item, ) -> Self

Multiply into
Source§

fn simple_mult_into(self, arr_a: First, arr_b: Second) -> Self
where Self: Sized, Self::Item: One + Zero,

Multiply First * Second and sum into Self
Source§

impl<Item: Gemm, ArrayImpl: Shape<1> + Stride<1> + RawAccessMut<Item = Item> + ResizeInPlace<1>, ArrayImplFirst: Shape<1> + Stride<1> + RawAccess<Item = Item>, ArrayImplSecond: Shape<2> + Stride<2> + RawAccess<Item = Item>> MultIntoResize<Array<ArrayImplFirst, 1>, Array<ArrayImplSecond, 2>> for Array<ArrayImpl, 1>

Source§

fn mult_into_resize( self, transa: TransMode, transb: TransMode, alpha: Item, arr_a: Array<ArrayImplFirst, 1>, arr_b: Array<ArrayImplSecond, 2>, beta: Item, ) -> Self

Multiply into with resize
Source§

fn simple_mult_into_resize(self, arr_a: First, arr_b: Second) -> Self
where Self: Sized, Self::Item: One + Zero,

Multiply First * Second and sum into Self. Allow to resize Self if necessary
Source§

impl<Item: Gemm, ArrayImpl: Shape<1> + Stride<1> + RawAccessMut<Item = Item> + ResizeInPlace<1>, ArrayImplFirst: Shape<2> + Stride<2> + RawAccess<Item = Item>, ArrayImplSecond: Shape<1> + Stride<1> + RawAccess<Item = Item>> MultIntoResize<Array<ArrayImplFirst, 2>, Array<ArrayImplSecond, 1>> for Array<ArrayImpl, 1>

Source§

fn mult_into_resize( self, transa: TransMode, transb: TransMode, alpha: Item, arr_a: Array<ArrayImplFirst, 2>, arr_b: Array<ArrayImplSecond, 1>, beta: Item, ) -> Self

Multiply into with resize
Source§

fn simple_mult_into_resize(self, arr_a: First, arr_b: Second) -> Self
where Self: Sized, Self::Item: One + Zero,

Multiply First * Second and sum into Self. Allow to resize Self if necessary
Source§

impl<Item: Gemm, ArrayImpl: Shape<2> + Stride<2> + RawAccessMut<Item = Item> + ResizeInPlace<2>, ArrayImplFirst: Shape<2> + Stride<2> + RawAccess<Item = Item>, ArrayImplSecond: Shape<2> + Stride<2> + RawAccess<Item = Item>> MultIntoResize<Array<ArrayImplFirst, 2>, Array<ArrayImplSecond, 2>> for Array<ArrayImpl, 2>

Source§

fn mult_into_resize( self, transa: TransMode, transb: TransMode, alpha: Item, arr_a: Array<ArrayImplFirst, 2>, arr_b: Array<ArrayImplSecond, 2>, beta: Item, ) -> Self

Multiply into with resize
Source§

fn simple_mult_into_resize(self, arr_a: First, arr_b: Second) -> Self
where Self: Sized, Self::Item: One + Zero,

Multiply First * Second and sum into Self. Allow to resize Self if necessary
Source§

impl<Item, ArrayImpl, const NDIM: usize> Neg for Array<ArrayImpl, NDIM>
where ArrayImpl: BaseItem<Item = Item>, Item: Neg<Output = Item>,

Source§

type Output = Array<ArrayNeg<ArrayImpl, NDIM>, NDIM>

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
Source§

impl<ArrayImpl: RandomAccessByValue<2, Item = c32> + Shape<2>> PrettyPrint<Complex<f32>> for Array<ArrayImpl, 2>

Source§

fn pretty_print(&self)

Pretty printing
Source§

fn pretty_print_with_dimension(&self, rows: usize, cols: usize)

Pretty printing with dimension
Source§

fn pretty_print_advanced( &self, rows: usize, cols: usize, print_width: usize, mantissa: usize, exponent: usize, )

Pretty printing with advanced options
Source§

impl<ArrayImpl: RandomAccessByValue<2, Item = c64> + Shape<2>> PrettyPrint<Complex<f64>> for Array<ArrayImpl, 2>

Source§

fn pretty_print(&self)

Pretty printing
Source§

fn pretty_print_with_dimension(&self, rows: usize, cols: usize)

Pretty printing with dimension
Source§

fn pretty_print_advanced( &self, rows: usize, cols: usize, print_width: usize, mantissa: usize, exponent: usize, )

Pretty printing with advanced options
Source§

impl<ArrayImpl: RandomAccessByValue<2, Item = f32> + Shape<2>> PrettyPrint<f32> for Array<ArrayImpl, 2>

Source§

fn pretty_print(&self)

Pretty printing
Source§

fn pretty_print_with_dimension(&self, rows: usize, cols: usize)

Pretty printing with dimension
Source§

fn pretty_print_advanced( &self, rows: usize, cols: usize, print_width: usize, mantissa: usize, exponent: usize, )

Pretty printing with advanced options
Source§

impl<ArrayImpl: RandomAccessByValue<2, Item = f64> + Shape<2>> PrettyPrint<f64> for Array<ArrayImpl, 2>

Source§

fn pretty_print(&self)

Pretty printing
Source§

fn pretty_print_with_dimension(&self, rows: usize, cols: usize)

Pretty printing with dimension
Source§

fn pretty_print_advanced( &self, rows: usize, cols: usize, print_width: usize, mantissa: usize, exponent: usize, )

Pretty printing with advanced options
Source§

impl<Item, ArrayImpl> Qr for Array<ArrayImpl, 2>
where Item: Lapack, ArrayImpl: UnsafeRandom1DAccessByValue<Item = Item> + Shape<2>,

Source§

fn qr(&self, pivoting: EnablePivoting) -> RlstResult<QrDecomposition<Item>>

Compute the QR decomposition of a matrix.

Source§

type Item = Item

Item type of the QR decomposition.
Source§

impl<Item, ArrayImpl> SingularValueDecomposition for Array<ArrayImpl, 2>
where Item: Lapack + Gemm, ArrayImpl: UnsafeRandom1DAccessByValue<Item = Item> + Shape<2>,

Source§

type Item = Item

The item type of the matrix.
Source§

fn singular_values( &self, ) -> RlstResult<DynArray<<Self::Item as RlstScalar>::Real, 1>>

Compute the singular values of a matrix.
Source§

fn svd( &self, mode: SvdMode, ) -> RlstResult<(DynArray<<Self::Item as RlstScalar>::Real, 1>, DynArray<Self::Item, 2>, DynArray<Self::Item, 2>)>

Compute the singular value decomposition of a matrix. Read more
Source§

fn svd_truncated( &self, max_singular_values: Option<usize>, tol: Option<<Self::Item as RlstScalar>::Real>, ) -> RlstResult<(DynArray<<Self::Item as RlstScalar>::Real, 1>, DynArray<Self::Item, 2>, DynArray<Self::Item, 2>)>

Compute the truncated singular value decomposition of a matrix. Read more
Source§

fn pseudo_inverse( &self, max_singular_values: Option<usize>, tol: Option<<Self::Item as RlstScalar>::Real>, ) -> RlstResult<PInv<Self::Item>>
where <Self::Item as RlstScalar>::Real: Into<Self::Item>,

Compute the pseudo-inverse of a matrix. Read more
Source§

impl<Item, ArrayImpl, RhsArrayImpl, const NDIM: usize> Solve<Array<RhsArrayImpl, NDIM>> for Array<ArrayImpl, 2>
where Item: Lapack, ArrayImpl: UnsafeRandom1DAccessByValue<Item = Item> + Shape<2>, RhsArrayImpl: UnsafeRandom1DAccessByValue<Item = Item> + Shape<NDIM>,

Source§

type Output = Array<BaseArray<VectorContainer<Item>, NDIM>, NDIM>

The output type of the solver.
Source§

fn solve(&self, rhs: &Array<RhsArrayImpl, NDIM>) -> RlstResult<Self::Output>

Solve the linear system Ax = b for x.
Source§

impl<Item, ArrayImpl, RhsArrayImpl, const NDIM: usize> SolveTriangular<Array<RhsArrayImpl, NDIM>> for Array<ArrayImpl, 2>
where Item: Lapack, ArrayImpl: UnsafeRandom1DAccessByValue<Item = Item> + Shape<2>, RhsArrayImpl: UnsafeRandom1DAccessByValue<Item = Item> + Shape<NDIM>,

Source§

type Output = Array<BaseArray<VectorContainer<Item>, NDIM>, NDIM>

The output type of the triangular solver.
Source§

fn solve_triangular( &self, uplo: UpLo, rhs: &Array<RhsArrayImpl, NDIM>, ) -> RlstResult<Self::Output>

Solve a triangular system of linear equations. Read more
Source§

impl<ArrayImpl1, ArrayImpl2, const NDIM: usize> Sub<Array<ArrayImpl2, NDIM>> for Array<ArrayImpl1, NDIM>
where ArrayImpl1: Shape<NDIM>, ArrayImpl2: Shape<NDIM>,

Source§

type Output = Array<ArraySubtraction<ArrayImpl1, ArrayImpl2, NDIM>, NDIM>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Array<ArrayImpl2, NDIM>) -> Self::Output

Performs the - operation. Read more
Source§

impl<Item, ArrayImpl1, ArrayImpl2, const NDIM: usize> SubAssign<Array<ArrayImpl2, NDIM>> for Array<ArrayImpl1, NDIM>
where ArrayImpl1: Shape<NDIM> + UnsafeRandom1DAccessMut<Item = Item>, ArrayImpl2: Shape<NDIM> + UnsafeRandom1DAccessByValue<Item = Item>, Item: SubAssign,

Source§

fn sub_assign(&mut self, rhs: Array<ArrayImpl2, NDIM>)

Performs the -= operation. Read more
Source§

impl<Item, ArrayImpl> SymmEig for Array<ArrayImpl, 2>
where ArrayImpl: UnsafeRandom1DAccessByValue<Item = Item> + Shape<2>, Item: Lapack,

Source§

type Item = Item

Item type of the symmetric eigenvalue decomposition.
Source§

fn eigh( &self, uplo: UpLo, mode: SymmEigMode, ) -> RlstResult<(DynArray<Item::Real, 1>, Option<DynArray<Item, 2>>)>

Compute the symmetric eigenvalue decomposition of a matrix.
Source§

fn eigenvaluesh( &self, ) -> RlstResult<DynArray<<Self::Item as RlstScalar>::Real, 1>>

Compute the eigenvalues of a real symmetric or complex Hermitian matrix.

Auto Trait Implementations§

§

impl<ArrayImpl, const NDIM: usize> Freeze for Array<ArrayImpl, NDIM>
where ArrayImpl: Freeze,

§

impl<ArrayImpl, const NDIM: usize> RefUnwindSafe for Array<ArrayImpl, NDIM>
where ArrayImpl: RefUnwindSafe,

§

impl<ArrayImpl, const NDIM: usize> Send for Array<ArrayImpl, NDIM>
where ArrayImpl: Send,

§

impl<ArrayImpl, const NDIM: usize> Sync for Array<ArrayImpl, NDIM>
where ArrayImpl: Sync,

§

impl<ArrayImpl, const NDIM: usize> Unpin for Array<ArrayImpl, NDIM>
where ArrayImpl: Unpin,

§

impl<ArrayImpl, const NDIM: usize> UnwindSafe for Array<ArrayImpl, NDIM>
where ArrayImpl: UnwindSafe,

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> IntoEither for T

Source§

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

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T, U> Imply<T> for U