Struct sprs::CsMatBase[][src]

pub struct CsMatBase<N, I, IptrStorage, IndStorage, DataStorage> where
    I: SpIndex,
    IptrStorage: Deref<Target = [I]>,
    IndStorage: Deref<Target = [I]>,
    DataStorage: Deref<Target = [N]>, 
{ /* fields omitted */ }

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.

Methods

impl<N, I: SpIndex> CsMatBase<N, I, Vec<I>, Vec<I>, Vec<N>>
[src]

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);

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);

Create an empty CsMat for building purposes

Create a new CsMat representing the zero matrix. Hence it has no non-zero elements.

Reserve the storage for the given additional number of nonzero data

Reserve the storage for the given additional number of nonzero data

Reserve the storage for the given number of nonzero data

Reserve the storage for the given number of nonzero data

Create an owned CSR matrix from moved data.

An owned CSC matrix can be created with new_csc().

If necessary, the indices will be sorted in place.

Contrary to the other CsMat constructors, this method will not return an Err when receiving malformed data. This is because the caller can take any measure to provide correct data since he owns it. Therefore, passing in malformed data is a programming error. However, passing in unsorted indices is not seen as a programming error, so this method can take advantage of ownership to sort them.

Panics

  • if indptr does not correspond to the number of rows.
  • if indices and data don't have exactly indptr[rows] elements.
  • if indices contains values greater or equal to the number of columns.

Create an owned CSC matrix from moved data.

An owned CSC matrix can be created with new_csc().

If necessary, the indices will be sorted in place.

Contrary to the other CsMat constructors, this method will not return an Err when receiving malformed data. This is because the caller can take any measure to provide correct data since he owns it. Therefore, passing in malformed data is a programming error. However, passing in unsorted indices is not seen as a programming error, so this method can take advantage of ownership to sort them.

Panics

  • if indptr does not correspond to the number of rows.
  • if indices and data don't have exactly indptr[rows] elements.
  • if indices contains values greater or equal to the number of columns.

Append an outer dim to an existing matrix, compressing it in the process

Append an outer dim to an existing matrix, provided by a sparse vector

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.

impl<'a, N: 'a, I: 'a + SpIndex> CsMatBase<N, I, &'a [I], &'a [I], &'a [N]>
[src]

Constructor methods for sparse matrix views

These constructors can be used to create views over non-matrix data such as slices.

Create a borrowed CsMat matrix from sliced data, checking their validity

Create a borrowed CsMat matrix from raw data, without checking their validity

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.

Get a view into count contiguous outer dimensions, starting from i.

eg this gets the rows from i to i + count in a CSR matrix

Get an iterator that yields the non-zero locations and values stored in this matrix, in the fastest iteration order.

This method will yield the correct lifetime for iterating over a sparse matrix view.

impl<N, I, IptrStorage, IndStorage, DataStorage> CsMatBase<N, I, IptrStorage, IndStorage, DataStorage> where
    I: SpIndex,
    IptrStorage: Deref<Target = [I]>,
    IndStorage: Deref<Target = [I]>,
    DataStorage: Deref<Target = [N]>, 
[src]

The underlying storage of this matrix

The number of rows of this matrix

The number of cols of this matrix

The shape of the matrix. Equivalent to let shape = (a.rows(), a.cols()).

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.

Number of outer dimensions, that ie equal to self.rows() for a CSR matrix, and equal to self.cols() for a CSC matrix

Number of inner dimensions, that ie equal to self.cols() for a CSR matrix, and equal to self.rows() for a CSC matrix

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.

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 loc = eye.indptr()[3];
assert_eq!(eye.indptr()[4], loc + 1);
assert_eq!(loc, 3);
assert_eq!(eye.indices()[loc], 3);
assert_eq!(eye.data()[loc], 1.);

The inner dimension location for each non-zero value. See the documentation of indptr() for more explanations.

The non-zero values. See the documentation of indptr() for more explanations.

Test whether the matrix is in CSC storage

Test whether the matrix is in CSR storage

Transpose a matrix in place No allocation required (this is simply a storage order change)

Transpose a matrix in place No allocation required (this is simply a storage order change)

Transposed view of this matrix No allocation required (this is simply a storage order change)

Get an owned version of this matrix. If the matrix was already owned, this will make a deep copy.

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.

Return a view into the current matrix

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.);
}

