pub struct Array<ArrayImpl, const NDIM: usize>(/* private fields */);Expand description
Public array wrapper around a storage, view, or lazy-expression implementation.
NDIM is the number of axes. The implementation determines whether data is owned or
borrowed, contiguous or strided, mutable, or computed lazily. Most users construct one of
the aliases such as DynArray rather than naming the implementation type.
Implementations§
Source§impl<ArrayImpl, const ADIM: usize> Array<ArrayImpl, ADIM>
impl<ArrayImpl, const ADIM: usize> Array<ArrayImpl, ADIM>
Sourcepub fn insert_empty_axis<const NDIM: usize>(
self,
axis_position: AxisPosition,
) -> Array<ArrayAppendAxis<ArrayImpl, ADIM, NDIM>, NDIM>where
NumberType<ADIM>: IsSmallerByOne<NDIM>,
pub fn insert_empty_axis<const NDIM: usize>(
self,
axis_position: AxisPosition,
) -> Array<ArrayAppendAxis<ArrayImpl, ADIM, NDIM>, NDIM>where
NumberType<ADIM>: IsSmallerByOne<NDIM>,
Insert a singleton axis at the front or back.
Despite the historical method name, the inserted axis has extent one, not zero. The view owns its array operand and does not allocate or copy element storage.
Source§impl<ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>
impl<ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>
Sourcepub fn with_container_type<TypeHint: ContainerTypeRepr + ArrayFromContainerType + RowMajorArrayFromContainerType>(
self,
) -> Array<WithEvalType<ArrayImpl, TypeHint, NDIM>, NDIM>
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>
impl<ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>
Sourcepub fn into_flat(self) -> Array<ArrayFlatView<ArrayImpl, NDIM>, 1>
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>
impl<ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>
Move the array into a cloneable, single-threaded shared owner.
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.
Move the array into a cloneable, thread-safe shared owner. 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<Item: Copy + Default> Array<ScalarArrayImpl<Item>, 0>
impl<Item: Copy + Default> Array<ScalarArrayImpl<Item>, 0>
Sourcepub fn from_scalar(value: Item) -> Self
pub fn from_scalar(value: Item) -> Self
Construct a zero-dimensional array owning value.
Sourcepub fn into_scalar(self) -> Item
pub fn into_scalar(self) -> Item
Consume the array and return its scalar.
Sourcepub fn scalar_mut(&mut self) -> &mut Item
pub fn scalar_mut(&mut self) -> &mut Item
Mutably borrow the scalar.
Source§impl<ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>
impl<ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>
Sourcepub fn new(arr: ArrayImpl) -> Self
pub fn new(arr: ArrayImpl) -> Self
Wrap an array implementation.
The implementation determines the supported ranks and access operations.
ZeroDimArray provides scalar-only storage for rank zero.
Sourcepub fn imp(&self) -> &ArrayImpl
pub fn imp(&self) -> &ArrayImpl
Return a reference to the implementation.
Sourcepub fn imp_mut(&mut self) -> &mut ArrayImpl
pub fn imp_mut(&mut self) -> &mut ArrayImpl
Return a mutable reference to the implementation.
Sourcepub fn r(&self) -> Array<ArrayRef<'_, ArrayImpl, NDIM>, NDIM>
pub fn r(&self) -> Array<ArrayRef<'_, ArrayImpl, NDIM>, NDIM>
Wrap a shared borrow in an array value.
This is useful with operators and views that consume their operands. The returned value
does not copy data and cannot outlive self.
Sourcepub fn r_mut(&mut self) -> Array<ArrayRefMut<'_, ArrayImpl, NDIM>, NDIM>
pub fn r_mut(&mut self) -> Array<ArrayRefMut<'_, ArrayImpl, NDIM>, NDIM>
Wrap an exclusive borrow in an array value.
The returned value does not copy data and cannot outlive the mutable borrow of self.
Source§impl<ArrayImpl: Shape<NDIM>, const NDIM: usize> Array<ArrayImpl, NDIM>
impl<ArrayImpl: Shape<NDIM>, const NDIM: usize> Array<ArrayImpl, NDIM>
Sourcepub fn number_of_elements(&self) -> usize
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>
impl<Item: Copy + Default, const NDIM: usize> Array<BaseArray<VectorContainer<Item>, NDIM>, NDIM>
Sourcepub fn from_shape(shape: [usize; NDIM]) -> Self
pub fn from_shape(shape: [usize; NDIM]) -> Self
Allocate a default-initialized column-major array with shape.
A zero extent is permitted and produces an empty array.
Source§impl<Item: Copy + Default, const NDIM: usize, const ALIGNMENT: usize> Array<BaseArray<AlignedVectorContainer<Item, ALIGNMENT>, NDIM>, NDIM>
impl<Item: Copy + Default, const NDIM: usize, const ALIGNMENT: usize> Array<BaseArray<AlignedVectorContainer<Item, ALIGNMENT>, NDIM>, NDIM>
Sourcepub fn from_shape(shape: [usize; NDIM]) -> Self
pub fn from_shape(shape: [usize; NDIM]) -> Self
Allocate a default-initialized column-major array with shape and ALIGNMENT.
ALIGNMENT must satisfy the allocator requirements documented by aligned-vec.
Sourcepub fn from_shape_and_avec(
shape: [usize; NDIM],
data: AVec<Item, ConstAlign<ALIGNMENT>>,
) -> Self
pub fn from_shape_and_avec( shape: [usize; NDIM], data: AVec<Item, ConstAlign<ALIGNMENT>>, ) -> Self
Create an aligned column-major array from an aligned vector without copying it.
§Panics
Panics if data.len() differs from the product of shape.
Source§impl<Item: Copy + Default, const ALIGNMENT: usize> Array<BaseArray<AlignedVectorContainer<Item, ALIGNMENT>, 2>, 2>
impl<Item: Copy + Default, const ALIGNMENT: usize> Array<BaseArray<AlignedVectorContainer<Item, ALIGNMENT>, 2>, 2>
Sourcepub fn from_iter_aij<Iter: Iterator<Item = ([usize; 2], Item)>>(
shape: [usize; 2],
iter: Iter,
) -> AlignedDynArray<Item, 2, ALIGNMENT>
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>
impl<Item: Copy + Default, const NDIM: usize> Array<StridedBaseArray<VectorContainer<Item>, NDIM>, NDIM>
Sourcepub fn from_shape_and_stride(
shape: [usize; NDIM],
stride: [usize; NDIM],
) -> Self
pub fn from_shape_and_stride( shape: [usize; NDIM], stride: [usize; NDIM], ) -> Self
Allocate an array with an explicit physical stride.
The allocation spans through the greatest reachable storage offset. Strides must map every logical index to a distinct storage element.
§Panics
Panics if two computed logical offsets are equal. Shape/stride arithmetic uses ordinary
usize operations, so callers must provide metadata whose products, offsets, and storage
span are representable.
Source§impl<Item: Copy + Default, const NDIM: usize> Array<StridedBaseArray<VectorContainer<Item>, NDIM>, NDIM>
impl<Item: Copy + Default, const NDIM: usize> Array<StridedBaseArray<VectorContainer<Item>, NDIM>, NDIM>
Source§impl<ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>where
ArrayImpl: UnsafeRandomAccessByValue<NDIM>,
impl<ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>where
ArrayImpl: UnsafeRandomAccessByValue<NDIM>,
Sourcepub unsafe fn get_value_unchecked(
&self,
multi_index: [usize; NDIM],
) -> ArrayImpl::Item
pub unsafe fn get_value_unchecked( &self, multi_index: [usize; NDIM], ) -> ArrayImpl::Item
Source§impl<ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>where
ArrayImpl: UnsafeRandomAccessByRef<NDIM>,
impl<ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>where
ArrayImpl: UnsafeRandomAccessByRef<NDIM>,
Sourcepub unsafe fn get_unchecked(
&self,
multi_index: [usize; NDIM],
) -> &ArrayImpl::Item
pub unsafe fn get_unchecked( &self, multi_index: [usize; NDIM], ) -> &ArrayImpl::Item
Source§impl<ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>where
ArrayImpl: UnsafeRandomAccessMut<NDIM>,
impl<ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>where
ArrayImpl: UnsafeRandomAccessMut<NDIM>,
Source§impl<ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>where
ArrayImpl: RandomAccessByValue<NDIM>,
impl<ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>where
ArrayImpl: RandomAccessByValue<NDIM>,
Source§impl<ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>where
ArrayImpl: RandomAccessByRef<NDIM>,
impl<ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>where
ArrayImpl: RandomAccessByRef<NDIM>,
Source§impl<ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>where
ArrayImpl: RandomAccessMut<NDIM>,
impl<ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>where
ArrayImpl: RandomAccessMut<NDIM>,
Source§impl<ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>where
ArrayImpl: RawAccessMut,
impl<ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>where
ArrayImpl: RawAccessMut,
Source§impl<ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>
impl<ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>
Sourcepub fn memory_layout(&self) -> MemoryLayout
pub fn memory_layout(&self) -> MemoryLayout
Return the memory layout
The possible memory layouts are defined in MemoryLayout.
Sourcepub fn is_contiguous(&self) -> bool
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>,
impl<ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>where
ArrayImpl: ResizeInPlace<NDIM>,
Sourcepub fn resize_in_place(&mut self, shape: [usize; NDIM])
pub fn resize_in_place(&mut self, shape: [usize; NDIM])
Source§impl<'a, Item, const NDIM: usize> Array<BaseArray<SliceContainer<'a, Item>, NDIM>, NDIM>
impl<'a, Item, const NDIM: usize> Array<BaseArray<SliceContainer<'a, Item>, NDIM>, NDIM>
Sourcepub fn from_shape(slice: &'a [Item], shape: [usize; NDIM]) -> Self
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>
impl<'a, Item, const NDIM: usize> Array<BaseArray<SliceContainerMut<'a, Item>, NDIM>, NDIM>
Sourcepub fn from_shape(slice: &'a mut [Item], shape: [usize; NDIM]) -> Self
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>
impl<'a, Item, const NDIM: usize> Array<StridedBaseArray<SliceContainer<'a, Item>, NDIM>, NDIM>
Source§impl<'a, Item, const NDIM: usize> Array<StridedBaseArray<SliceContainerMut<'a, Item>, NDIM>, NDIM>
impl<'a, Item, const NDIM: usize> Array<StridedBaseArray<SliceContainerMut<'a, Item>, NDIM>, NDIM>
Source§impl<Item, const NDIM: usize> Array<BaseArray<VectorContainer<Item>, NDIM>, NDIM>
impl<Item, const NDIM: usize> Array<BaseArray<VectorContainer<Item>, NDIM>, NDIM>
Sourcepub fn new_from<ArrayImpl>(arr: &Array<ArrayImpl, NDIM>) -> Selfwhere
ArrayImpl: UnsafeRandom1DAccessByValue<Item = Item> + Shape<NDIM>,
pub fn new_from<ArrayImpl>(arr: &Array<ArrayImpl, NDIM>) -> Selfwhere
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>
impl<Item, const NDIM: usize> Array<StridedBaseArray<VectorContainer<Item>, NDIM>, NDIM>
Sourcepub fn new_from<ArrayImpl>(
stride: [usize; NDIM],
arr: &Array<ArrayImpl, NDIM>,
) -> Selfwhere
ArrayImpl: UnsafeRandom1DAccessByValue<Item = Item> + Shape<NDIM>,
pub fn new_from<ArrayImpl>(
stride: [usize; NDIM],
arr: &Array<ArrayImpl, NDIM>,
) -> Selfwhere
ArrayImpl: UnsafeRandom1DAccessByValue<Item = Item> + Shape<NDIM>,
Create a new strided array with stride and fill with values from arr.
Sourcepub fn row_major_from<ArrayImpl>(arr: &Array<ArrayImpl, NDIM>) -> Selfwhere
ArrayImpl: UnsafeRandom1DAccessByValue<Item = Item> + Shape<NDIM>,
pub fn row_major_from<ArrayImpl>(arr: &Array<ArrayImpl, NDIM>) -> Selfwhere
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>,
impl<ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>where
ArrayImpl: UnsafeRandom1DAccessByValue + Shape<NDIM>,
Sourcepub fn iter_value(&self) -> ArrayDefaultIteratorByValue<'_, ArrayImpl, NDIM> ⓘ
pub fn iter_value(&self) -> ArrayDefaultIteratorByValue<'_, ArrayImpl, NDIM> ⓘ
Source§impl<ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>where
ArrayImpl: UnsafeRandom1DAccessByRef + Shape<NDIM>,
impl<ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>where
ArrayImpl: UnsafeRandom1DAccessByRef + Shape<NDIM>,
Sourcepub fn iter_ref(&self) -> ArrayDefaultIteratorByRef<'_, ArrayImpl, NDIM> ⓘ
pub fn iter_ref(&self) -> ArrayDefaultIteratorByRef<'_, ArrayImpl, NDIM> ⓘ
Source§impl<ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>where
ArrayImpl: UnsafeDisjointRandom1DAccessMut + Shape<NDIM>,
impl<ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>where
ArrayImpl: UnsafeDisjointRandom1DAccessMut + Shape<NDIM>,
Sourcepub fn iter_mut(&mut self) -> ArrayDefaultIteratorMut<'_, ArrayImpl, NDIM> ⓘ
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>,
impl<Item, ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>where
ArrayImpl: UnsafeRandomAccessByValue<NDIM, Item = Item> + Shape<NDIM>,
Sourcepub fn diag_iter_value(&self) -> ArrayDiagIteratorByValue<'_, ArrayImpl, NDIM> ⓘ
pub fn diag_iter_value(&self) -> ArrayDiagIteratorByValue<'_, ArrayImpl, NDIM> ⓘ
Source§impl<Item, ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>where
ArrayImpl: UnsafeRandomAccessByRef<NDIM, Item = Item> + Shape<NDIM>,
impl<Item, ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>where
ArrayImpl: UnsafeRandomAccessByRef<NDIM, Item = Item> + Shape<NDIM>,
Sourcepub fn diag_iter_ref(&self) -> ArrayDiagIteratorByRef<'_, ArrayImpl, NDIM> ⓘ
pub fn diag_iter_ref(&self) -> ArrayDiagIteratorByRef<'_, ArrayImpl, NDIM> ⓘ
Source§impl<Item, ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>where
ArrayImpl: UnsafeRandomAccessMut<NDIM, Item = Item> + Shape<NDIM>,
impl<Item, ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>where
ArrayImpl: UnsafeRandomAccessMut<NDIM, Item = Item> + Shape<NDIM>,
Sourcepub fn diag_iter_mut(&mut self) -> ArrayDiagIteratorMut<'_, ArrayImpl, NDIM> ⓘ
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: UnsafeDisjointRandom1DAccessMut<Item = Item> + Shape<NDIM>,
impl<Item, ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>where
ArrayImpl: UnsafeDisjointRandom1DAccessMut<Item = Item> + Shape<NDIM>,
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>,
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>,
Sourcepub fn multislice_iter<const SDIM: usize, const OUTDIM: usize>(
&self,
axes: [usize; SDIM],
) -> MultisliceIterator<'_, Item, ArrayImpl, NDIM, SDIM, OUTDIM> ⓘ
pub fn multislice_iter<const SDIM: usize, const OUTDIM: usize>( &self, axes: [usize; SDIM], ) -> MultisliceIterator<'_, Item, ArrayImpl, NDIM, SDIM, OUTDIM> ⓘ
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: UnsafeDisjointRandom1DAccessMut<Item = Item> + UnsafeRandomAccessMut<NDIM, Item = Item> + Shape<NDIM>,
impl<Item, ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>where
Const<NDIM>: ToUInt,
<Const<NDIM> as ToUInt>::Output: Unsigned + NonZero,
ArrayImpl: UnsafeDisjointRandom1DAccessMut<Item = Item> + UnsafeRandomAccessMut<NDIM, Item = Item> + Shape<NDIM>,
Sourcepub fn multislice_iter_mut<const SDIM: usize, const OUTDIM: usize>(
&mut self,
axes: [usize; SDIM],
) -> MultisliceIteratorMut<'_, Item, ArrayImpl, NDIM, SDIM, OUTDIM> ⓘ
pub fn multislice_iter_mut<const SDIM: usize, const OUTDIM: usize>( &mut self, axes: [usize; SDIM], ) -> MultisliceIteratorMut<'_, Item, ArrayImpl, NDIM, SDIM, OUTDIM> ⓘ
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: UnsafeDisjointRandom1DAccessMut + Shape<NDIM>,
impl<ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>where
ArrayImpl: UnsafeDisjointRandom1DAccessMut + Shape<NDIM>,
Sourcepub fn fill_from_iter<Iter>(&mut self, iter: Iter)
pub fn fill_from_iter<Iter>(&mut self, iter: Iter)
Fill elements in logical column-major order from an iterator.
Filling stops when either the array or iterator is exhausted. Existing trailing array elements are unchanged when the iterator is short; excess iterator values are ignored.
Source§impl<ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>
impl<ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>
Sourcepub fn fill_from_resize<ArrayImplOther>(
&mut self,
other: &Array<ArrayImplOther, NDIM>,
)
pub fn fill_from_resize<ArrayImplOther>( &mut self, other: &Array<ArrayImplOther, NDIM>, )
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: UnsafeDisjointRandom1DAccessMut + Shape<NDIM>,
impl<ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>where
ArrayImpl: UnsafeDisjointRandom1DAccessMut + Shape<NDIM>,
Sourcepub fn fill_with_value(&mut self, value: ArrayImpl::Item)
pub fn fill_with_value(&mut self, value: ArrayImpl::Item)
Source§impl<ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>where
ArrayImpl: UnsafeDisjointRandom1DAccessMut + Shape<NDIM>,
impl<ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>where
ArrayImpl: UnsafeDisjointRandom1DAccessMut + Shape<NDIM>,
Source§impl<ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>where
ArrayImpl: UnsafeDisjointRandom1DAccessMut + UnsafeRandomAccessMut<NDIM> + Shape<NDIM>,
ArrayImpl::Item: One,
impl<ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>where
ArrayImpl: UnsafeDisjointRandom1DAccessMut + UnsafeRandomAccessMut<NDIM> + Shape<NDIM>,
ArrayImpl::Item: One,
Sourcepub fn set_identity(&mut self)
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>
impl<ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>
Sourcepub fn trace(&self) -> ArrayImpl::Item
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>
impl<Item, ArrayImpl> Array<ArrayImpl, 1>
Sourcepub fn inner<ArrayImplOther>(
&self,
other: &Array<ArrayImplOther, 1>,
) -> Option<Item>where
ArrayImplOther: UnsafeRandom1DAccessByValue<Item = Item> + Shape<1>,
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<ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>where
ArrayImpl: UnsafeRandom1DAccessByValue + Shape<NDIM>,
impl<ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>where
ArrayImpl: UnsafeRandom1DAccessByValue + Shape<NDIM>,
Source§impl<ArrayImpl> Array<ArrayImpl, 2>where
ArrayImpl: Shape<2> + UnsafeRandomAccessByValue<2>,
impl<ArrayImpl> Array<ArrayImpl, 2>where
ArrayImpl: Shape<2> + UnsafeRandomAccessByValue<2>,
Sourcepub fn col_iter(&self) -> ColIterator<'_, ArrayImpl, 2> ⓘ
pub fn col_iter(&self) -> ColIterator<'_, ArrayImpl, 2> ⓘ
Source§impl<ArrayImpl> Array<ArrayImpl, 2>where
ArrayImpl: Shape<2> + UnsafeRandomAccessMut<2>,
impl<ArrayImpl> Array<ArrayImpl, 2>where
ArrayImpl: Shape<2> + UnsafeRandomAccessMut<2>,
Sourcepub fn col_iter_mut(&mut self) -> ColIteratorMut<'_, ArrayImpl, 2> ⓘ
pub fn col_iter_mut(&mut self) -> ColIteratorMut<'_, ArrayImpl, 2> ⓘ
Source§impl<ArrayImpl> Array<ArrayImpl, 2>where
ArrayImpl: Shape<2> + UnsafeRandomAccessByValue<2>,
impl<ArrayImpl> Array<ArrayImpl, 2>where
ArrayImpl: Shape<2> + UnsafeRandomAccessByValue<2>,
Sourcepub fn row_iter(&self) -> RowIterator<'_, ArrayImpl, 2> ⓘ
pub fn row_iter(&self) -> RowIterator<'_, ArrayImpl, 2> ⓘ
Source§impl<ArrayImpl> Array<ArrayImpl, 2>where
ArrayImpl: Shape<2> + UnsafeRandomAccessByValue<2>,
impl<ArrayImpl> Array<ArrayImpl, 2>where
ArrayImpl: Shape<2> + UnsafeRandomAccessByValue<2>,
Sourcepub fn row_iter_mut(&mut self) -> RowIteratorMut<'_, ArrayImpl, 2> ⓘ
pub fn row_iter_mut(&mut self) -> RowIteratorMut<'_, ArrayImpl, 2> ⓘ
Source§impl<ArrayImpl> Array<ArrayImpl, 2>where
ArrayImpl: UnsafeRandom1DAccessByValue + Shape<2>,
impl<ArrayImpl> Array<ArrayImpl, 2>where
ArrayImpl: UnsafeRandom1DAccessByValue + Shape<2>,
Source§impl<ArrayImpl> Array<ArrayImpl, 2>where
ArrayImpl: UnsafeRandom1DAccessByRef + Shape<2>,
impl<ArrayImpl> Array<ArrayImpl, 2>where
ArrayImpl: UnsafeRandom1DAccessByRef + Shape<2>,
Source§impl<ArrayImpl> Array<ArrayImpl, 2>where
ArrayImpl: UnsafeDisjointRandom1DAccessMut + Shape<2>,
impl<ArrayImpl> Array<ArrayImpl, 2>where
ArrayImpl: UnsafeDisjointRandom1DAccessMut + Shape<2>,
Source§impl<ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>
impl<ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>
Sourcepub fn cast<Target>(self) -> Array<ArrayCast<Target, ArrayImpl, NDIM>, NDIM>
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>
impl<ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>
Sourcepub fn coerce_dim<const CDIM: usize>(
self,
) -> RlstResult<Array<CoerceArray<ArrayImpl, NDIM, CDIM>, CDIM>>
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>,
impl<ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>where
ArrayImpl: Shape<NDIM>,
Sourcepub fn permute_axes(
self,
permutation: [usize; NDIM],
) -> Array<ArrayTranspose<ArrayImpl, NDIM>, NDIM>
pub fn permute_axes( self, permutation: [usize; NDIM], ) -> Array<ArrayTranspose<ArrayImpl, NDIM>, NDIM>
Permute axes of an array.
For a valid permutation, permutation[output_axis] identifies the corresponding source
axis. For example, [1, 0, 2] swaps the first two axes.
§Panics
Panics if an entry is outside 0..NDIM or if an axis occurs more than once.
Every source axis must occur exactly once.
Sourcepub fn transpose(self) -> Array<ArrayTranspose<ArrayImpl, NDIM>, NDIM>
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: UnsafeDisjointRandom1DAccessMut<Item = Item> + Shape<NDIM>,
StandardNormal: Distribution<Item::Real>,
StandardUniform: Distribution<Item::Real>,
impl<Item, ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>where
Item: RandScalar + RlstScalar,
ArrayImpl: UnsafeDisjointRandom1DAccessMut<Item = Item> + Shape<NDIM>,
StandardNormal: Distribution<Item::Real>,
StandardUniform: Distribution<Item::Real>,
Sourcepub fn fill_from_standard_normal<R: Rng>(&mut self, rng: &mut R)
pub fn fill_from_standard_normal<R: Rng>(&mut self, rng: &mut R)
Fill an array with normally distributed random numbers.
§Traits
Sourcepub fn fill_from_equally_distributed<R: Rng>(&mut self, rng: &mut R)
pub fn fill_from_equally_distributed<R: Rng>(&mut self, rng: &mut R)
Fill an array with equally distributed random numbers.
§Traits
Sourcepub fn fill_from_seed_equally_distributed(&mut self, seed: usize)
pub fn fill_from_seed_equally_distributed(&mut self, seed: usize)
Fill an array with equally distributed random numbers using a given seed.
§Traits
Sourcepub fn fill_from_seed_normally_distributed(&mut self, seed: usize)
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>
impl<ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>
Sourcepub fn reverse_axis(
self,
axis: usize,
) -> Array<ReverseAxis<ArrayImpl, NDIM>, NDIM>
pub fn reverse_axis( self, axis: usize, ) -> Array<ReverseAxis<ArrayImpl, NDIM>, NDIM>
Source§impl<ArrayImpl, const ADIM: usize> Array<ArrayImpl, ADIM>where
ArrayImpl: Shape<ADIM>,
impl<ArrayImpl, const ADIM: usize> Array<ArrayImpl, ADIM>where
ArrayImpl: Shape<ADIM>,
Sourcepub fn slice<const OUTDIM: usize>(
self,
axis: usize,
index: usize,
) -> Array<ArraySlice<ArrayImpl, ADIM, OUTDIM>, OUTDIM>
pub fn slice<const OUTDIM: usize>( self, axis: usize, index: usize, ) -> Array<ArraySlice<ArrayImpl, ADIM, OUTDIM>, OUTDIM>
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).
Sourcepub fn multislice<const SDIM: usize, const OUTDIM: usize>(
self,
axes: [usize; SDIM],
indices: [usize; SDIM],
) -> Array<Multislice<ArrayImpl, ADIM, SDIM, OUTDIM>, OUTDIM>
pub fn multislice<const SDIM: usize, const OUTDIM: usize>( self, axes: [usize; SDIM], indices: [usize; SDIM], ) -> Array<Multislice<ArrayImpl, ADIM, SDIM, OUTDIM>, 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>,
impl<ArrayImpl> Array<ArrayImpl, 2>where
ArrayImpl: Shape<2>,
Sourcepub fn row(self, row_index: usize) -> Array<ArraySlice<ArrayImpl, 2, 1>, 1>
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.
Sourcepub fn col(self, col_index: usize) -> Array<ArraySlice<ArrayImpl, 2, 1>, 1>
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>
impl<ArrayImpl: Shape<NDIM>, const NDIM: usize> Array<ArrayImpl, NDIM>
Sourcepub fn into_subview(
self,
offset: [usize; NDIM],
shape: [usize; NDIM],
) -> Array<ArraySubView<ArrayImpl, NDIM>, NDIM>
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>
impl<ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>
Sourcepub fn unary_op<OpItem, OpTarget, Op: Fn(OpItem) -> OpTarget>(
self,
op: Op,
) -> Array<ArrayUnaryOperator<OpItem, OpTarget, ArrayImpl, Op, NDIM>, NDIM>
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>,
impl<Item: Default + Copy + Mul<Output = Item>, ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>where
ArrayImpl: BaseItem<Item = Item>,
Sourcepub fn scalar_mul(
self,
scalar: Item,
) -> Array<ArrayScalarMult<Item, ArrayImpl, NDIM>, NDIM>
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>,
impl<Item: Conj, ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>where
ArrayImpl: BaseItem<Item = Item>,
Source§impl<Item: Abs, ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>where
ArrayImpl: BaseItem<Item = Item>,
impl<Item: Abs, ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>where
ArrayImpl: BaseItem<Item = Item>,
Source§impl<Item: Square, ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>where
ArrayImpl: BaseItem<Item = Item>,
impl<Item: Square, ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>where
ArrayImpl: BaseItem<Item = Item>,
Source§impl<Item: AbsSquare, ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>where
ArrayImpl: BaseItem<Item = Item>,
impl<Item: AbsSquare, ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>where
ArrayImpl: BaseItem<Item = Item>,
Sourcepub fn abs_square(
self,
) -> Array<ArrayUnaryOperator<Item, <Item as AbsSquare>::Output, ArrayImpl, fn(Item) -> <Item as AbsSquare>::Output, NDIM>, NDIM>
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>,
impl<Item: Sqrt, ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>where
ArrayImpl: BaseItem<Item = Item>,
Source§impl<Item: Exp, ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>where
ArrayImpl: BaseItem<Item = Item>,
impl<Item: Exp, ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>where
ArrayImpl: BaseItem<Item = Item>,
Source§impl<Item: Ln, ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>where
ArrayImpl: BaseItem<Item = Item>,
impl<Item: Ln, ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>where
ArrayImpl: BaseItem<Item = Item>,
Source§impl<Item: Recip, ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>where
ArrayImpl: BaseItem<Item = Item>,
impl<Item: Recip, ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>where
ArrayImpl: BaseItem<Item = Item>,
Source§impl<Item: Sin, ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>where
ArrayImpl: BaseItem<Item = Item>,
impl<Item: Sin, ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>where
ArrayImpl: BaseItem<Item = Item>,
Source§impl<Item: Cos, ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>where
ArrayImpl: BaseItem<Item = Item>,
impl<Item: Cos, ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>where
ArrayImpl: BaseItem<Item = Item>,
Source§impl<Item: Tan, ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>where
ArrayImpl: BaseItem<Item = Item>,
impl<Item: Tan, ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>where
ArrayImpl: BaseItem<Item = Item>,
Source§impl<Item: Asin, ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>where
ArrayImpl: BaseItem<Item = Item>,
impl<Item: Asin, ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>where
ArrayImpl: BaseItem<Item = Item>,
Source§impl<Item: Acos, ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>where
ArrayImpl: BaseItem<Item = Item>,
impl<Item: Acos, ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>where
ArrayImpl: BaseItem<Item = Item>,
Source§impl<Item: Atan, ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>where
ArrayImpl: BaseItem<Item = Item>,
impl<Item: Atan, ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>where
ArrayImpl: BaseItem<Item = Item>,
Source§impl<Item: Sinh, ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>where
ArrayImpl: BaseItem<Item = Item>,
impl<Item: Sinh, ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>where
ArrayImpl: BaseItem<Item = Item>,
Source§impl<Item: Cosh, ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>where
ArrayImpl: BaseItem<Item = Item>,
impl<Item: Cosh, ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>where
ArrayImpl: BaseItem<Item = Item>,
Source§impl<Item: Tanh, ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>where
ArrayImpl: BaseItem<Item = Item>,
impl<Item: Tanh, ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>where
ArrayImpl: BaseItem<Item = Item>,
Source§impl<Item: Asinh, ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>where
ArrayImpl: BaseItem<Item = Item>,
impl<Item: Asinh, ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>where
ArrayImpl: BaseItem<Item = Item>,
Source§impl<Item: Acosh, ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>where
ArrayImpl: BaseItem<Item = Item>,
impl<Item: Acosh, ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>where
ArrayImpl: BaseItem<Item = Item>,
Source§impl<Item: Atanh, ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>where
ArrayImpl: BaseItem<Item = Item>,
impl<Item: Atanh, ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>where
ArrayImpl: BaseItem<Item = Item>,
Source§impl<Item, ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>where
ArrayImpl: UnsafeRandomAccessMut<NDIM, Item = Item>,
Item: Copy,
impl<Item, ArrayImpl, const NDIM: usize> Array<ArrayImpl, NDIM>where
ArrayImpl: UnsafeRandomAccessMut<NDIM, Item = Item>,
Item: Copy,
Source§impl<Item, const NDIM: usize> Array<BaseArray<ArrayContainer<Item, 1>, NDIM>, NDIM>
impl<Item, const NDIM: usize> Array<BaseArray<ArrayContainer<Item, 1>, NDIM>, NDIM>
Sourcepub fn one_element_array() -> Self
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>
impl<ArrayImpl1, ArrayImpl2, const NDIM: usize> Add<Array<ArrayImpl2, NDIM>> for Array<ArrayImpl1, NDIM>
Source§impl<Item, ArrayImpl1, ArrayImpl2, const NDIM: usize> AddAssign<Array<ArrayImpl2, NDIM>> for Array<ArrayImpl1, NDIM>where
ArrayImpl1: Shape<NDIM> + UnsafeDisjointRandom1DAccessMut<Item = Item>,
ArrayImpl2: Shape<NDIM> + UnsafeRandom1DAccessByValue<Item = Item>,
Item: AddAssign,
impl<Item, ArrayImpl1, ArrayImpl2, const NDIM: usize> AddAssign<Array<ArrayImpl2, NDIM>> for Array<ArrayImpl1, NDIM>where
ArrayImpl1: Shape<NDIM> + UnsafeDisjointRandom1DAccessMut<Item = Item>,
ArrayImpl2: Shape<NDIM> + UnsafeRandom1DAccessByValue<Item = Item>,
Item: AddAssign,
Source§fn add_assign(&mut self, rhs: Array<ArrayImpl2, NDIM>)
fn add_assign(&mut self, rhs: Array<ArrayImpl2, NDIM>)
+= operation. Read moreSource§impl<Item, ArrayImplX, ArrayImplY, ArrayImpl> AsMatrixApply<Array<ArrayImplX, 1>, Array<ArrayImplY, 1>> for Array<ArrayImpl, 2>
impl<Item, ArrayImplX, ArrayImplY, ArrayImpl> AsMatrixApply<Array<ArrayImplX, 1>, Array<ArrayImplY, 1>> for Array<ArrayImpl, 2>
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: UnsafeDisjointRandom1DAccessMut<Item = Item> + Shape<1>,
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: UnsafeDisjointRandom1DAccessMut<Item = Item> + Shape<1>,
Source§impl<Item, ArrayImplX, ArrayImplY, ArrayImpl> AsMatrixApply<Array<ArrayImplX, 2>, Array<ArrayImplY, 2>> for Array<ArrayImpl, 2>
impl<Item, ArrayImplX, ArrayImplY, ArrayImpl> AsMatrixApply<Array<ArrayImplX, 2>, Array<ArrayImplY, 2>> for Array<ArrayImpl, 2>
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>,
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§impl<ArrayImpl, const NDIM: usize> BaseItem for Array<ArrayImpl, NDIM>where
ArrayImpl: BaseItem,
impl<ArrayImpl, const NDIM: usize> BaseItem for Array<ArrayImpl, NDIM>where
ArrayImpl: BaseItem,
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,
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>
type Output = Array<BaseArray<VectorContainer<Item>, NDIM>, NDIM>
Source§fn cholesky_solve(
&self,
uplo: UpLo,
rhs: &Array<RhsArrayImpl, NDIM>,
) -> RlstResult<Self::Output>
fn cholesky_solve( &self, uplo: UpLo, rhs: &Array<RhsArrayImpl, NDIM>, ) -> RlstResult<Self::Output>
Source§impl<ArrayImpl1, ArrayImpl2, const NDIM: usize> Div<Array<ArrayImpl2, NDIM>> for Array<ArrayImpl1, NDIM>
impl<ArrayImpl1, ArrayImpl2, const NDIM: usize> Div<Array<ArrayImpl2, NDIM>> for Array<ArrayImpl1, NDIM>
Source§impl<Item, ArrayImpl1, ArrayImpl2, const NDIM: usize> DivAssign<Array<ArrayImpl2, NDIM>> for Array<ArrayImpl1, NDIM>where
ArrayImpl1: Shape<NDIM> + UnsafeDisjointRandom1DAccessMut<Item = Item>,
ArrayImpl2: Shape<NDIM> + UnsafeRandom1DAccessByValue<Item = Item>,
Item: DivAssign,
impl<Item, ArrayImpl1, ArrayImpl2, const NDIM: usize> DivAssign<Array<ArrayImpl2, NDIM>> for Array<ArrayImpl1, NDIM>where
ArrayImpl1: Shape<NDIM> + UnsafeDisjointRandom1DAccessMut<Item = Item>,
ArrayImpl2: Shape<NDIM> + UnsafeRandom1DAccessByValue<Item = Item>,
Item: DivAssign,
Source§fn div_assign(&mut self, rhs: Array<ArrayImpl2, NDIM>)
fn div_assign(&mut self, rhs: Array<ArrayImpl2, NDIM>)
/= operation. Read moreSource§impl<Item, ArrayImpl, const NDIM: usize> DivAssign<Item> for Array<ArrayImpl, NDIM>where
ArrayImpl: Shape<NDIM> + UnsafeDisjointRandom1DAccessMut<Item = Item>,
Item: DivAssign + Copy,
impl<Item, ArrayImpl, const NDIM: usize> DivAssign<Item> for Array<ArrayImpl, NDIM>where
ArrayImpl: Shape<NDIM> + UnsafeDisjointRandom1DAccessMut<Item = Item>,
Item: DivAssign + Copy,
Source§fn div_assign(&mut self, rhs: Item)
fn div_assign(&mut self, rhs: Item)
/= operation. Read moreSource§impl<Item, ArrayImpl> EigenvalueDecomposition for Array<ArrayImpl, 2>
impl<Item, ArrayImpl> EigenvalueDecomposition for Array<ArrayImpl, 2>
Source§fn eigenvalues(
&self,
) -> RlstResult<DynArray<<Self::Item as RlstScalar>::Complex, 1>>
fn eigenvalues( &self, ) -> RlstResult<DynArray<<Self::Item as RlstScalar>::Complex, 1>>
Return the eigenvalues of the matrix.
The eigenvalues are computed using the LAPACK ?gees routine.
§Errors
Returns an error if the matrix is not square or if the LAPACK routine fails.
Source§fn schur(
&self,
) -> RlstResult<(DynArray<Self::Item, 2>, DynArray<Self::Item, 2>)>
fn schur( &self, ) -> RlstResult<(DynArray<Self::Item, 2>, DynArray<Self::Item, 2>)>
Compute the Schur decomposition of the matrix.
The Schur decomposition of a square matrix A is given by A = Z * T * Z^H, where:
Tis a block-upper triangular matrix. Its diagonal blocks are 1x1 or 2x2 and encode the eigenvalues of the matrix.Zis a unitary matrix.
Returns a tuple (T, Z).
§Errors
Returns an error if the matrix is not square or if the LAPACK routine fails.
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>>)>
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.
The eigenvalues and eigenvectors are computed using the LAPACK ?geev routine.
§Arguments
mode: Specifies which eigenvectors to compute.
§Returns
A tuple (lam, vr, vl) containing:
lam: A vector of eigenvalues.vr: An optional matrix of right eigenvectors.vl: An optional matrix of left eigenvectors.
§Errors
Returns an error if the matrix is not square or if the LAPACK routine fails.
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,
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>
type OutputImpl = <<ArrayImpl as ContainerType>::Type as ArrayFromContainerType>::OutputImpl<Item, NDIM>
Source§fn eval(&self) -> Array<Self::OutputImpl, NDIM>
fn eval(&self) -> Array<Self::OutputImpl, NDIM>
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,
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>
type OutputImpl = <<ArrayImpl as ContainerType>::Type as RowMajorArrayFromContainerType>::OutputImpl<Item, NDIM>
Source§fn eval_row_major(&self) -> Array<Self::OutputImpl, NDIM>
fn eval_row_major(&self) -> Array<Self::OutputImpl, NDIM>
Source§impl<'a, ArrayImpl: BaseItem + Shape<2>> From<&'a Array<ArrayImpl, 2>> for Operator<ArrayOperator<'a, ArrayImpl>>where
ArrayOperator<'a, ArrayImpl>: OperatorBase,
impl<'a, ArrayImpl: BaseItem + Shape<2>> From<&'a Array<ArrayImpl, 2>> for Operator<ArrayOperator<'a, ArrayImpl>>where
ArrayOperator<'a, ArrayImpl>: OperatorBase,
Source§impl From<Array<ScalarArrayImpl<Complex<f32>>, 0>> for c32
impl From<Array<ScalarArrayImpl<Complex<f32>>, 0>> for c32
Source§fn from(value: ZeroDimArray<c32>) -> Self
fn from(value: ZeroDimArray<c32>) -> Self
Source§impl From<Array<ScalarArrayImpl<Complex<f64>>, 0>> for c64
impl From<Array<ScalarArrayImpl<Complex<f64>>, 0>> for c64
Source§fn from(value: ZeroDimArray<c64>) -> Self
fn from(value: ZeroDimArray<c64>) -> Self
Source§impl From<Array<ScalarArrayImpl<f32>, 0>> for f32
impl From<Array<ScalarArrayImpl<f32>, 0>> for f32
Source§fn from(value: ZeroDimArray<f32>) -> Self
fn from(value: ZeroDimArray<f32>) -> Self
Source§impl From<Array<ScalarArrayImpl<f64>, 0>> for f64
impl From<Array<ScalarArrayImpl<f64>, 0>> for f64
Source§fn from(value: ZeroDimArray<f64>) -> Self
fn from(value: ZeroDimArray<f64>) -> Self
Source§impl From<Array<ScalarArrayImpl<i8>, 0>> for i8
impl From<Array<ScalarArrayImpl<i8>, 0>> for i8
Source§fn from(value: ZeroDimArray<i8>) -> Self
fn from(value: ZeroDimArray<i8>) -> Self
Source§impl From<Array<ScalarArrayImpl<i16>, 0>> for i16
impl From<Array<ScalarArrayImpl<i16>, 0>> for i16
Source§fn from(value: ZeroDimArray<i16>) -> Self
fn from(value: ZeroDimArray<i16>) -> Self
Source§impl From<Array<ScalarArrayImpl<i32>, 0>> for i32
impl From<Array<ScalarArrayImpl<i32>, 0>> for i32
Source§fn from(value: ZeroDimArray<i32>) -> Self
fn from(value: ZeroDimArray<i32>) -> Self
Source§impl From<Array<ScalarArrayImpl<i64>, 0>> for i64
impl From<Array<ScalarArrayImpl<i64>, 0>> for i64
Source§fn from(value: ZeroDimArray<i64>) -> Self
fn from(value: ZeroDimArray<i64>) -> Self
Source§impl From<Array<ScalarArrayImpl<i128>, 0>> for i128
impl From<Array<ScalarArrayImpl<i128>, 0>> for i128
Source§fn from(value: ZeroDimArray<i128>) -> Self
fn from(value: ZeroDimArray<i128>) -> Self
Source§impl From<Array<ScalarArrayImpl<isize>, 0>> for isize
impl From<Array<ScalarArrayImpl<isize>, 0>> for isize
Source§fn from(value: ZeroDimArray<isize>) -> Self
fn from(value: ZeroDimArray<isize>) -> Self
Source§impl From<Array<ScalarArrayImpl<u8>, 0>> for u8
impl From<Array<ScalarArrayImpl<u8>, 0>> for u8
Source§fn from(value: ZeroDimArray<u8>) -> Self
fn from(value: ZeroDimArray<u8>) -> Self
Source§impl From<Array<ScalarArrayImpl<u16>, 0>> for u16
impl From<Array<ScalarArrayImpl<u16>, 0>> for u16
Source§fn from(value: ZeroDimArray<u16>) -> Self
fn from(value: ZeroDimArray<u16>) -> Self
Source§impl From<Array<ScalarArrayImpl<u32>, 0>> for u32
impl From<Array<ScalarArrayImpl<u32>, 0>> for u32
Source§fn from(value: ZeroDimArray<u32>) -> Self
fn from(value: ZeroDimArray<u32>) -> Self
Source§impl From<Array<ScalarArrayImpl<u64>, 0>> for u64
impl From<Array<ScalarArrayImpl<u64>, 0>> for u64
Source§fn from(value: ZeroDimArray<u64>) -> Self
fn from(value: ZeroDimArray<u64>) -> Self
Source§impl From<Array<ScalarArrayImpl<u128>, 0>> for u128
impl From<Array<ScalarArrayImpl<u128>, 0>> for u128
Source§fn from(value: ZeroDimArray<u128>) -> Self
fn from(value: ZeroDimArray<u128>) -> Self
Source§impl From<Array<ScalarArrayImpl<usize>, 0>> for usize
impl From<Array<ScalarArrayImpl<usize>, 0>> for usize
Source§fn from(value: ZeroDimArray<usize>) -> Self
fn from(value: ZeroDimArray<usize>) -> Self
Source§impl<Item, ArrayImpl, BArrayImpl> GeneralizedEigenvalueDecomposition<Array<BArrayImpl, 2>> for Array<ArrayImpl, 2>where
ArrayImpl: UnsafeRandom1DAccessByValue<Item = Item> + Shape<2>,
BArrayImpl: UnsafeRandom1DAccessByValue<Item = Item> + Shape<2>,
Item: Lapack,
impl<Item, ArrayImpl, BArrayImpl> GeneralizedEigenvalueDecomposition<Array<BArrayImpl, 2>> for Array<ArrayImpl, 2>where
ArrayImpl: UnsafeRandom1DAccessByValue<Item = Item> + Shape<2>,
BArrayImpl: UnsafeRandom1DAccessByValue<Item = Item> + Shape<2>,
Item: Lapack,
Source§fn eig_generalized(
&self,
b: &Array<BArrayImpl, 2>,
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>>)>
fn eig_generalized( &self, b: &Array<BArrayImpl, 2>, 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>>)>
(A, B). Read moreSource§fn eigenvalues_generalized(
&self,
b: &B,
) -> RlstResult<DynArray<<Self::Item as RlstScalar>::Complex, 1>>
fn eigenvalues_generalized( &self, b: &B, ) -> RlstResult<DynArray<<Self::Item as RlstScalar>::Complex, 1>>
(A, B) in unspecified order. Read moreSource§impl<Item, ArrayImpl, BArrayImpl> GeneralizedSchur<Array<BArrayImpl, 2>> for Array<ArrayImpl, 2>where
Item: Lapack,
ArrayImpl: UnsafeRandom1DAccessByValue<Item = Item> + Shape<2>,
BArrayImpl: UnsafeRandom1DAccessByValue<Item = Item> + Shape<2>,
impl<Item, ArrayImpl, BArrayImpl> GeneralizedSchur<Array<BArrayImpl, 2>> for Array<ArrayImpl, 2>where
Item: Lapack,
ArrayImpl: UnsafeRandom1DAccessByValue<Item = Item> + Shape<2>,
BArrayImpl: UnsafeRandom1DAccessByValue<Item = Item> + Shape<2>,
Source§fn qz(&self, b: &Array<BArrayImpl, 2>) -> RlstResult<QzDecomposition<Item>>
fn qz(&self, b: &Array<BArrayImpl, 2>) -> RlstResult<QzDecomposition<Item>>
Source§impl<Item, ArrayImpl, BArrayImpl> GeneralizedSymmEig<Array<BArrayImpl, 2>> for Array<ArrayImpl, 2>where
ArrayImpl: UnsafeRandom1DAccessByValue<Item = Item> + Shape<2>,
BArrayImpl: UnsafeRandom1DAccessByValue<Item = Item> + Shape<2>,
Item: Lapack,
impl<Item, ArrayImpl, BArrayImpl> GeneralizedSymmEig<Array<BArrayImpl, 2>> for Array<ArrayImpl, 2>where
ArrayImpl: UnsafeRandom1DAccessByValue<Item = Item> + Shape<2>,
BArrayImpl: UnsafeRandom1DAccessByValue<Item = Item> + Shape<2>,
Item: Lapack,
Source§fn eigh_generalized(
&self,
b: &Array<BArrayImpl, 2>,
uplo: UpLo,
mode: SymmEigMode,
itype: GeneralizedSymmEigType,
) -> RlstResult<(DynArray<<Self::Item as RlstScalar>::Real, 1>, Option<DynArray<Self::Item, 2>>)>
fn eigh_generalized( &self, b: &Array<BArrayImpl, 2>, uplo: UpLo, mode: SymmEigMode, itype: GeneralizedSymmEigType, ) -> RlstResult<(DynArray<<Self::Item as RlstScalar>::Real, 1>, Option<DynArray<Self::Item, 2>>)>
Source§fn eigenvaluesh_generalized(
&self,
b: &B,
uplo: UpLo,
itype: GeneralizedSymmEigType,
) -> RlstResult<DynArray<<Self::Item as RlstScalar>::Real, 1>>
fn eigenvaluesh_generalized( &self, b: &B, uplo: UpLo, itype: GeneralizedSymmEigType, ) -> RlstResult<DynArray<<Self::Item as RlstScalar>::Real, 1>>
Source§impl<ArrayImpl, const NDIM: usize> Index<[usize; NDIM]> for Array<ArrayImpl, NDIM>where
ArrayImpl: RandomAccessByRef<NDIM>,
impl<ArrayImpl, const NDIM: usize> Index<[usize; NDIM]> for Array<ArrayImpl, NDIM>where
ArrayImpl: RandomAccessByRef<NDIM>,
Source§impl<Item, ArrayImpl> Ldl for Array<ArrayImpl, 2>
impl<Item, ArrayImpl> Ldl for Array<ArrayImpl, 2>
Source§fn ldl(&self, uplo: UpLo) -> RlstResult<LdlDecomposition<Item>>
fn ldl(&self, uplo: UpLo) -> RlstResult<LdlDecomposition<Item>>
Source§impl<ArrayImpl> Linspace<f32> for Array<ArrayImpl, 1>where
ArrayImpl: MutableArrayImpl<f32, 1>,
impl<ArrayImpl> Linspace<f32> for Array<ArrayImpl, 1>where
ArrayImpl: MutableArrayImpl<f32, 1>,
Source§impl<ArrayImpl> Linspace<f64> for Array<ArrayImpl, 1>where
ArrayImpl: MutableArrayImpl<f64, 1>,
impl<ArrayImpl> Linspace<f64> for Array<ArrayImpl, 1>where
ArrayImpl: MutableArrayImpl<f64, 1>,
Source§impl<Item, ArrayImpl> Lq for Array<ArrayImpl, 2>
impl<Item, ArrayImpl> Lq for Array<ArrayImpl, 2>
Source§fn lq(&self) -> RlstResult<LqDecomposition<Item>>
fn lq(&self) -> RlstResult<LqDecomposition<Item>>
A = L Q. Read moreSource§impl<Item, ArrayImpl> Lu for Array<ArrayImpl, 2>
impl<Item, ArrayImpl> Lu for Array<ArrayImpl, 2>
Source§fn lu(&self) -> RlstResult<LuDecomposition<Item>>
fn lu(&self) -> RlstResult<LuDecomposition<Item>>
Source§impl<ArrayImpl1, ArrayImpl2, const NDIM: usize> Mul<Array<ArrayImpl2, NDIM>> for Array<ArrayImpl1, NDIM>
impl<ArrayImpl1, ArrayImpl2, const NDIM: usize> Mul<Array<ArrayImpl2, NDIM>> for Array<ArrayImpl1, NDIM>
Source§impl<Item, ArrayImpl1, ArrayImpl2, const NDIM: usize> MulAdd<Item, Array<ArrayImpl2, NDIM>> for Array<ArrayImpl1, NDIM>
impl<Item, ArrayImpl1, ArrayImpl2, const NDIM: usize> MulAdd<Item, Array<ArrayImpl2, NDIM>> for Array<ArrayImpl1, NDIM>
Source§fn mul_add(
self,
a: Item,
b: Array<ArrayImpl2, NDIM>,
) -> Array<MulAddImpl<ArrayImpl1, ArrayImpl2, Item, NDIM>, NDIM>
fn mul_add( self, a: Item, b: Array<ArrayImpl2, NDIM>, ) -> Array<MulAddImpl<ArrayImpl1, ArrayImpl2, Item, NDIM>, NDIM>
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>
type Output = Array<MulAddImpl<ArrayImpl1, ArrayImpl2, Item, NDIM>, NDIM>
Source§impl<Item, ArrayImpl1, ArrayImpl2, const NDIM: usize> MulAssign<Array<ArrayImpl2, NDIM>> for Array<ArrayImpl1, NDIM>where
ArrayImpl1: Shape<NDIM> + UnsafeDisjointRandom1DAccessMut<Item = Item>,
ArrayImpl2: Shape<NDIM> + UnsafeRandom1DAccessByValue<Item = Item>,
Item: MulAssign,
impl<Item, ArrayImpl1, ArrayImpl2, const NDIM: usize> MulAssign<Array<ArrayImpl2, NDIM>> for Array<ArrayImpl1, NDIM>where
ArrayImpl1: Shape<NDIM> + UnsafeDisjointRandom1DAccessMut<Item = Item>,
ArrayImpl2: Shape<NDIM> + UnsafeRandom1DAccessByValue<Item = Item>,
Item: MulAssign,
Source§fn mul_assign(&mut self, rhs: Array<ArrayImpl2, NDIM>)
fn mul_assign(&mut self, rhs: Array<ArrayImpl2, NDIM>)
*= operation. Read moreSource§impl<Item, ArrayImpl, const NDIM: usize> MulAssign<Item> for Array<ArrayImpl, NDIM>where
ArrayImpl: Shape<NDIM> + UnsafeDisjointRandom1DAccessMut<Item = Item>,
Item: MulAssign + Copy,
impl<Item, ArrayImpl, const NDIM: usize> MulAssign<Item> for Array<ArrayImpl, NDIM>where
ArrayImpl: Shape<NDIM> + UnsafeDisjointRandom1DAccessMut<Item = Item>,
Item: MulAssign + Copy,
Source§fn mul_assign(&mut self, rhs: Item)
fn mul_assign(&mut self, rhs: Item)
*= operation. Read moreSource§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>
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§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>
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§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>
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§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>
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§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>
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§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>
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§impl<ArrayImpl: RandomAccessByValue<2, Item = c32> + Shape<2>> PrettyPrint<Complex<f32>> for Array<ArrayImpl, 2>
impl<ArrayImpl: RandomAccessByValue<2, Item = c32> + Shape<2>> PrettyPrint<Complex<f32>> for Array<ArrayImpl, 2>
Source§fn pretty_print(&self)
fn pretty_print(&self)
Source§fn pretty_print_with_dimension(&self, rows: usize, cols: usize)
fn pretty_print_with_dimension(&self, rows: usize, cols: usize)
Source§impl<ArrayImpl: RandomAccessByValue<2, Item = c64> + Shape<2>> PrettyPrint<Complex<f64>> for Array<ArrayImpl, 2>
impl<ArrayImpl: RandomAccessByValue<2, Item = c64> + Shape<2>> PrettyPrint<Complex<f64>> for Array<ArrayImpl, 2>
Source§fn pretty_print(&self)
fn pretty_print(&self)
Source§fn pretty_print_with_dimension(&self, rows: usize, cols: usize)
fn pretty_print_with_dimension(&self, rows: usize, cols: usize)
Source§impl<ArrayImpl: RandomAccessByValue<2, Item = f32> + Shape<2>> PrettyPrint<f32> for Array<ArrayImpl, 2>
impl<ArrayImpl: RandomAccessByValue<2, Item = f32> + Shape<2>> PrettyPrint<f32> for Array<ArrayImpl, 2>
Source§fn pretty_print(&self)
fn pretty_print(&self)
Source§fn pretty_print_with_dimension(&self, rows: usize, cols: usize)
fn pretty_print_with_dimension(&self, rows: usize, cols: usize)
Source§impl<ArrayImpl: RandomAccessByValue<2, Item = f64> + Shape<2>> PrettyPrint<f64> for Array<ArrayImpl, 2>
impl<ArrayImpl: RandomAccessByValue<2, Item = f64> + Shape<2>> PrettyPrint<f64> for Array<ArrayImpl, 2>
Source§fn pretty_print(&self)
fn pretty_print(&self)
Source§fn pretty_print_with_dimension(&self, rows: usize, cols: usize)
fn pretty_print_with_dimension(&self, rows: usize, cols: usize)
Source§impl<Item, ArrayImpl> Qr for Array<ArrayImpl, 2>
impl<Item, ArrayImpl> Qr for Array<ArrayImpl, 2>
Source§fn qr(&self, pivoting: EnablePivoting) -> RlstResult<QrDecomposition<Item>>
fn qr(&self, pivoting: EnablePivoting) -> RlstResult<QrDecomposition<Item>>
Compute the QR decomposition of a matrix.
Source§impl<Item, ArrayImpl> SingularValueDecomposition for Array<ArrayImpl, 2>
impl<Item, ArrayImpl> SingularValueDecomposition for Array<ArrayImpl, 2>
Source§fn singular_values(
&self,
) -> RlstResult<DynArray<<Self::Item as RlstScalar>::Real, 1>>
fn singular_values( &self, ) -> RlstResult<DynArray<<Self::Item as RlstScalar>::Real, 1>>
Source§fn svd(
&self,
mode: SvdMode,
) -> RlstResult<(DynArray<<Self::Item as RlstScalar>::Real, 1>, DynArray<Self::Item, 2>, DynArray<Self::Item, 2>)>
fn svd( &self, mode: SvdMode, ) -> RlstResult<(DynArray<<Self::Item as RlstScalar>::Real, 1>, DynArray<Self::Item, 2>, DynArray<Self::Item, 2>)>
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>)>
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>)>
Source§fn pseudo_inverse(
&self,
max_singular_values: Option<usize>,
tol: Option<<Self::Item as RlstScalar>::Real>,
) -> RlstResult<PInv<Self::Item>>
fn pseudo_inverse( &self, max_singular_values: Option<usize>, tol: Option<<Self::Item as RlstScalar>::Real>, ) -> RlstResult<PInv<Self::Item>>
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>,
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§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>,
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>
type Output = Array<BaseArray<VectorContainer<Item>, NDIM>, NDIM>
Source§fn solve_triangular(
&self,
uplo: UpLo,
rhs: &Array<RhsArrayImpl, NDIM>,
) -> RlstResult<Self::Output>
fn solve_triangular( &self, uplo: UpLo, rhs: &Array<RhsArrayImpl, NDIM>, ) -> RlstResult<Self::Output>
uplo. Read moreSource§impl<ArrayImpl1, ArrayImpl2, const NDIM: usize> Sub<Array<ArrayImpl2, NDIM>> for Array<ArrayImpl1, NDIM>
impl<ArrayImpl1, ArrayImpl2, const NDIM: usize> Sub<Array<ArrayImpl2, NDIM>> for Array<ArrayImpl1, NDIM>
Source§impl<Item, ArrayImpl1, ArrayImpl2, const NDIM: usize> SubAssign<Array<ArrayImpl2, NDIM>> for Array<ArrayImpl1, NDIM>where
ArrayImpl1: Shape<NDIM> + UnsafeDisjointRandom1DAccessMut<Item = Item>,
ArrayImpl2: Shape<NDIM> + UnsafeRandom1DAccessByValue<Item = Item>,
Item: SubAssign,
impl<Item, ArrayImpl1, ArrayImpl2, const NDIM: usize> SubAssign<Array<ArrayImpl2, NDIM>> for Array<ArrayImpl1, NDIM>where
ArrayImpl1: Shape<NDIM> + UnsafeDisjointRandom1DAccessMut<Item = Item>,
ArrayImpl2: Shape<NDIM> + UnsafeRandom1DAccessByValue<Item = Item>,
Item: SubAssign,
Source§fn sub_assign(&mut self, rhs: Array<ArrayImpl2, NDIM>)
fn sub_assign(&mut self, rhs: Array<ArrayImpl2, NDIM>)
-= operation. Read moreSource§impl<Item, AImpl, BImpl, CImpl> SylvesterSolve<Array<BImpl, 2>, Array<CImpl, 2>> for Array<AImpl, 2>where
Item: Lapack + Gemm,
AImpl: UnsafeRandom1DAccessByValue<Item = Item> + Shape<2>,
BImpl: UnsafeRandom1DAccessByValue<Item = Item> + Shape<2>,
CImpl: UnsafeRandom1DAccessByValue<Item = Item> + Shape<2>,
impl<Item, AImpl, BImpl, CImpl> SylvesterSolve<Array<BImpl, 2>, Array<CImpl, 2>> for Array<AImpl, 2>where
Item: Lapack + Gemm,
AImpl: UnsafeRandom1DAccessByValue<Item = Item> + Shape<2>,
BImpl: UnsafeRandom1DAccessByValue<Item = Item> + Shape<2>,
CImpl: UnsafeRandom1DAccessByValue<Item = Item> + Shape<2>,
Source§fn solve_sylvester(
&self,
b: &Array<BImpl, 2>,
c: &Array<CImpl, 2>,
sign: TrsylSign,
) -> RlstResult<SylvesterSolution<Item>>
fn solve_sylvester( &self, b: &Array<BImpl, 2>, c: &Array<CImpl, 2>, sign: TrsylSign, ) -> RlstResult<SylvesterSolution<Item>>
A X + sign X B = scale C without automatically unscaling X. Read moreSource§impl<Item, ArrayImpl> SymmEig for Array<ArrayImpl, 2>
impl<Item, ArrayImpl> SymmEig for Array<ArrayImpl, 2>
Source§fn eigh(
&self,
uplo: UpLo,
mode: SymmEigMode,
) -> RlstResult<(DynArray<Item::Real, 1>, Option<DynArray<Item, 2>>)>
fn eigh( &self, uplo: UpLo, mode: SymmEigMode, ) -> RlstResult<(DynArray<Item::Real, 1>, Option<DynArray<Item, 2>>)>
Source§fn eigenvaluesh(
&self,
) -> RlstResult<DynArray<<Self::Item as RlstScalar>::Real, 1>>
fn eigenvaluesh( &self, ) -> RlstResult<DynArray<<Self::Item as RlstScalar>::Real, 1>>
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> UnsafeUnpin for Array<ArrayImpl, NDIM>where
ArrayImpl: UnsafeUnpin,
impl<ArrayImpl, const NDIM: usize> UnwindSafe for Array<ArrayImpl, NDIM>where
ArrayImpl: 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T, U> Imply<T> for U
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> ⓘ
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> ⓘ
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