pub struct CsMatBase<N, I, IptrStorage, IndStorage, DataStorage, Iptr = I>where
I: SpIndex,
Iptr: SpIndex,
IptrStorage: Deref<Target = [Iptr]>,
IndStorage: Deref<Target = [I]>,
DataStorage: Deref<Target = [N]>,{ /* private fields */ }
Expand description
Compressed matrix in the CSR or CSC format, with sorted indices.
This sparse matrix format is the preferred format for performing arithmetic operations. Constructing a sparse matrix directly in this format requires a deep knowledge of its internals. For easier matrix construction, the triplet format is preferred.
The CsMatBase
type is parameterized by the scalar type N
, the indexing
type I
, the indexing storage backend types IptrStorage
and IndStorage
,
and the value storage backend type DataStorage
. Convenient aliases are
available to specify frequent variants: CsMat
refers to a sparse matrix
that owns its data, similar to Vec<T>
; CsMatView
refers to a sparse matrix
that borrows its data, similar to & [T]
; and CsMatViewMut
refers to a sparse
matrix borrowing its data, with a mutable borrow for its values. No mutable
borrow is allowed for the structure of the matrix, allowing the invariants
to be preserved.
Additionaly, the type aliases CsMatI
, CsMatViewI
and
CsMatViewMutI
can be used to choose an index type different from the
default usize
.
Storage format
In the compressed storage format, the non-zero values of a sparse matrix are stored as the row and column location of the non-zero values, with a compression along the rows (CSR) or columns (CSC) indices. The dimension along which the storage is compressed is referred to as the outer dimension, the other dimension is called the inner dimension. For clarity, the remaining explanation will assume a CSR matrix, but the information stands for CSC matrices as well.
Indptr
An index pointer array indptr
of size corresponding to the number of rows
stores the cumulative sum of non-zero elements for each row. For instance,
the number of non-zero elements of the i-th row can be obtained by computing
indptr[i + 1] - indptr[i]
. The total number of non-zero elements is thus
nnz = indptr[nb_rows + 1]
. This index pointer array can then be used to
efficiently index the indices
and data
array, which respectively contain
the column indices and the values of the non-zero elements.
Indices and data
The non-zero locations and values are stored in arrays of size nnz
, indices
and data
. For row i
, the non-zeros are located in the slices
indices[indptr[i]..indptr[i+1]]
and data[indptr[i]..indptr[i+1]]
. We
require and enforce sorted indices for each row.
Construction
A sparse matrix can be directly constructed by providing its index pointer, indices and data arrays. The coherence of the provided structure is then verified.
For situations where the compressed structure is hard to figure out up front,
the triplet format can be used. A matrix in the
triplet format can then be efficiently converted to a CsMat
.
Alternately, a sparse matrix can be constructed from other sparse matrices
using vstack
, hstack
or bmat
.
Implementations§
source§impl<N, I: SpIndex, Iptr: SpIndex, IptrStorage, IStorage, DStorage> CsMatBase<N, I, IptrStorage, IStorage, DStorage, Iptr>where
IptrStorage: Deref<Target = [Iptr]>,
IStorage: Deref<Target = [I]>,
DStorage: Deref<Target = [N]>,
impl<N, I: SpIndex, Iptr: SpIndex, IptrStorage, IStorage, DStorage> CsMatBase<N, I, IptrStorage, IStorage, DStorage, Iptr>where IptrStorage: Deref<Target = [Iptr]>, IStorage: Deref<Target = [I]>, DStorage: Deref<Target = [N]>,
sourcepub fn new(
shape: (usize, usize),
indptr: IptrStorage,
indices: IStorage,
data: DStorage
) -> Self
pub fn new( shape: (usize, usize), indptr: IptrStorage, indices: IStorage, data: DStorage ) -> Self
Create a new CSR
sparse matrix
See new_csc
for the CSC
equivalent
This constructor can be used to construct all sparse matrix types. By using the type aliases one helps constrain the resulting type, as shown below
Example
// This creates an owned matrix
let owned_matrix = CsMat::new((2, 2), vec![0, 1, 1], vec![1], vec![4_u8]);
// This creates a matrix which only borrows the elements
let borrow_matrix = CsMatView::new((2, 2), &[0, 1, 1], &[1], &[4_u8]);
// A combination of storage types may also be used for a
// general sparse matrix
let mixed_matrix = CsMatBase::new((2, 2), &[0, 1, 1] as &[_], vec![1_i64].into_boxed_slice(), vec![4_u8]);
sourcepub fn new_csc(
shape: (usize, usize),
indptr: IptrStorage,
indices: IStorage,
data: DStorage
) -> Self
pub fn new_csc( shape: (usize, usize), indptr: IptrStorage, indices: IStorage, data: DStorage ) -> Self
Create a new CSC
sparse matrix
See new
for the CSR
equivalent
sourcepub fn try_new(
shape: (usize, usize),
indptr: IptrStorage,
indices: IStorage,
data: DStorage
) -> Result<Self, (IptrStorage, IStorage, DStorage, StructureError)>
pub fn try_new( shape: (usize, usize), indptr: IptrStorage, indices: IStorage, data: DStorage ) -> Result<Self, (IptrStorage, IStorage, DStorage, StructureError)>
Try to create a new CSR
sparse matrix
See try_new_csc
for the CSC
equivalent
sourcepub fn try_new_csc(
shape: (usize, usize),
indptr: IptrStorage,
indices: IStorage,
data: DStorage
) -> Result<Self, (IptrStorage, IStorage, DStorage, StructureError)>
pub fn try_new_csc( shape: (usize, usize), indptr: IptrStorage, indices: IStorage, data: DStorage ) -> Result<Self, (IptrStorage, IStorage, DStorage, StructureError)>
Try to create a new CSC
sparse matrix
See new
for the CSR
equivalent
sourcepub unsafe fn new_unchecked(
storage: CompressedStorage,
shape: Shape,
indptr: IptrStorage,
indices: IStorage,
data: DStorage
) -> Self
pub unsafe fn new_unchecked( storage: CompressedStorage, shape: Shape, indptr: IptrStorage, indices: IStorage, data: DStorage ) -> Self
Create a CsMat
matrix from raw data,
without checking their validity
Safety
This is unsafe because algorithms are free to assume
that properties guaranteed by
check_compressed_structure
are enforced.
For instance, non out-of-bounds indices can be relied upon to
perform unchecked slice access.
source§impl<N, I: SpIndex, Iptr: SpIndex, IptrStorage, IStorage, DStorage> CsMatBase<N, I, IptrStorage, IStorage, DStorage, Iptr>where
IptrStorage: Deref<Target = [Iptr]>,
IStorage: DerefMut<Target = [I]>,
DStorage: DerefMut<Target = [N]>,
impl<N, I: SpIndex, Iptr: SpIndex, IptrStorage, IStorage, DStorage> CsMatBase<N, I, IptrStorage, IStorage, DStorage, Iptr>where IptrStorage: Deref<Target = [Iptr]>, IStorage: DerefMut<Target = [I]>, DStorage: DerefMut<Target = [N]>,
sourcepub fn new_from_unsorted(
shape: Shape,
indptr: IptrStorage,
indices: IStorage,
data: DStorage
) -> Result<Self, (IptrStorage, IStorage, DStorage, StructureError)>where
N: Clone,
pub fn new_from_unsorted( shape: Shape, indptr: IptrStorage, indices: IStorage, data: DStorage ) -> Result<Self, (IptrStorage, IStorage, DStorage, StructureError)>where N: Clone,
Try create a CSR
matrix which acts as an owner of its data.
A CSC
matrix can be created with new_from_unsorted_csc()
.
If necessary, the indices will be sorted in place.
sourcepub fn new_from_unsorted_csc(
shape: Shape,
indptr: IptrStorage,
indices: IStorage,
data: DStorage
) -> Result<Self, (IptrStorage, IStorage, DStorage, StructureError)>where
N: Clone,
pub fn new_from_unsorted_csc( shape: Shape, indptr: IptrStorage, indices: IStorage, data: DStorage ) -> Result<Self, (IptrStorage, IStorage, DStorage, StructureError)>where N: Clone,
Try create a CSC
matrix which acts as an owner of its data.
A CSR
matrix can be created with new_from_unsorted_csr()
.
If necessary, the indices will be sorted in place.
source§impl<N, I: SpIndex, Iptr: SpIndex> CsMatBase<N, I, Vec<Iptr, Global>, Vec<I, Global>, Vec<N, Global>, Iptr>
impl<N, I: SpIndex, Iptr: SpIndex> CsMatBase<N, I, Vec<Iptr, Global>, Vec<I, Global>, Vec<N, Global>, Iptr>
sourcepub fn eye(dim: usize) -> Selfwhere
N: Num + Clone,
pub fn eye(dim: usize) -> Selfwhere N: Num + Clone,
Identity matrix, stored as a CSR matrix.
use sprs::{CsMat, CsVec};
let eye = CsMat::eye(5);
assert!(eye.is_csr());
let x = CsVec::new(5, vec![0, 2, 4], vec![1., 2., 3.]);
let y = &eye * &x;
assert_eq!(x, y);
sourcepub fn eye_csc(dim: usize) -> Selfwhere
N: Num + Clone,
pub fn eye_csc(dim: usize) -> Selfwhere N: Num + Clone,
Identity matrix, stored as a CSC matrix.
use sprs::{CsMat, CsVec};
let eye = CsMat::eye_csc(5);
assert!(eye.is_csc());
let x = CsVec::new(5, vec![0, 2, 4], vec![1., 2., 3.]);
let y = &eye * &x;
assert_eq!(x, y);
sourcepub fn empty(storage: CompressedStorage, inner_size: usize) -> Self
pub fn empty(storage: CompressedStorage, inner_size: usize) -> Self
Create an empty CsMat
for building purposes
sourcepub fn zero(shape: Shape) -> Self
pub fn zero(shape: Shape) -> Self
Create a new CsMat
representing the zero matrix.
Hence it has no non-zero elements.
sourcepub fn reserve_outer_dim(&mut self, outer_dim_additional: usize)
pub fn reserve_outer_dim(&mut self, outer_dim_additional: usize)
Reserve the storage for the given additional number of nonzero data
sourcepub fn reserve_nnz(&mut self, nnz_additional: usize)
pub fn reserve_nnz(&mut self, nnz_additional: usize)
Reserve the storage for the given additional number of nonzero data
sourcepub fn reserve_outer_dim_exact(&mut self, outer_dim_lim: usize)
pub fn reserve_outer_dim_exact(&mut self, outer_dim_lim: usize)
Reserve the storage for the given number of nonzero data
sourcepub fn reserve_nnz_exact(&mut self, nnz_lim: usize)
pub fn reserve_nnz_exact(&mut self, nnz_lim: usize)
Reserve the storage for the given number of nonzero data
sourcepub fn csr_from_dense(m: ArrayView<'_, N, Ix2>, epsilon: N) -> Selfwhere
N: Num + Clone + PartialOrd + Signed,
pub fn csr_from_dense(m: ArrayView<'_, N, Ix2>, epsilon: N) -> Selfwhere N: Num + Clone + PartialOrd + Signed,
Create a CSR matrix from a dense matrix, ignoring elements lower than epsilon
.
If epsilon is negative, it will be clamped to zero.
sourcepub fn csc_from_dense(m: ArrayView<'_, N, Ix2>, epsilon: N) -> Selfwhere
N: Num + Clone + PartialOrd + Signed,
pub fn csc_from_dense(m: ArrayView<'_, N, Ix2>, epsilon: N) -> Selfwhere N: Num + Clone + PartialOrd + Signed,
Create a CSC matrix from a dense matrix, ignoring elements lower than epsilon
.
If epsilon is negative, it will be clamped to zero.
sourcepub fn append_outer(self, data: &[N]) -> Selfwhere
N: Clone + Zero,
pub fn append_outer(self, data: &[N]) -> Selfwhere N: Clone + Zero,
Append an outer dim to an existing matrix, compressing it in the process
sourcepub fn append_outer_iter<Iter>(self, iter: Iter) -> Selfwhere
N: Zero,
Iter: Iterator<Item = (usize, N)>,
pub fn append_outer_iter<Iter>(self, iter: Iter) -> Selfwhere N: Zero, Iter: Iterator<Item = (usize, N)>,
Append an outer dim to an existing matrix, increasing the size along the outer dimension by one.
Panics
if the iterator index is not monotonically increasing
sourcepub unsafe fn append_outer_iter_unchecked<Iter>(self, iter: Iter) -> Selfwhere
Iter: Iterator<Item = (usize, N)>,
pub unsafe fn append_outer_iter_unchecked<Iter>(self, iter: Iter) -> Selfwhere Iter: Iterator<Item = (usize, N)>,
Append an outer dim to an existing matrix, increasing the size along the outer dimension by one.
Safety
This is unsafe since indices for each inner dim should be monotonically increasing
which is not checked. The data values are additionally not checked for zero.
See append_outer_iter
for the checked version
sourcepub fn append_outer_csvec(self, vec: CsVecViewI<'_, N, I>) -> Selfwhere
N: Clone,
pub fn append_outer_csvec(self, vec: CsVecViewI<'_, N, I>) -> Selfwhere N: Clone,
Append an outer dim to an existing matrix, provided by a sparse vector
sourcepub fn insert(&mut self, row: usize, col: usize, val: N)
pub fn insert(&mut self, row: usize, col: usize, val: N)
Insert an element in the matrix. If the element is already present, its value is overwritten.
Warning: this is not an efficient operation, as it requires
a non-constant lookup followed by two Vec
insertions.
The insertion will be efficient, however, if the elements are inserted according to the matrix’s order, eg following the row order for a CSR matrix.
source§impl<'a, N: 'a, I: 'a + SpIndex, Iptr: 'a + SpIndex> CsMatBase<N, I, &'a [Iptr], &'a [I], &'a [N], Iptr>
impl<'a, N: 'a, I: 'a + SpIndex, Iptr: 'a + SpIndex> CsMatBase<N, I, &'a [Iptr], &'a [I], &'a [N], Iptr>
Constructor methods for sparse matrix views
These constructors can be used to create views over non-matrix data such as slices.
sourcepub fn middle_outer_views(
&self,
i: usize,
count: usize
) -> CsMatViewI<'a, N, I, Iptr>
👎Deprecated since 0.10.0: Please use the slice_outer
method instead
pub fn middle_outer_views( &self, i: usize, count: usize ) -> CsMatViewI<'a, N, I, Iptr>
slice_outer
method insteadGet a view into count contiguous outer dimensions, starting from i.
eg this gets the rows from i to i + count in a CSR matrix
This function is now deprecated, as using an index and a count is not
ergonomic. The replacement, slice_outer
, leverages the
std::ops::Range
family of types, which is better integrated into the
ecosystem.
source§impl<N, I, Iptr, IptrStorage, IndStorage, DataStorage> CsMatBase<N, I, IptrStorage, IndStorage, DataStorage, Iptr>where
I: SpIndex,
Iptr: SpIndex,
IptrStorage: Deref<Target = [Iptr]>,
IndStorage: Deref<Target = [I]>,
DataStorage: Deref<Target = [N]>,
impl<N, I, Iptr, IptrStorage, IndStorage, DataStorage> CsMatBase<N, I, IptrStorage, IndStorage, DataStorage, Iptr>where I: SpIndex, Iptr: SpIndex, IptrStorage: Deref<Target = [Iptr]>, IndStorage: Deref<Target = [I]>, DataStorage: Deref<Target = [N]>,
sourcepub fn storage(&self) -> CompressedStorage
pub fn storage(&self) -> CompressedStorage
The underlying storage of this matrix
sourcepub fn shape(&self) -> Shape
pub fn shape(&self) -> Shape
The shape of the matrix.
Equivalent to let shape = (a.rows(), a.cols())
.
sourcepub fn nnz(&self) -> usize
pub fn nnz(&self) -> usize
The number of non-zero elements this matrix stores. This is often relevant for the complexity of most sparse matrix algorithms, which are often linear in the number of non-zeros.
sourcepub fn density(&self) -> f64
pub fn density(&self) -> f64
The density of the sparse matrix, defined as the number of non-zero elements divided by the maximum number of elements
sourcepub fn outer_dims(&self) -> usize
pub fn outer_dims(&self) -> usize
Number of outer dimensions, that ie equal to self.rows() for a CSR matrix, and equal to self.cols() for a CSC matrix
sourcepub fn inner_dims(&self) -> usize
pub fn inner_dims(&self) -> usize
Number of inner dimensions, that ie equal to self.cols() for a CSR matrix, and equal to self.rows() for a CSC matrix
sourcepub fn get(&self, i: usize, j: usize) -> Option<&N>
pub fn get(&self, i: usize, j: usize) -> Option<&N>
Access the element located at row i and column j. Will return None if there is no non-zero element at this location.
This access is logarithmic in the number of non-zeros
in the corresponding outer slice. It is therefore advisable not to rely
on this for algorithms, and prefer outer_iterator
which accesses elements in storage order.
sourcepub fn indptr(&self) -> IndPtrView<'_, Iptr>
pub fn indptr(&self) -> IndPtrView<'_, Iptr>
The array of offsets in the indices() and data() slices. The elements of the slice at outer dimension i are available between the elements indptr[i] and indptr[i+1] in the indices() and data() slices.
Example
use sprs::{CsMat};
let eye : CsMat<f64> = CsMat::eye(5);
// get the element of row 3
// there is only one element in this row, with a column index of 3
// and a value of 1.
let range = eye.indptr().outer_inds_sz(3);
assert_eq!(range.start, 3);
assert_eq!(range.end, 4);
assert_eq!(eye.indices()[range.start], 3);
assert_eq!(eye.data()[range.start], 1.);
sourcepub fn proper_indptr(&self) -> Cow<'_, [Iptr]>
pub fn proper_indptr(&self) -> Cow<'_, [Iptr]>
Get an indptr representation suitable for ffi, cloning if necessary to get a compatible representation.
Warning
For ffi usage, one needs to call Cow::as_ptr
, but it’s important
to keep the Cow
alive during the lifetime of the pointer. Example
of a correct and incorrect ffi usage:
let mat: sprs::CsMat<f64> = sprs::CsMat::eye(5);
let mid = mat.view().middle_outer_views(1, 2);
let ptr = {
let indptr_proper = mid.proper_indptr();
println!(
"ptr {:?} is valid as long as _indptr_proper_owned is in scope",
indptr_proper.as_ptr()
);
indptr_proper.as_ptr()
};
// This line is UB.
// println!("ptr deref: {}", *ptr);
sourcepub fn indices(&self) -> &[I]
pub fn indices(&self) -> &[I]
The inner dimension location for each non-zero value. See the documentation of indptr() for more explanations.
sourcepub fn data(&self) -> &[N]
pub fn data(&self) -> &[N]
The non-zero values. See the documentation of indptr() for more explanations.
sourcepub fn into_raw_storage(self) -> (IptrStorage, IndStorage, DataStorage)
pub fn into_raw_storage(self) -> (IptrStorage, IndStorage, DataStorage)
Destruct the matrix object and recycle its storage containers.
Example
use sprs::{CsMat};
let (indptr, indices, data) = CsMat::<i32>::eye(3).into_raw_storage();
assert_eq!(indptr, vec![0, 1, 2, 3]);
assert_eq!(indices, vec![0, 1, 2]);
assert_eq!(data, vec![1, 1, 1]);
sourcepub fn transpose_mut(&mut self)
pub fn transpose_mut(&mut self)
Transpose a matrix in place No allocation required (this is simply a storage order change)
sourcepub fn transpose_into(self) -> Self
pub fn transpose_into(self) -> Self
Transpose a matrix in place No allocation required (this is simply a storage order change)
sourcepub fn transpose_view(&self) -> CsMatViewI<'_, N, I, Iptr>
pub fn transpose_view(&self) -> CsMatViewI<'_, N, I, Iptr>
Transposed view of this matrix No allocation required (this is simply a storage order change)
sourcepub fn to_owned(&self) -> CsMatI<N, I, Iptr>where
N: Clone,
pub fn to_owned(&self) -> CsMatI<N, I, Iptr>where N: Clone,
Get an owned version of this matrix. If the matrix was already owned, this will make a deep copy.
sourcepub fn to_inner_onehot(&self) -> CsMatI<N, I, Iptr>where
N: Clone + Float + PartialOrd,
pub fn to_inner_onehot(&self) -> CsMatI<N, I, Iptr>where N: Clone + Float + PartialOrd,
sourcepub fn to_other_types<I2, N2, Iptr2>(&self) -> CsMatI<N2, I2, Iptr2>where
N: Clone + Into<N2>,
I2: SpIndex,
Iptr2: SpIndex,
pub fn to_other_types<I2, N2, Iptr2>(&self) -> CsMatI<N2, I2, Iptr2>where N: Clone + Into<N2>, I2: SpIndex, Iptr2: SpIndex,
Clone the matrix with another integer type for indptr and indices
Panics
If the indices or indptr values cannot be represented by the requested integer type.
sourcepub fn view(&self) -> CsMatViewI<'_, N, I, Iptr>
pub fn view(&self) -> CsMatViewI<'_, N, I, Iptr>
Return a view into the current matrix
pub fn structure_view(&self) -> CsStructureViewI<'_, I, Iptr>
pub fn to_dense(&self) -> Array<N, Ix2>where N: Clone + Zero,
sourcepub fn outer_iterator(
&self
) -> impl DoubleEndedIterator<Item = CsVecViewI<'_, N, I>> + ExactSizeIterator<Item = CsVecViewI<'_, N, I>> + '_
pub fn outer_iterator( &self ) -> impl DoubleEndedIterator<Item = CsVecViewI<'_, N, I>> + ExactSizeIterator<Item = CsVecViewI<'_, N, I>> + '_
Return an outer iterator for the matrix
This can be used for iterating over the rows (resp. cols) of a CSR (resp. CSC) matrix.
use sprs::{CsMat};
let eye = CsMat::eye(5);
for (row_ind, row_vec) in eye.outer_iterator().enumerate() {
let (col_ind, &val): (_, &f64) = row_vec.iter().next().unwrap();
assert_eq!(row_ind, col_ind);
assert_eq!(val, 1.);
}
sourcepub fn max_outer_nnz(&self) -> usize
pub fn max_outer_nnz(&self) -> usize
Get the max number of nnz for each outer dim
sourcepub fn degrees(&self) -> Vec<usize>
pub fn degrees(&self) -> Vec<usize>
Get the degrees of each vertex on a symmetric matrix
The nonzero pattern of a symmetric matrix can be interpreted as an undirected graph. In such a graph, a vertex i is connected to another vertex j if there is a corresponding nonzero entry in the matrix at location (i, j).
This function returns a vector containing the degree of each vertex, that is to say the number of neighbor of each vertex. We do not count diagonal entries as a neighbor.
sourcepub fn outer_view(&self, i: usize) -> Option<CsVecViewI<'_, N, I>>
pub fn outer_view(&self, i: usize) -> Option<CsVecViewI<'_, N, I>>
Get a view into the i-th outer dimension (eg i-th row for a CSR matrix)
sourcepub fn diag_iter(
&self
) -> impl ExactSizeIterator<Item = Option<&N>> + DoubleEndedIterator<Item = Option<&N>>
pub fn diag_iter( &self ) -> impl ExactSizeIterator<Item = Option<&N>> + DoubleEndedIterator<Item = Option<&N>>
Iteration over all entries on the diagonal
sourcepub fn outer_block_iter(
&self,
block_size: usize
) -> impl DoubleEndedIterator<Item = CsMatViewI<'_, N, I, Iptr>> + ExactSizeIterator<Item = CsMatViewI<'_, N, I, Iptr>> + '_
pub fn outer_block_iter( &self, block_size: usize ) -> impl DoubleEndedIterator<Item = CsMatViewI<'_, N, I, Iptr>> + ExactSizeIterator<Item = CsMatViewI<'_, N, I, Iptr>> + '_
sourcepub fn map<F, N2>(&self, f: F) -> CsMatI<N2, I, Iptr>where
F: FnMut(&N) -> N2,
pub fn map<F, N2>(&self, f: F) -> CsMatI<N2, I, Iptr>where F: FnMut(&N) -> N2,
Return a new sparse matrix with the same sparsity pattern, with all non-zero values mapped by the function f
.
sourcepub fn get_outer_inner(&self, outer_ind: usize, inner_ind: usize) -> Option<&N>
pub fn get_outer_inner(&self, outer_ind: usize, inner_ind: usize) -> Option<&N>
Access an element given its outer_ind
and inner_ind
.
Will return None if there is no non-zero element at this location.
This access is logarithmic in the number of non-zeros
in the corresponding outer slice. It is therefore advisable not to rely
on this for algorithms, and prefer outer_iterator
which accesses elements in storage order.
sourcepub fn nnz_index(&self, row: usize, col: usize) -> Option<NnzIndex>
pub fn nnz_index(&self, row: usize, col: usize) -> Option<NnzIndex>
Find the non-zero index of the element specified by row and col
Searching this index is logarithmic in the number of non-zeros
in the corresponding outer slice.
Once it is available, the NnzIndex
enables retrieving the data with
O(1) complexity.
sourcepub fn nnz_index_outer_inner(
&self,
outer_ind: usize,
inner_ind: usize
) -> Option<NnzIndex>
pub fn nnz_index_outer_inner( &self, outer_ind: usize, inner_ind: usize ) -> Option<NnzIndex>
Find the non-zero index of the element specified by outer_ind
and
inner_ind
.
Searching this index is logarithmic in the number of non-zeros in the corresponding outer slice.
sourcepub fn check_compressed_structure(&self) -> Result<(), StructureError>
pub fn check_compressed_structure(&self) -> Result<(), StructureError>
Check the structure of CsMat
components
This will ensure that:
- indptr is of length
outer_dim() + 1
- indices and data have the same length,
nnz == indptr[outer_dims()]
- indptr is sorted
- indptr values do not exceed
usize::MAX
/ 2
, as that would mean indices and indptr would take more space than the addressable memory - indices is sorted for each outer slice
- indices are lower than
inner_dims()
source§impl<N, I, Iptr, IptrStorage, IndStorage, DataStorage> CsMatBase<N, I, IptrStorage, IndStorage, DataStorage, Iptr>where
N: Default,
I: SpIndex,
Iptr: SpIndex,
IptrStorage: Deref<Target = [Iptr]>,
IndStorage: Deref<Target = [I]>,
DataStorage: Deref<Target = [N]>,
impl<N, I, Iptr, IptrStorage, IndStorage, DataStorage> CsMatBase<N, I, IptrStorage, IndStorage, DataStorage, Iptr>where N: Default, I: SpIndex, Iptr: SpIndex, IptrStorage: Deref<Target = [Iptr]>, IndStorage: Deref<Target = [I]>, DataStorage: Deref<Target = [N]>,
sourcepub fn to_other_storage(&self) -> CsMatI<N, I, Iptr>where
N: Clone,
pub fn to_other_storage(&self) -> CsMatI<N, I, Iptr>where N: Clone,
Create a matrix mathematically equal to this one, but with the opposed storage (a CSC matrix will be converted to CSR, and vice versa)
source§impl<N, I, Iptr> CsMatBase<N, I, Vec<Iptr, Global>, Vec<I, Global>, Vec<N, Global>, Iptr>where
N: Default,
I: SpIndex,
Iptr: SpIndex,
impl<N, I, Iptr> CsMatBase<N, I, Vec<Iptr, Global>, Vec<I, Global>, Vec<N, Global>, Iptr>where N: Default, I: SpIndex, Iptr: SpIndex,
source§impl<N, I, Iptr, IptrStorage, IndStorage, DataStorage> CsMatBase<N, I, IptrStorage, IndStorage, DataStorage, Iptr>where
I: SpIndex,
Iptr: SpIndex,
IptrStorage: Deref<Target = [Iptr]>,
IndStorage: Deref<Target = [I]>,
DataStorage: DerefMut<Target = [N]>,
impl<N, I, Iptr, IptrStorage, IndStorage, DataStorage> CsMatBase<N, I, IptrStorage, IndStorage, DataStorage, Iptr>where I: SpIndex, Iptr: SpIndex, IptrStorage: Deref<Target = [Iptr]>, IndStorage: Deref<Target = [I]>, DataStorage: DerefMut<Target = [N]>,
sourcepub fn data_mut(&mut self) -> &mut [N]
pub fn data_mut(&mut self) -> &mut [N]
Mutable access to the non zero values
This enables changing the values without changing the matrix’s structure. To also change the matrix’s structure, see modify
sourcepub fn scale(&mut self, val: N)where
for<'r> N: MulAssign<&'r N>,
pub fn scale(&mut self, val: N)where for<'r> N: MulAssign<&'r N>,
Sparse matrix self-multiplication by a scalar
sourcepub fn outer_view_mut(&mut self, i: usize) -> Option<CsVecViewMutI<'_, N, I>>
pub fn outer_view_mut(&mut self, i: usize) -> Option<CsVecViewMutI<'_, N, I>>
Get a mutable view into the i-th outer dimension (eg i-th row for a CSR matrix)
sourcepub fn get_mut(&mut self, i: usize, j: usize) -> Option<&mut N>
pub fn get_mut(&mut self, i: usize, j: usize) -> Option<&mut N>
Get a mutable reference to the element located at row i and column j. Will return None if there is no non-zero element at this location.
This access is logarithmic in the number of non-zeros
in the corresponding outer slice. It is therefore advisable not to rely
on this for algorithms, and prefer outer_iterator_mut
which accesses elements in storage order.
TODO: outer_iterator_mut
is not yet implemented
sourcepub fn get_outer_inner_mut(
&mut self,
outer_ind: usize,
inner_ind: usize
) -> Option<&mut N>
pub fn get_outer_inner_mut( &mut self, outer_ind: usize, inner_ind: usize ) -> Option<&mut N>
Get a mutable reference to an element given its outer_ind
and inner_ind
.
Will return None if there is no non-zero element at this location.
This access is logarithmic in the number of non-zeros
in the corresponding outer slice. It is therefore advisable not to rely
on this for algorithms, and prefer outer_iterator_mut
which accesses elements in storage order.
sourcepub fn set(&mut self, row: usize, col: usize, val: N)
pub fn set(&mut self, row: usize, col: usize, val: N)
Set the value of the non-zero element located at (row, col)
Panics
- on out-of-bounds access
- if no non-zero element exists at the given location
sourcepub fn map_inplace<F>(&mut self, f: F)where
F: FnMut(&N) -> N,
pub fn map_inplace<F>(&mut self, f: F)where F: FnMut(&N) -> N,
Apply a function to every non-zero element
sourcepub fn outer_iterator_mut(
&mut self
) -> impl DoubleEndedIterator<Item = CsVecViewMutI<'_, N, I>> + ExactSizeIterator<Item = CsVecViewMutI<'_, N, I>> + '_
pub fn outer_iterator_mut( &mut self ) -> impl DoubleEndedIterator<Item = CsVecViewMutI<'_, N, I>> + ExactSizeIterator<Item = CsVecViewMutI<'_, N, I>> + '_
Return a mutable outer iterator for the matrix
This iterator yields mutable sparse vector views for each outer dimension. Only the non-zero values can be modified, the structure is kept immutable.
sourcepub fn view_mut(&mut self) -> CsMatViewMutI<'_, N, I, Iptr>
pub fn view_mut(&mut self) -> CsMatViewMutI<'_, N, I, Iptr>
Return a mutable view into the current matrix
sourcepub fn diag_iter_mut(
&mut self
) -> impl ExactSizeIterator<Item = Option<&mut N>> + DoubleEndedIterator<Item = Option<&mut N>> + '_
pub fn diag_iter_mut( &mut self ) -> impl ExactSizeIterator<Item = Option<&mut N>> + DoubleEndedIterator<Item = Option<&mut N>> + '_
Iteration over all entries on the diagonal
source§impl<N, I, Iptr, IptrStorage, IndStorage, DataStorage> CsMatBase<N, I, IptrStorage, IndStorage, DataStorage, Iptr>where
I: SpIndex,
Iptr: SpIndex,
IptrStorage: DerefMut<Target = [Iptr]>,
IndStorage: DerefMut<Target = [I]>,
DataStorage: DerefMut<Target = [N]>,
impl<N, I, Iptr, IptrStorage, IndStorage, DataStorage> CsMatBase<N, I, IptrStorage, IndStorage, DataStorage, Iptr>where I: SpIndex, Iptr: SpIndex, IptrStorage: DerefMut<Target = [Iptr]>, IndStorage: DerefMut<Target = [I]>, DataStorage: DerefMut<Target = [N]>,
sourcepub fn modify<F>(&mut self, f: F)where
F: FnMut(&mut [Iptr], &mut [I], &mut [N]),
pub fn modify<F>(&mut self, f: F)where F: FnMut(&mut [Iptr], &mut [I], &mut [N]),
Modify the matrix’s structure without changing its nonzero count.
The coherence of the structure will be checked afterwards.
Panics
If the resulting matrix breaks the CsMat
invariants
(sorted indices, no out of bounds indices).
Example
use sprs::CsMat;
// | 1 |
// | 1 |
// | 1 1 |
let mut mat = CsMat::new_csc((3, 3),
vec![0, 1, 3, 4],
vec![1, 0, 2, 2],
vec![1.; 4]);
// | 1 2 |
// | 1 |
// | 1 |
mat.modify(|indptr, indices, data| {
indptr[1] = 2;
indptr[2] = 4;
indices[0] = 0;
indices[1] = 1;
indices[2] = 0;
data[2] = 2.;
});
source§impl<N, I: SpIndex, Iptr: SpIndex, IptrStorage, IStorage, DStorage> CsMatBase<N, I, IptrStorage, IStorage, DStorage, Iptr>where
IptrStorage: Deref<Target = [Iptr]>,
IStorage: Deref<Target = [I]>,
DStorage: Deref<Target = [N]>,
impl<N, I: SpIndex, Iptr: SpIndex, IptrStorage, IStorage, DStorage> CsMatBase<N, I, IptrStorage, IStorage, DStorage, Iptr>where IptrStorage: Deref<Target = [Iptr]>, IStorage: Deref<Target = [I]>, DStorage: Deref<Target = [N]>,
sourcepub fn slice_outer<S: Range>(&self, range: S) -> CsMatViewI<'_, N, I, Iptr>
pub fn slice_outer<S: Range>(&self, range: S) -> CsMatViewI<'_, N, I, Iptr>
Slice the outer dimension of the matrix according to the specified range.
source§impl<N, I: SpIndex, Iptr: SpIndex, IptrStorage, IStorage, DStorage> CsMatBase<N, I, IptrStorage, IStorage, DStorage, Iptr>where
IptrStorage: Deref<Target = [Iptr]>,
IStorage: Deref<Target = [I]>,
DStorage: DerefMut<Target = [N]>,
impl<N, I: SpIndex, Iptr: SpIndex, IptrStorage, IStorage, DStorage> CsMatBase<N, I, IptrStorage, IStorage, DStorage, Iptr>where IptrStorage: Deref<Target = [Iptr]>, IStorage: Deref<Target = [I]>, DStorage: DerefMut<Target = [N]>,
sourcepub fn slice_outer_mut<S: Range>(
&mut self,
range: S
) -> CsMatViewMutI<'_, N, I, Iptr>
pub fn slice_outer_mut<S: Range>( &mut self, range: S ) -> CsMatViewMutI<'_, N, I, Iptr>
Slice the outer dimension of the matrix according to the specified range.
Trait Implementations§
source§impl<N, I, Iptr, IS1, DS1, ISptr1, IS2, ISptr2, DS2> AbsDiffEq<CsMatBase<N, I, ISptr2, IS2, DS2, Iptr>> for CsMatBase<N, I, ISptr1, IS1, DS1, Iptr>where
I: SpIndex,
Iptr: SpIndex,
CsMatBase<N, I, ISptr1, IS1, DS1, Iptr>: PartialEq<CsMatBase<N, I, ISptr2, IS2, DS2, Iptr>>,
IS1: Deref<Target = [I]>,
IS2: Deref<Target = [I]>,
ISptr1: Deref<Target = [Iptr]>,
ISptr2: Deref<Target = [Iptr]>,
DS1: Deref<Target = [N]>,
DS2: Deref<Target = [N]>,
N: AbsDiffEq + Zero,
N::Epsilon: Clone,
impl<N, I, Iptr, IS1, DS1, ISptr1, IS2, ISptr2, DS2> AbsDiffEq<CsMatBase<N, I, ISptr2, IS2, DS2, Iptr>> for CsMatBase<N, I, ISptr1, IS1, DS1, Iptr>where I: SpIndex, Iptr: SpIndex, CsMatBase<N, I, ISptr1, IS1, DS1, Iptr>: PartialEq<CsMatBase<N, I, ISptr2, IS2, DS2, Iptr>>, IS1: Deref<Target = [I]>, IS2: Deref<Target = [I]>, ISptr1: Deref<Target = [Iptr]>, ISptr2: Deref<Target = [Iptr]>, DS1: Deref<Target = [N]>, DS2: Deref<Target = [N]>, N: AbsDiffEq + Zero, N::Epsilon: Clone,
source§fn default_epsilon() -> N::Epsilon
fn default_epsilon() -> N::Epsilon
source§fn abs_diff_eq(
&self,
other: &CsMatBase<N, I, ISptr2, IS2, DS2, Iptr>,
epsilon: N::Epsilon
) -> bool
fn abs_diff_eq( &self, other: &CsMatBase<N, I, ISptr2, IS2, DS2, Iptr>, epsilon: N::Epsilon ) -> bool
source§fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
AbsDiffEq::abs_diff_eq
.source§impl<'a, 'b, N, I, Iptr, IpS, IS, DS, DS2> Add<&'b ArrayBase<DS2, Dim<[usize; 2]>>> for &'a CsMatBase<N, I, IpS, IS, DS, Iptr>where
N: 'a + Copy + Num + Default,
for<'r> &'r N: Mul<Output = N>,
I: 'a + SpIndex,
Iptr: 'a + SpIndex,
IpS: 'a + Deref<Target = [Iptr]>,
IS: 'a + Deref<Target = [I]>,
DS: 'a + Deref<Target = [N]>,
DS2: 'b + Data<Elem = N>,
impl<'a, 'b, N, I, Iptr, IpS, IS, DS, DS2> Add<&'b ArrayBase<DS2, Dim<[usize; 2]>>> for &'a CsMatBase<N, I, IpS, IS, DS, Iptr>where N: 'a + Copy + Num + Default, for<'r> &'r N: Mul<Output = N>, I: 'a + SpIndex, Iptr: 'a + SpIndex, IpS: 'a + Deref<Target = [Iptr]>, IS: 'a + Deref<Target = [I]>, DS: 'a + Deref<Target = [N]>, DS2: 'b + Data<Elem = N>,
source§impl<'a, 'b, Lhs, Rhs, Res, I, Iptr, IpStorage, IStorage, DStorage, IpS2, IS2, DS2> Add<&'b CsMatBase<Rhs, I, IpS2, IS2, DS2, Iptr>> for &'a CsMatBase<Lhs, I, IpStorage, IStorage, DStorage, Iptr>where
Lhs: Zero,
Rhs: Zero + Clone + Default,
Res: Zero + Clone,
for<'r> &'r Lhs: Add<&'r Rhs, Output = Res>,
I: 'a + SpIndex,
Iptr: 'a + SpIndex,
IpStorage: 'a + Deref<Target = [Iptr]>,
IStorage: 'a + Deref<Target = [I]>,
DStorage: 'a + Deref<Target = [Lhs]>,
IpS2: 'b + Deref<Target = [Iptr]>,
IS2: 'b + Deref<Target = [I]>,
DS2: 'b + Deref<Target = [Rhs]>,
impl<'a, 'b, Lhs, Rhs, Res, I, Iptr, IpStorage, IStorage, DStorage, IpS2, IS2, DS2> Add<&'b CsMatBase<Rhs, I, IpS2, IS2, DS2, Iptr>> for &'a CsMatBase<Lhs, I, IpStorage, IStorage, DStorage, Iptr>where Lhs: Zero, Rhs: Zero + Clone + Default, Res: Zero + Clone, for<'r> &'r Lhs: Add<&'r Rhs, Output = Res>, I: 'a + SpIndex, Iptr: 'a + SpIndex, IpStorage: 'a + Deref<Target = [Iptr]>, IStorage: 'a + Deref<Target = [I]>, DStorage: 'a + Deref<Target = [Lhs]>, IpS2: 'b + Deref<Target = [Iptr]>, IS2: 'b + Deref<Target = [I]>, DS2: 'b + Deref<Target = [Rhs]>,
source§impl<N: Clone, I, IptrStorage, IndStorage, DataStorage, Iptr> Clone for CsMatBase<N, I, IptrStorage, IndStorage, DataStorage, Iptr>where
I: SpIndex + Clone,
Iptr: SpIndex + Clone,
IptrStorage: Deref<Target = [Iptr]> + Clone,
IndStorage: Deref<Target = [I]> + Clone,
DataStorage: Deref<Target = [N]> + Clone,
impl<N: Clone, I, IptrStorage, IndStorage, DataStorage, Iptr> Clone for CsMatBase<N, I, IptrStorage, IndStorage, DataStorage, Iptr>where I: SpIndex + Clone, Iptr: SpIndex + Clone, IptrStorage: Deref<Target = [Iptr]> + Clone, IndStorage: Deref<Target = [I]> + Clone, DataStorage: Deref<Target = [N]> + Clone,
source§impl<N: Debug, I, IptrStorage, IndStorage, DataStorage, Iptr> Debug for CsMatBase<N, I, IptrStorage, IndStorage, DataStorage, Iptr>where
I: SpIndex + Debug,
Iptr: SpIndex + Debug,
IptrStorage: Deref<Target = [Iptr]> + Debug,
IndStorage: Deref<Target = [I]> + Debug,
DataStorage: Deref<Target = [N]> + Debug,
impl<N: Debug, I, IptrStorage, IndStorage, DataStorage, Iptr> Debug for CsMatBase<N, I, IptrStorage, IndStorage, DataStorage, Iptr>where I: SpIndex + Debug, Iptr: SpIndex + Debug, IptrStorage: Deref<Target = [Iptr]> + Debug, IndStorage: Deref<Target = [I]> + Debug, DataStorage: Deref<Target = [N]> + Debug,
source§impl<'de, N, I, IptrStorage, IndStorage, DataStorage, Iptr> Deserialize<'de> for CsMatBase<N, I, IptrStorage, IndStorage, DataStorage, Iptr>where
I: SpIndex,
Iptr: SpIndex + Deserialize<'de>,
IptrStorage: Deref<Target = [Iptr]> + Deserialize<'de>,
IndStorage: Deref<Target = [I]> + Deserialize<'de>,
DataStorage: Deref<Target = [N]> + Deserialize<'de>,
impl<'de, N, I, IptrStorage, IndStorage, DataStorage, Iptr> Deserialize<'de> for CsMatBase<N, I, IptrStorage, IndStorage, DataStorage, Iptr>where I: SpIndex, Iptr: SpIndex + Deserialize<'de>, IptrStorage: Deref<Target = [Iptr]> + Deserialize<'de>, IndStorage: Deref<Target = [I]> + Deserialize<'de>, DataStorage: Deref<Target = [N]> + Deserialize<'de>,
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
source§impl<'a, I, Iptr, IpStorage, IStorage, DStorage, T> DivAssign<T> for CsMatBase<T, I, IpStorage, IStorage, DStorage, Iptr>where
I: 'a + SpIndex,
Iptr: 'a + SpIndex,
IpStorage: 'a + Deref<Target = [Iptr]>,
IStorage: 'a + Deref<Target = [I]>,
DStorage: 'a + DerefMut<Target = [T]>,
T: DivAssign<T> + Clone,
impl<'a, I, Iptr, IpStorage, IStorage, DStorage, T> DivAssign<T> for CsMatBase<T, I, IpStorage, IStorage, DStorage, Iptr>where I: 'a + SpIndex, Iptr: 'a + SpIndex, IpStorage: 'a + Deref<Target = [Iptr]>, IStorage: 'a + Deref<Target = [I]>, DStorage: 'a + DerefMut<Target = [T]>, T: DivAssign<T> + Clone,
source§fn div_assign(&mut self, rhs: T)
fn div_assign(&mut self, rhs: T)
/=
operation. Read moresource§impl<'a, 'b, N, I, Iptr, IpS, IS, DS, DS2> Dot<ArrayBase<DS2, Dim<[usize; 1]>>> for CsMatBase<N, I, IpS, IS, DS, Iptr>where
N: 'a + Clone + MulAcc + Zero,
I: 'a + SpIndex,
Iptr: 'a + SpIndex,
IpS: 'a + Deref<Target = [Iptr]>,
IS: 'a + Deref<Target = [I]>,
DS: 'a + Deref<Target = [N]>,
DS2: 'b + Data<Elem = N>,
impl<'a, 'b, N, I, Iptr, IpS, IS, DS, DS2> Dot<ArrayBase<DS2, Dim<[usize; 1]>>> for CsMatBase<N, I, IpS, IS, DS, Iptr>where N: 'a + Clone + MulAcc + Zero, I: 'a + SpIndex, Iptr: 'a + SpIndex, IpS: 'a + Deref<Target = [Iptr]>, IS: 'a + Deref<Target = [I]>, DS: 'a + Deref<Target = [N]>, DS2: 'b + Data<Elem = N>,
source§impl<'a, 'b, N, I, Iptr, IpS, IS, DS, DS2> Dot<ArrayBase<DS2, Dim<[usize; 2]>>> for CsMatBase<N, I, IpS, IS, DS, Iptr>where
N: 'a + Clone + MulAcc + Zero,
I: 'a + SpIndex,
Iptr: 'a + SpIndex,
IpS: 'a + Deref<Target = [Iptr]>,
IS: 'a + Deref<Target = [I]>,
DS: 'a + Deref<Target = [N]>,
DS2: 'b + Data<Elem = N>,
impl<'a, 'b, N, I, Iptr, IpS, IS, DS, DS2> Dot<ArrayBase<DS2, Dim<[usize; 2]>>> for CsMatBase<N, I, IpS, IS, DS, Iptr>where N: 'a + Clone + MulAcc + Zero, I: 'a + SpIndex, Iptr: 'a + SpIndex, IpS: 'a + Deref<Target = [Iptr]>, IS: 'a + Deref<Target = [I]>, DS: 'a + Deref<Target = [N]>, DS2: 'b + Data<Elem = N>,
source§impl<'a, 'b, N, I, IpS, IS, DS, DS2> Dot<CsMatBase<N, I, IpS, IS, DS, I>> for ArrayBase<DS2, Ix2>where
N: 'a + Clone + MulAcc + Zero + Debug,
I: 'a + SpIndex,
IpS: 'a + Deref<Target = [I]>,
IS: 'a + Deref<Target = [I]>,
DS: 'a + Deref<Target = [N]>,
DS2: 'b + Data<Elem = N>,
impl<'a, 'b, N, I, IpS, IS, DS, DS2> Dot<CsMatBase<N, I, IpS, IS, DS, I>> for ArrayBase<DS2, Ix2>where N: 'a + Clone + MulAcc + Zero + Debug, I: 'a + SpIndex, IpS: 'a + Deref<Target = [I]>, IS: 'a + Deref<Target = [I]>, DS: 'a + Deref<Target = [N]>, DS2: 'b + Data<Elem = N>,
source§impl<N: Hash, I, IptrStorage, IndStorage, DataStorage, Iptr> Hash for CsMatBase<N, I, IptrStorage, IndStorage, DataStorage, Iptr>where
I: SpIndex + Hash,
Iptr: SpIndex + Hash,
IptrStorage: Deref<Target = [Iptr]> + Hash,
IndStorage: Deref<Target = [I]> + Hash,
DataStorage: Deref<Target = [N]> + Hash,
impl<N: Hash, I, IptrStorage, IndStorage, DataStorage, Iptr> Hash for CsMatBase<N, I, IptrStorage, IndStorage, DataStorage, Iptr>where I: SpIndex + Hash, Iptr: SpIndex + Hash, IptrStorage: Deref<Target = [Iptr]> + Hash, IndStorage: Deref<Target = [I]> + Hash, DataStorage: Deref<Target = [N]> + Hash,
source§impl<N, I, Iptr, IpS, IS, DS> Index<[usize; 2]> for CsMatBase<N, I, IpS, IS, DS, Iptr>where
I: SpIndex,
Iptr: SpIndex,
IpS: Deref<Target = [Iptr]>,
IS: Deref<Target = [I]>,
DS: Deref<Target = [N]>,
impl<N, I, Iptr, IpS, IS, DS> Index<[usize; 2]> for CsMatBase<N, I, IpS, IS, DS, Iptr>where I: SpIndex, Iptr: SpIndex, IpS: Deref<Target = [Iptr]>, IS: Deref<Target = [I]>, DS: Deref<Target = [N]>,
source§impl<N, I, Iptr, IpS, IS, DS> IndexMut<[usize; 2]> for CsMatBase<N, I, IpS, IS, DS, Iptr>where
I: SpIndex,
Iptr: SpIndex,
IpS: Deref<Target = [Iptr]>,
IS: Deref<Target = [I]>,
DS: DerefMut<Target = [N]>,
impl<N, I, Iptr, IpS, IS, DS> IndexMut<[usize; 2]> for CsMatBase<N, I, IpS, IS, DS, Iptr>where I: SpIndex, Iptr: SpIndex, IpS: Deref<Target = [Iptr]>, IS: Deref<Target = [I]>, DS: DerefMut<Target = [N]>,
source§impl<'a, N, I, IpS, IS, DS, Iptr> IntoIterator for &'a CsMatBase<N, I, IpS, IS, DS, Iptr>where
I: 'a + SpIndex,
Iptr: 'a + SpIndex,
N: 'a,
IpS: Deref<Target = [Iptr]>,
IS: Deref<Target = [I]>,
DS: Deref<Target = [N]>,
impl<'a, N, I, IpS, IS, DS, Iptr> IntoIterator for &'a CsMatBase<N, I, IpS, IS, DS, Iptr>where I: 'a + SpIndex, Iptr: 'a + SpIndex, N: 'a, IpS: Deref<Target = [Iptr]>, IS: Deref<Target = [I]>, DS: Deref<Target = [N]>,
source§impl<'a, 'b, N, I, Iptr, IpS, IS, DS, DS2> Mul<&'b ArrayBase<DS2, Dim<[usize; 1]>>> for &'a CsMatBase<N, I, IpS, IS, DS, Iptr>where
N: 'a + Clone + MulAcc + Zero,
I: 'a + SpIndex,
Iptr: 'a + SpIndex,
IpS: 'a + Deref<Target = [Iptr]>,
IS: 'a + Deref<Target = [I]>,
DS: 'a + Deref<Target = [N]>,
DS2: 'b + Data<Elem = N>,
impl<'a, 'b, N, I, Iptr, IpS, IS, DS, DS2> Mul<&'b ArrayBase<DS2, Dim<[usize; 1]>>> for &'a CsMatBase<N, I, IpS, IS, DS, Iptr>where N: 'a + Clone + MulAcc + Zero, I: 'a + SpIndex, Iptr: 'a + SpIndex, IpS: 'a + Deref<Target = [Iptr]>, IS: 'a + Deref<Target = [I]>, DS: 'a + Deref<Target = [N]>, DS2: 'b + Data<Elem = N>,
source§impl<'a, 'b, N, I, Iptr, IpS, IS, DS, DS2> Mul<&'b ArrayBase<DS2, Dim<[usize; 2]>>> for &'a CsMatBase<N, I, IpS, IS, DS, Iptr>where
N: 'a + MulAcc + Zero + Clone,
I: 'a + SpIndex,
Iptr: 'a + SpIndex,
IpS: 'a + Deref<Target = [Iptr]>,
IS: 'a + Deref<Target = [I]>,
DS: 'a + Deref<Target = [N]>,
DS2: 'b + Data<Elem = N>,
impl<'a, 'b, N, I, Iptr, IpS, IS, DS, DS2> Mul<&'b ArrayBase<DS2, Dim<[usize; 2]>>> for &'a CsMatBase<N, I, IpS, IS, DS, Iptr>where N: 'a + MulAcc + Zero + Clone, I: 'a + SpIndex, Iptr: 'a + SpIndex, IpS: 'a + Deref<Target = [Iptr]>, IS: 'a + Deref<Target = [I]>, DS: 'a + Deref<Target = [N]>, DS2: 'b + Data<Elem = N>,
source§impl<'a, 'b, N, I, Iptr, IpS1, IS1, DS1, IpS2, IS2, DS2> Mul<&'b CsMatBase<N, I, IpS2, IS2, DS2, Iptr>> for &'a CsMatBase<N, I, IpS1, IS1, DS1, Iptr>where
N: 'a + Clone + MulAcc + Zero + Default + Send + Sync,
I: 'a + SpIndex,
Iptr: 'a + SpIndex,
IpS1: 'a + Deref<Target = [Iptr]>,
IS1: 'a + Deref<Target = [I]>,
DS1: 'a + Deref<Target = [N]>,
IpS2: 'b + Deref<Target = [Iptr]>,
IS2: 'b + Deref<Target = [I]>,
DS2: 'b + Deref<Target = [N]>,
impl<'a, 'b, N, I, Iptr, IpS1, IS1, DS1, IpS2, IS2, DS2> Mul<&'b CsMatBase<N, I, IpS2, IS2, DS2, Iptr>> for &'a CsMatBase<N, I, IpS1, IS1, DS1, Iptr>where N: 'a + Clone + MulAcc + Zero + Default + Send + Sync, I: 'a + SpIndex, Iptr: 'a + SpIndex, IpS1: 'a + Deref<Target = [Iptr]>, IS1: 'a + Deref<Target = [I]>, DS1: 'a + Deref<Target = [N]>, IpS2: 'b + Deref<Target = [Iptr]>, IS2: 'b + Deref<Target = [I]>, DS2: 'b + Deref<Target = [N]>,
source§impl<'a, 'b, N, I, Iptr, IS1, DS1, IpS2, IS2, DS2> Mul<&'b CsMatBase<N, I, IpS2, IS2, DS2, Iptr>> for &'a CsVecBase<IS1, DS1, N, I>where
N: 'a + Clone + MulAcc + Zero + Default + Send + Sync,
I: 'a + SpIndex,
Iptr: 'a + SpIndex,
IS1: 'a + Deref<Target = [I]>,
DS1: 'a + Deref<Target = [N]>,
IpS2: 'b + Deref<Target = [Iptr]>,
IS2: 'b + Deref<Target = [I]>,
DS2: 'b + Deref<Target = [N]>,
impl<'a, 'b, N, I, Iptr, IS1, DS1, IpS2, IS2, DS2> Mul<&'b CsMatBase<N, I, IpS2, IS2, DS2, Iptr>> for &'a CsVecBase<IS1, DS1, N, I>where N: 'a + Clone + MulAcc + Zero + Default + Send + Sync, I: 'a + SpIndex, Iptr: 'a + SpIndex, IS1: 'a + Deref<Target = [I]>, DS1: 'a + Deref<Target = [N]>, IpS2: 'b + Deref<Target = [Iptr]>, IS2: 'b + Deref<Target = [I]>, DS2: 'b + Deref<Target = [N]>,
source§impl<'a, 'b, N, I, Iptr, IpS1, IS1, DS1, IS2, DS2> Mul<&'b CsVecBase<IS2, DS2, N, I>> for &'a CsMatBase<N, I, IpS1, IS1, DS1, Iptr>where
N: Clone + MulAcc + Zero + PartialEq + Default + Send + Sync,
I: SpIndex,
Iptr: SpIndex,
IpS1: Deref<Target = [Iptr]>,
IS1: Deref<Target = [I]>,
DS1: Deref<Target = [N]>,
IS2: Deref<Target = [I]>,
DS2: Deref<Target = [N]>,
impl<'a, 'b, N, I, Iptr, IpS1, IS1, DS1, IS2, DS2> Mul<&'b CsVecBase<IS2, DS2, N, I>> for &'a CsMatBase<N, I, IpS1, IS1, DS1, Iptr>where N: Clone + MulAcc + Zero + PartialEq + Default + Send + Sync, I: SpIndex, Iptr: SpIndex, IpS1: Deref<Target = [Iptr]>, IS1: Deref<Target = [I]>, DS1: Deref<Target = [N]>, IS2: Deref<Target = [I]>, DS2: Deref<Target = [N]>,
source§impl<'a, I, Iptr, IpStorage, IStorage, DStorage> Mul<f32> for &'a CsMatBase<f32, I, IpStorage, IStorage, DStorage, Iptr>where
I: 'a + SpIndex,
Iptr: 'a + SpIndex,
IpStorage: 'a + Deref<Target = [Iptr]>,
IStorage: 'a + Deref<Target = [I]>,
DStorage: 'a + Deref<Target = [f32]>,
impl<'a, I, Iptr, IpStorage, IStorage, DStorage> Mul<f32> for &'a CsMatBase<f32, I, IpStorage, IStorage, DStorage, Iptr>where I: 'a + SpIndex, Iptr: 'a + SpIndex, IpStorage: 'a + Deref<Target = [Iptr]>, IStorage: 'a + Deref<Target = [I]>, DStorage: 'a + Deref<Target = [f32]>,
source§impl<'a, I, Iptr, IpStorage, IStorage, DStorage> Mul<f64> for &'a CsMatBase<f64, I, IpStorage, IStorage, DStorage, Iptr>where
I: 'a + SpIndex,
Iptr: 'a + SpIndex,
IpStorage: 'a + Deref<Target = [Iptr]>,
IStorage: 'a + Deref<Target = [I]>,
DStorage: 'a + Deref<Target = [f64]>,
impl<'a, I, Iptr, IpStorage, IStorage, DStorage> Mul<f64> for &'a CsMatBase<f64, I, IpStorage, IStorage, DStorage, Iptr>where I: 'a + SpIndex, Iptr: 'a + SpIndex, IpStorage: 'a + Deref<Target = [Iptr]>, IStorage: 'a + Deref<Target = [I]>, DStorage: 'a + Deref<Target = [f64]>,
source§impl<'a, I, Iptr, IpStorage, IStorage, DStorage> Mul<i16> for &'a CsMatBase<i16, I, IpStorage, IStorage, DStorage, Iptr>where
I: 'a + SpIndex,
Iptr: 'a + SpIndex,
IpStorage: 'a + Deref<Target = [Iptr]>,
IStorage: 'a + Deref<Target = [I]>,
DStorage: 'a + Deref<Target = [i16]>,
impl<'a, I, Iptr, IpStorage, IStorage, DStorage> Mul<i16> for &'a CsMatBase<i16, I, IpStorage, IStorage, DStorage, Iptr>where I: 'a + SpIndex, Iptr: 'a + SpIndex, IpStorage: 'a + Deref<Target = [Iptr]>, IStorage: 'a + Deref<Target = [I]>, DStorage: 'a + Deref<Target = [i16]>,
source§impl<'a, I, Iptr, IpStorage, IStorage, DStorage> Mul<i32> for &'a CsMatBase<i32, I, IpStorage, IStorage, DStorage, Iptr>where
I: 'a + SpIndex,
Iptr: 'a + SpIndex,
IpStorage: 'a + Deref<Target = [Iptr]>,
IStorage: 'a + Deref<Target = [I]>,
DStorage: 'a + Deref<Target = [i32]>,
impl<'a, I, Iptr, IpStorage, IStorage, DStorage> Mul<i32> for &'a CsMatBase<i32, I, IpStorage, IStorage, DStorage, Iptr>where I: 'a + SpIndex, Iptr: 'a + SpIndex, IpStorage: 'a + Deref<Target = [Iptr]>, IStorage: 'a + Deref<Target = [I]>, DStorage: 'a + Deref<Target = [i32]>,
source§impl<'a, I, Iptr, IpStorage, IStorage, DStorage> Mul<i64> for &'a CsMatBase<i64, I, IpStorage, IStorage, DStorage, Iptr>where
I: 'a + SpIndex,
Iptr: 'a + SpIndex,
IpStorage: 'a + Deref<Target = [Iptr]>,
IStorage: 'a + Deref<Target = [I]>,
DStorage: 'a + Deref<Target = [i64]>,
impl<'a, I, Iptr, IpStorage, IStorage, DStorage> Mul<i64> for &'a CsMatBase<i64, I, IpStorage, IStorage, DStorage, Iptr>where I: 'a + SpIndex, Iptr: 'a + SpIndex, IpStorage: 'a + Deref<Target = [Iptr]>, IStorage: 'a + Deref<Target = [I]>, DStorage: 'a + Deref<Target = [i64]>,
source§impl<'a, I, Iptr, IpStorage, IStorage, DStorage> Mul<i8> for &'a CsMatBase<i8, I, IpStorage, IStorage, DStorage, Iptr>where
I: 'a + SpIndex,
Iptr: 'a + SpIndex,
IpStorage: 'a + Deref<Target = [Iptr]>,
IStorage: 'a + Deref<Target = [I]>,
DStorage: 'a + Deref<Target = [i8]>,
impl<'a, I, Iptr, IpStorage, IStorage, DStorage> Mul<i8> for &'a CsMatBase<i8, I, IpStorage, IStorage, DStorage, Iptr>where I: 'a + SpIndex, Iptr: 'a + SpIndex, IpStorage: 'a + Deref<Target = [Iptr]>, IStorage: 'a + Deref<Target = [I]>, DStorage: 'a + Deref<Target = [i8]>,
source§impl<'a, I, Iptr, IpStorage, IStorage, DStorage> Mul<isize> for &'a CsMatBase<isize, I, IpStorage, IStorage, DStorage, Iptr>where
I: 'a + SpIndex,
Iptr: 'a + SpIndex,
IpStorage: 'a + Deref<Target = [Iptr]>,
IStorage: 'a + Deref<Target = [I]>,
DStorage: 'a + Deref<Target = [isize]>,
impl<'a, I, Iptr, IpStorage, IStorage, DStorage> Mul<isize> for &'a CsMatBase<isize, I, IpStorage, IStorage, DStorage, Iptr>where I: 'a + SpIndex, Iptr: 'a + SpIndex, IpStorage: 'a + Deref<Target = [Iptr]>, IStorage: 'a + Deref<Target = [I]>, DStorage: 'a + Deref<Target = [isize]>,
source§impl<'a, I, Iptr, IpStorage, IStorage, DStorage> Mul<u16> for &'a CsMatBase<u16, I, IpStorage, IStorage, DStorage, Iptr>where
I: 'a + SpIndex,
Iptr: 'a + SpIndex,
IpStorage: 'a + Deref<Target = [Iptr]>,
IStorage: 'a + Deref<Target = [I]>,
DStorage: 'a + Deref<Target = [u16]>,
impl<'a, I, Iptr, IpStorage, IStorage, DStorage> Mul<u16> for &'a CsMatBase<u16, I, IpStorage, IStorage, DStorage, Iptr>where I: 'a + SpIndex, Iptr: 'a + SpIndex, IpStorage: 'a + Deref<Target = [Iptr]>, IStorage: 'a + Deref<Target = [I]>, DStorage: 'a + Deref<Target = [u16]>,
source§impl<'a, I, Iptr, IpStorage, IStorage, DStorage> Mul<u32> for &'a CsMatBase<u32, I, IpStorage, IStorage, DStorage, Iptr>where
I: 'a + SpIndex,
Iptr: 'a + SpIndex,
IpStorage: 'a + Deref<Target = [Iptr]>,
IStorage: 'a + Deref<Target = [I]>,
DStorage: 'a + Deref<Target = [u32]>,
impl<'a, I, Iptr, IpStorage, IStorage, DStorage> Mul<u32> for &'a CsMatBase<u32, I, IpStorage, IStorage, DStorage, Iptr>where I: 'a + SpIndex, Iptr: 'a + SpIndex, IpStorage: 'a + Deref<Target = [Iptr]>, IStorage: 'a + Deref<Target = [I]>, DStorage: 'a + Deref<Target = [u32]>,
source§impl<'a, I, Iptr, IpStorage, IStorage, DStorage> Mul<u64> for &'a CsMatBase<u64, I, IpStorage, IStorage, DStorage, Iptr>where
I: 'a + SpIndex,
Iptr: 'a + SpIndex,
IpStorage: 'a + Deref<Target = [Iptr]>,
IStorage: 'a + Deref<Target = [I]>,
DStorage: 'a + Deref<Target = [u64]>,
impl<'a, I, Iptr, IpStorage, IStorage, DStorage> Mul<u64> for &'a CsMatBase<u64, I, IpStorage, IStorage, DStorage, Iptr>where I: 'a + SpIndex, Iptr: 'a + SpIndex, IpStorage: 'a + Deref<Target = [Iptr]>, IStorage: 'a + Deref<Target = [I]>, DStorage: 'a + Deref<Target = [u64]>,
source§impl<'a, I, Iptr, IpStorage, IStorage, DStorage> Mul<u8> for &'a CsMatBase<u8, I, IpStorage, IStorage, DStorage, Iptr>where
I: 'a + SpIndex,
Iptr: 'a + SpIndex,
IpStorage: 'a + Deref<Target = [Iptr]>,
IStorage: 'a + Deref<Target = [I]>,
DStorage: 'a + Deref<Target = [u8]>,
impl<'a, I, Iptr, IpStorage, IStorage, DStorage> Mul<u8> for &'a CsMatBase<u8, I, IpStorage, IStorage, DStorage, Iptr>where I: 'a + SpIndex, Iptr: 'a + SpIndex, IpStorage: 'a + Deref<Target = [Iptr]>, IStorage: 'a + Deref<Target = [I]>, DStorage: 'a + Deref<Target = [u8]>,
source§impl<'a, I, Iptr, IpStorage, IStorage, DStorage> Mul<usize> for &'a CsMatBase<usize, I, IpStorage, IStorage, DStorage, Iptr>where
I: 'a + SpIndex,
Iptr: 'a + SpIndex,
IpStorage: 'a + Deref<Target = [Iptr]>,
IStorage: 'a + Deref<Target = [I]>,
DStorage: 'a + Deref<Target = [usize]>,
impl<'a, I, Iptr, IpStorage, IStorage, DStorage> Mul<usize> for &'a CsMatBase<usize, I, IpStorage, IStorage, DStorage, Iptr>where I: 'a + SpIndex, Iptr: 'a + SpIndex, IpStorage: 'a + Deref<Target = [Iptr]>, IStorage: 'a + Deref<Target = [I]>, DStorage: 'a + Deref<Target = [usize]>,
source§impl<'a, I, Iptr, IpStorage, IStorage, DStorage, T> MulAssign<T> for CsMatBase<T, I, IpStorage, IStorage, DStorage, Iptr>where
I: 'a + SpIndex,
Iptr: 'a + SpIndex,
IpStorage: 'a + Deref<Target = [Iptr]>,
IStorage: 'a + Deref<Target = [I]>,
DStorage: 'a + DerefMut<Target = [T]>,
T: MulAssign<T> + Clone,
impl<'a, I, Iptr, IpStorage, IStorage, DStorage, T> MulAssign<T> for CsMatBase<T, I, IpStorage, IStorage, DStorage, Iptr>where I: 'a + SpIndex, Iptr: 'a + SpIndex, IpStorage: 'a + Deref<Target = [Iptr]>, IStorage: 'a + Deref<Target = [I]>, DStorage: 'a + DerefMut<Target = [T]>, T: MulAssign<T> + Clone,
source§fn mul_assign(&mut self, rhs: T)
fn mul_assign(&mut self, rhs: T)
*=
operation. Read moresource§impl<N: PartialEq, I, IptrStorage, IndStorage, DataStorage, Iptr> PartialEq<CsMatBase<N, I, IptrStorage, IndStorage, DataStorage, Iptr>> for CsMatBase<N, I, IptrStorage, IndStorage, DataStorage, Iptr>where
I: SpIndex + PartialEq,
Iptr: SpIndex + PartialEq,
IptrStorage: Deref<Target = [Iptr]> + PartialEq,
IndStorage: Deref<Target = [I]> + PartialEq,
DataStorage: Deref<Target = [N]> + PartialEq,
impl<N: PartialEq, I, IptrStorage, IndStorage, DataStorage, Iptr> PartialEq<CsMatBase<N, I, IptrStorage, IndStorage, DataStorage, Iptr>> for CsMatBase<N, I, IptrStorage, IndStorage, DataStorage, Iptr>where I: SpIndex + PartialEq, Iptr: SpIndex + PartialEq, IptrStorage: Deref<Target = [Iptr]> + PartialEq, IndStorage: Deref<Target = [I]> + PartialEq, DataStorage: Deref<Target = [N]> + PartialEq,
source§impl<N, I, Iptr, IS1, DS1, ISptr1, IS2, ISptr2, DS2> RelativeEq<CsMatBase<N, I, ISptr2, IS2, DS2, Iptr>> for CsMatBase<N, I, ISptr1, IS1, DS1, Iptr>where
I: SpIndex,
Iptr: SpIndex,
CsMatBase<N, I, ISptr1, IS1, DS1, Iptr>: PartialEq<CsMatBase<N, I, ISptr2, IS2, DS2, Iptr>>,
IS1: Deref<Target = [I]>,
IS2: Deref<Target = [I]>,
ISptr1: Deref<Target = [Iptr]>,
ISptr2: Deref<Target = [Iptr]>,
DS1: Deref<Target = [N]>,
DS2: Deref<Target = [N]>,
N: RelativeEq + Zero,
N::Epsilon: Clone,
impl<N, I, Iptr, IS1, DS1, ISptr1, IS2, ISptr2, DS2> RelativeEq<CsMatBase<N, I, ISptr2, IS2, DS2, Iptr>> for CsMatBase<N, I, ISptr1, IS1, DS1, Iptr>where I: SpIndex, Iptr: SpIndex, CsMatBase<N, I, ISptr1, IS1, DS1, Iptr>: PartialEq<CsMatBase<N, I, ISptr2, IS2, DS2, Iptr>>, IS1: Deref<Target = [I]>, IS2: Deref<Target = [I]>, ISptr1: Deref<Target = [Iptr]>, ISptr2: Deref<Target = [Iptr]>, DS1: Deref<Target = [N]>, DS2: Deref<Target = [N]>, N: RelativeEq + Zero, N::Epsilon: Clone,
source§fn default_max_relative() -> N::Epsilon
fn default_max_relative() -> N::Epsilon
source§fn relative_eq(
&self,
other: &CsMatBase<N, I, ISptr2, IS2, DS2, Iptr>,
epsilon: N::Epsilon,
max_relative: Self::Epsilon
) -> bool
fn relative_eq( &self, other: &CsMatBase<N, I, ISptr2, IS2, DS2, Iptr>, epsilon: N::Epsilon, max_relative: Self::Epsilon ) -> bool
source§fn relative_ne(
&self,
other: &Rhs,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon
) -> bool
fn relative_ne( &self, other: &Rhs, epsilon: Self::Epsilon, max_relative: Self::Epsilon ) -> bool
RelativeEq::relative_eq
.source§impl<N, I, Iptr, IptrStorage, IStorage, DStorage> Serialize for CsMatBase<N, I, IptrStorage, IStorage, DStorage, Iptr>where
Iptr: Serialize + SpIndex,
I: Serialize + SpIndex,
N: Serialize,
IptrStorage: Deref<Target = [Iptr]>,
IStorage: Deref<Target = [I]>,
DStorage: Deref<Target = [N]>,
impl<N, I, Iptr, IptrStorage, IStorage, DStorage> Serialize for CsMatBase<N, I, IptrStorage, IStorage, DStorage, Iptr>where Iptr: Serialize + SpIndex, I: Serialize + SpIndex, N: Serialize, IptrStorage: Deref<Target = [Iptr]>, IStorage: Deref<Target = [I]>, DStorage: Deref<Target = [N]>,
source§impl<'a, N, I, Iptr, IpS, IS, DS> SparseMat for &'a CsMatBase<N, I, IpS, IS, DS, Iptr>where
I: 'a + SpIndex,
Iptr: 'a + SpIndex,
N: 'a,
IpS: Deref<Target = [Iptr]>,
IS: Deref<Target = [I]>,
DS: Deref<Target = [N]>,
impl<'a, N, I, Iptr, IpS, IS, DS> SparseMat for &'a CsMatBase<N, I, IpS, IS, DS, Iptr>where I: 'a + SpIndex, Iptr: 'a + SpIndex, N: 'a, IpS: Deref<Target = [Iptr]>, IS: Deref<Target = [I]>, DS: Deref<Target = [N]>,
source§impl<N, I, Iptr, IpS, IS, DS> SparseMat for CsMatBase<N, I, IpS, IS, DS, Iptr>where
I: SpIndex,
Iptr: SpIndex,
IpS: Deref<Target = [Iptr]>,
IS: Deref<Target = [I]>,
DS: Deref<Target = [N]>,
impl<N, I, Iptr, IpS, IS, DS> SparseMat for CsMatBase<N, I, IpS, IS, DS, Iptr>where I: SpIndex, Iptr: SpIndex, IpS: Deref<Target = [Iptr]>, IS: Deref<Target = [I]>, DS: Deref<Target = [N]>,
source§impl<'a, 'b, Lhs, Rhs, Res, I, Iptr, IpStorage, IStorage, DStorage, IpS2, IS2, DS2> Sub<&'b CsMatBase<Rhs, I, IpS2, IS2, DS2, Iptr>> for &'a CsMatBase<Lhs, I, IpStorage, IStorage, DStorage, Iptr>where
Lhs: Zero,
Rhs: Zero + Clone + Default,
Res: Zero + Clone,
for<'r> &'r Lhs: Sub<&'r Rhs, Output = Res>,
I: 'a + SpIndex,
Iptr: 'a + SpIndex,
IpStorage: 'a + Deref<Target = [Iptr]>,
IStorage: 'a + Deref<Target = [I]>,
DStorage: 'a + Deref<Target = [Lhs]>,
IpS2: 'a + Deref<Target = [Iptr]>,
IS2: 'a + Deref<Target = [I]>,
DS2: 'a + Deref<Target = [Rhs]>,
impl<'a, 'b, Lhs, Rhs, Res, I, Iptr, IpStorage, IStorage, DStorage, IpS2, IS2, DS2> Sub<&'b CsMatBase<Rhs, I, IpS2, IS2, DS2, Iptr>> for &'a CsMatBase<Lhs, I, IpStorage, IStorage, DStorage, Iptr>where Lhs: Zero, Rhs: Zero + Clone + Default, Res: Zero + Clone, for<'r> &'r Lhs: Sub<&'r Rhs, Output = Res>, I: 'a + SpIndex, Iptr: 'a + SpIndex, IpStorage: 'a + Deref<Target = [Iptr]>, IStorage: 'a + Deref<Target = [I]>, DStorage: 'a + Deref<Target = [Lhs]>, IpS2: 'a + Deref<Target = [Iptr]>, IS2: 'a + Deref<Target = [I]>, DS2: 'a + Deref<Target = [Rhs]>,
source§impl<N, I, Iptr, IS1, DS1, ISptr1, IS2, ISptr2, DS2> UlpsEq<CsMatBase<N, I, ISptr2, IS2, DS2, Iptr>> for CsMatBase<N, I, ISptr1, IS1, DS1, Iptr>where
I: SpIndex,
Iptr: SpIndex,
CsMatBase<N, I, ISptr1, IS1, DS1, Iptr>: PartialEq<CsMatBase<N, I, ISptr2, IS2, DS2, Iptr>>,
IS1: Deref<Target = [I]>,
IS2: Deref<Target = [I]>,
ISptr1: Deref<Target = [Iptr]>,
ISptr2: Deref<Target = [Iptr]>,
DS1: Deref<Target = [N]>,
DS2: Deref<Target = [N]>,
N: UlpsEq + Zero,
N::Epsilon: Clone,
impl<N, I, Iptr, IS1, DS1, ISptr1, IS2, ISptr2, DS2> UlpsEq<CsMatBase<N, I, ISptr2, IS2, DS2, Iptr>> for CsMatBase<N, I, ISptr1, IS1, DS1, Iptr>where I: SpIndex, Iptr: SpIndex, CsMatBase<N, I, ISptr1, IS1, DS1, Iptr>: PartialEq<CsMatBase<N, I, ISptr2, IS2, DS2, Iptr>>, IS1: Deref<Target = [I]>, IS2: Deref<Target = [I]>, ISptr1: Deref<Target = [Iptr]>, ISptr2: Deref<Target = [Iptr]>, DS1: Deref<Target = [N]>, DS2: Deref<Target = [N]>, N: UlpsEq + Zero, N::Epsilon: Clone,
source§fn default_max_ulps() -> u32
fn default_max_ulps() -> u32
impl<N: Copy, I, IptrStorage, IndStorage, DataStorage, Iptr> Copy for CsMatBase<N, I, IptrStorage, IndStorage, DataStorage, Iptr>where I: SpIndex + Copy, Iptr: SpIndex + Copy, IptrStorage: Deref<Target = [Iptr]> + Copy, IndStorage: Deref<Target = [I]> + Copy, DataStorage: Deref<Target = [N]> + Copy,
impl<N: Eq, I, IptrStorage, IndStorage, DataStorage, Iptr> Eq for CsMatBase<N, I, IptrStorage, IndStorage, DataStorage, Iptr>where I: SpIndex + Eq, Iptr: SpIndex + Eq, IptrStorage: Deref<Target = [Iptr]> + Eq, IndStorage: Deref<Target = [I]> + Eq, DataStorage: Deref<Target = [N]> + Eq,
impl<N, I, IptrStorage, IndStorage, DataStorage, Iptr> StructuralEq for CsMatBase<N, I, IptrStorage, IndStorage, DataStorage, Iptr>where I: SpIndex, Iptr: SpIndex, IptrStorage: Deref<Target = [Iptr]>, IndStorage: Deref<Target = [I]>, DataStorage: Deref<Target = [N]>,
impl<N, I, IptrStorage, IndStorage, DataStorage, Iptr> StructuralPartialEq for CsMatBase<N, I, IptrStorage, IndStorage, DataStorage, Iptr>where I: SpIndex, Iptr: SpIndex, IptrStorage: Deref<Target = [Iptr]>, IndStorage: Deref<Target = [I]>, DataStorage: Deref<Target = [N]>,
Auto Trait Implementations§
impl<N, I, IptrStorage, IndStorage, DataStorage, Iptr> RefUnwindSafe for CsMatBase<N, I, IptrStorage, IndStorage, DataStorage, Iptr>where DataStorage: RefUnwindSafe, IndStorage: RefUnwindSafe, IptrStorage: RefUnwindSafe,
impl<N, I, IptrStorage, IndStorage, DataStorage, Iptr> Send for CsMatBase<N, I, IptrStorage, IndStorage, DataStorage, Iptr>where DataStorage: Send, IndStorage: Send, IptrStorage: Send,
impl<N, I, IptrStorage, IndStorage, DataStorage, Iptr> Sync for CsMatBase<N, I, IptrStorage, IndStorage, DataStorage, Iptr>where DataStorage: Sync, IndStorage: Sync, IptrStorage: Sync,
impl<N, I, IptrStorage, IndStorage, DataStorage, Iptr> Unpin for CsMatBase<N, I, IptrStorage, IndStorage, DataStorage, Iptr>where DataStorage: Unpin, IndStorage: Unpin, IptrStorage: Unpin,
impl<N, I, IptrStorage, IndStorage, DataStorage, Iptr> UnwindSafe for CsMatBase<N, I, IptrStorage, IndStorage, DataStorage, Iptr>where DataStorage: UnwindSafe, IndStorage: UnwindSafe, IptrStorage: 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<T> Pointable for T
impl<T> Pointable for T
source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere SS: SubsetOf<SP>,
source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read moresource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).source§unsafe fn to_subset_unchecked(&self) -> SS
unsafe fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.