Return an outer iterator over PA, as well as the proper permutation for iterating over the inner dimension of PA*P^T Unstable

Get a view into the i-th outer dimension (eg i-th row for a CSR matrix)

Iteration on outer blocks of size block_size

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.

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.

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.

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()

Get an iterator that yields the non-zero locations and values stored in this matrix, in the fastest iteration order.

impl<N, I, IptrStorage, IndStorage, DataStorage> CsMatBase<N, I, IptrStorage, IndStorage, DataStorage> where
    N: Default,
    I: SpIndex,
    IptrStorage: Deref<Target = [I]>,
    IndStorage: Deref<Target = [I]>,
    DataStorage: Deref<Target = [N]>, 
[src]

Create a matrix mathematically equal to this one, but with the opposed storage (a CSC matrix will be converted to CSR, and vice versa)

Create a new CSC matrix equivalent to this one. A new matrix will be created even if this matrix was already CSC.

Create a new CSR matrix equivalent to this one. A new matrix will be created even if this matrix was already CSR.

impl<N, I, IptrStorage, IndStorage, DataStorage> CsMatBase<N, I, IptrStorage, IndStorage, DataStorage> where
    I: SpIndex,
    IptrStorage: Deref<Target = [I]>,
    IndStorage: Deref<Target = [I]>,
    DataStorage: DerefMut<Target = [N]>, 
[src]

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

Sparse matrix self-multiplication by a scalar

Get a mutable view into the i-th outer dimension (eg i-th row for a CSR matrix)

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

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.

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

Apply a function to every non-zero element

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.

impl<N, I, IptrStorage, IndStorage, DataStorage> CsMatBase<N, I, IptrStorage, IndStorage, DataStorage> where
    I: SpIndex,
    IptrStorage: DerefMut<Target = [I]>,
    IndStorage: DerefMut<Target = [I]>,
    DataStorage: DerefMut<Target = [N]>, 
[src]

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.;
});

impl<'a, N: 'a, I: 'a + SpIndex> CsMatBase<N, I, Vec<I>, &'a [I], &'a [N]>
[src]

Create a borrowed row or column CsMat matrix from raw data, without checking their validity

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.

Trait Implementations

impl<'a, 'b, N, I, IpStorage, IStorage, DStorage, IpS2, IS2, DS2> Add<&'b CsMatBase<N, I, IpS2, IS2, DS2>> for &'a CsMatBase<N, I, IpStorage, IStorage, DStorage> where
    N: 'a + Copy + Num + Default,
    I: 'a + SpIndex,
    IpStorage: 'a + Deref<Target = [I]>,
    IStorage: 'a + Deref<Target = [I]>,
    DStorage: 'a + Deref<Target = [N]>,
    IpS2: 'a + Deref<Target = [I]>,
    IS2: 'a + Deref<Target = [I]>,
    DS2: 'a + Deref<Target = [N]>, 
[src]

The resulting type after applying the + operator.

Performs the + operation.

impl<'a, 'b, N, I, IpStorage, IStorage, DStorage, Mat> Sub<&'b Mat> for &'a CsMatBase<N, I, IpStorage, IStorage, DStorage> where
    N: 'a + Copy + Num + Default,
    I: 'a + SpIndex,
    IpStorage: 'a + Deref<Target = [I]>,
    IStorage: 'a + Deref<Target = [I]>,
    DStorage: 'a + Deref<Target = [N]>,
    Mat: SpMatView<N, I>, 
[src]

The resulting type after applying the - operator.

Performs the - operation.

impl<'a, I, IpStorage, IStorage, DStorage> Mul<u32> for &'a CsMatBase<u32, I, IpStorage, IStorage, DStorage> where
    I: 'a + SpIndex,
    IpStorage: 'a + Deref<Target = [I]>,
    IStorage: 'a + Deref<Target = [I]>,
    DStorage: 'a + Deref<Target = [u32]>, 
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl<'a, I, IpStorage, IStorage, DStorage> Mul<i32> for &'a CsMatBase<i32, I, IpStorage, IStorage, DStorage> where
    I: 'a + SpIndex,
    IpStorage: 'a + Deref<Target = [I]>,
    IStorage: 'a + Deref<Target = [I]>,
    DStorage: 'a + Deref<Target = [i32]>, 
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl<'a, I, IpStorage, IStorage, DStorage> Mul<u64> for &'a CsMatBase<u64, I, IpStorage, IStorage, DStorage> where
    I: 'a + SpIndex,
    IpStorage: 'a + Deref<Target = [I]>,
    IStorage: 'a + Deref<Target = [I]>,
    DStorage: 'a + Deref<Target = [u64]>, 
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl<'a, I, IpStorage, IStorage, DStorage> Mul<i64> for &'a CsMatBase<i64, I, IpStorage, IStorage, DStorage> where
    I: 'a + SpIndex,
    IpStorage: 'a + Deref<Target = [I]>,
    IStorage: 'a + Deref<Target = [I]>,
    DStorage: 'a + Deref<Target = [i64]>, 
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl<'a, I, IpStorage, IStorage, DStorage> Mul<isize> for &'a CsMatBase<isize, I, IpStorage, IStorage, DStorage> where
    I: 'a + SpIndex,
    IpStorage: 'a + Deref<Target = [I]>,
    IStorage: 'a + Deref<Target = [I]>,
    DStorage: 'a + Deref<Target = [isize]>, 
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl<'a, I, IpStorage, IStorage, DStorage> Mul<usize> for &'a CsMatBase<usize, I, IpStorage, IStorage, DStorage> where
    I: 'a + SpIndex,
    IpStorage: 'a + Deref<Target = [I]>,
    IStorage: 'a + Deref<Target = [I]>,
    DStorage: 'a + Deref<Target = [usize]>, 
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl<'a, I, IpStorage, IStorage, DStorage> Mul<f32> for &'a CsMatBase<f32, I, IpStorage, IStorage, DStorage> where
    I: 'a + SpIndex,
    IpStorage: 'a + Deref<Target = [I]>,
    IStorage: 'a + Deref<Target = [I]>,
    DStorage: 'a + Deref<Target = [f32]>, 
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl<'a, I, IpStorage, IStorage, DStorage> Mul<f64> for &'a CsMatBase<f64, I, IpStorage, IStorage, DStorage> where
    I: 'a + SpIndex,
    IpStorage: 'a + Deref<Target = [I]>,
    IStorage: 'a + Deref<Target = [I]>,
    DStorage: 'a + Deref<Target = [f64]>, 
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl<'a, 'b, N, I, IpS1, IS1, DS1, IpS2, IS2, DS2> Mul<&'b CsMatBase<N, I, IpS2, IS2, DS2>> for &'a CsMatBase<N, I, IpS1, IS1, DS1> where
    N: 'a + Copy + Num + Default,
    I: 'a + SpIndex,
    IpS1: 'a + Deref<Target = [I]>,
    IS1: 'a + Deref<Target = [I]>,
    DS1: 'a + Deref<Target = [N]>,
    IpS2: 'b + Deref<Target = [I]>,
    IS2: 'b + Deref<Target = [I]>,
    DS2: 'b + Deref<Target = [N]>, 
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl<'a, 'b, N, I, IpS, IS, DS, DS2> Add<&'b ArrayBase<DS2, Ix2>> for &'a CsMatBase<N, I, IpS, IS, DS> where
    N: 'a + Copy + Num + Default,
    I: 'a + SpIndex,
    IpS: 'a + Deref<Target = [I]>,
    IS: 'a + Deref<Target = [I]>,
    DS: 'a + Deref<Target = [N]>,
    DS2: 'b + Data<Elem = N>, 
[src]

The resulting type after applying the + operator.

Performs the + operation.

impl<'a, 'b, N, I, IpS, IS, DS, DS2> Mul<&'b ArrayBase<DS2, Ix2>> for &'a CsMatBase<N, I, IpS, IS, DS> where
    N: 'a + Copy + Num + Default,
    I: 'a + SpIndex,
    IpS: 'a + Deref<Target = [I]>,
    IS: 'a + Deref<Target = [I]>,
    DS: 'a + Deref<Target = [N]>,
    DS2: 'b + Data<Elem = N>, 
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl<'a, 'b, N, I, IpS, IS, DS, DS2> Mul<&'b ArrayBase<DS2, Ix1>> for &'a CsMatBase<N, I, IpS, IS, DS> where
    N: 'a + Copy + Num + Default,
    I: 'a + SpIndex,
    IpS: 'a + Deref<Target = [I]>,
    IS: 'a + Deref<Target = [I]>,
    DS: 'a + Deref<Target = [N]>,
    DS2: 'b + Data<Elem = N>, 
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl<N, I, IpS, IS, DS> Index<[usize; 2]> for CsMatBase<N, I, IpS, IS, DS> where
    I: SpIndex,
    IpS: Deref<Target = [I]>,
    IS: Deref<Target = [I]>,
    DS: Deref<Target = [N]>, 
[src]

The returned type after indexing.

Performs the indexing (container[index]) operation.

impl<N, I, IpS, IS, DS> IndexMut<[usize; 2]> for CsMatBase<N, I, IpS, IS, DS> where
    I: SpIndex,
    IpS: Deref<Target = [I]>,
    IS: Deref<Target = [I]>,
    DS: DerefMut<Target = [N]>, 
[src]

Performs the mutable indexing (container[index]) operation.

impl<N, I, IpS, IS, DS> SparseMat for CsMatBase<N, I, IpS, IS, DS> where
    I: SpIndex,
    IpS: Deref<Target = [I]>,
    IS: Deref<Target = [I]>,
    DS: Deref<Target = [N]>, 
[src]

The number of rows of this matrix

The number of columns of this matrix

The number of nonzeros of this matrix

impl<'a, N, I, IpS, IS, DS> SparseMat for &'a CsMatBase<N, I, IpS, IS, DS> where
    I: 'a + SpIndex,
    N: 'a,
    IpS: Deref<Target = [I]>,
    IS: Deref<Target = [I]>,
    DS: Deref<Target = [N]>, 
[src]

The number of rows of this matrix

The number of columns of this matrix

The number of nonzeros of this matrix

impl<'a, N, I, IpS, IS, DS> IntoIterator for &'a CsMatBase<N, I, IpS, IS, DS> where
    I: 'a + SpIndex,
    N: 'a,
    IpS: Deref<Target = [I]>,
    IS: Deref<Target = [I]>,
    DS: Deref<Target = [N]>, 
[src]

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Creates an iterator from a value. Read more

impl<'a, 'b, N, I, IS1, DS1, IpS2, IS2, DS2> Mul<&'b CsMatBase<N, I, IpS2, IS2, DS2>> for &'a CsVecBase<IS1, DS1> where
    N: 'a + Copy + Num + Default,
    I: 'a + SpIndex,
    IS1: 'a + Deref<Target = [I]>,
    DS1: 'a + Deref<Target = [N]>,
    IpS2: 'b + Deref<Target = [I]>,
    IS2: 'b + Deref<Target = [I]>,
    DS2: 'b + Deref<Target = [N]>, 
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl<'a, 'b, N, I, IpS1, IS1, DS1, IS2, DS2> Mul<&'b CsVecBase<IS2, DS2>> for &'a CsMatBase<N, I, IpS1, IS1, DS1> where
    N: Copy + Num + Default + Sum,
    I: SpIndex,
    IpS1: Deref<Target = [I]>,
    IS1: Deref<Target = [I]>,
    DS1: Deref<Target = [N]>,
    IS2: Deref<Target = [I]>,
    DS2: Deref<Target = [N]>, 
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl<N: PartialEq, I: PartialEq, IptrStorage: PartialEq, IndStorage: PartialEq, DataStorage: PartialEq> PartialEq for CsMatBase<N, I, IptrStorage, IndStorage, DataStorage> where
    I: SpIndex,
    IptrStorage: Deref<Target = [I]>,
    IndStorage: Deref<Target = [I]>,
    DataStorage: Deref<Target = [N]>, 
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl<N: Debug, I: Debug, IptrStorage: Debug, IndStorage: Debug, DataStorage: Debug> Debug for CsMatBase<N, I, IptrStorage, IndStorage, DataStorage> where
    I: SpIndex,
    IptrStorage: Deref<Target = [I]>,
    IndStorage: Deref<Target = [I]>,
    DataStorage: Deref<Target = [N]>, 
[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl<N, I, IptrStorage, IndStorage, DataStorage> Send for CsMatBase<N, I, IptrStorage, IndStorage, DataStorage> where
    DataStorage: Send,
    IndStorage: Send,
    IptrStorage: Send

impl<N, I, IptrStorage, IndStorage, DataStorage> Sync for CsMatBase<N, I, IptrStorage, IndStorage, DataStorage> where
    DataStorage: Sync,
    IndStorage: Sync,
    IptrStorage: Sync