Impl Csr/CscMatrix::into_pattern_and_values
This commit is contained in:
parent
e655fed4fa
commit
c43a2b1679
|
@ -93,6 +93,11 @@ impl<T> CsMatrix<T> {
|
||||||
(offsets, indices, self.values)
|
(offsets, indices, self.values)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline]
|
||||||
|
pub fn into_pattern_and_values(self) -> (SparsityPattern, Vec<T>) {
|
||||||
|
(self.sparsity_pattern, self.values)
|
||||||
|
}
|
||||||
|
|
||||||
/// Returns an entry for the given major/minor indices, or `None` if the indices are out
|
/// Returns an entry for the given major/minor indices, or `None` if the indices are out
|
||||||
/// of bounds.
|
/// of bounds.
|
||||||
pub fn get_entry(&self, major_index: usize, minor_index: usize) -> Option<SparseEntry<T>> {
|
pub fn get_entry(&self, major_index: usize, minor_index: usize) -> Option<SparseEntry<T>> {
|
||||||
|
|
|
@ -252,6 +252,11 @@ impl<T> CscMatrix<T> {
|
||||||
self.cs.disassemble()
|
self.cs.disassemble()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Returns the sparsity pattern and values associated with this matrix.
|
||||||
|
pub fn into_pattern_and_values(self) -> (SparsityPattern, Vec<T>) {
|
||||||
|
self.cs.into_pattern_and_values()
|
||||||
|
}
|
||||||
|
|
||||||
/// Returns the underlying sparsity pattern.
|
/// Returns the underlying sparsity pattern.
|
||||||
///
|
///
|
||||||
/// The sparsity pattern is stored internally inside an `Arc`. This allows users to re-use
|
/// The sparsity pattern is stored internally inside an `Arc`. This allows users to re-use
|
||||||
|
|
|
@ -254,6 +254,11 @@ impl<T> CsrMatrix<T> {
|
||||||
self.cs.disassemble()
|
self.cs.disassemble()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Returns the sparsity pattern and values associated with this matrix.
|
||||||
|
pub fn into_pattern_and_values(self) -> (SparsityPattern, Vec<T>) {
|
||||||
|
self.cs.into_pattern_and_values()
|
||||||
|
}
|
||||||
|
|
||||||
/// Returns the underlying sparsity pattern.
|
/// Returns the underlying sparsity pattern.
|
||||||
///
|
///
|
||||||
/// The sparsity pattern is stored internally inside an `Arc`. This allows users to re-use
|
/// The sparsity pattern is stored internally inside an `Arc`. This allows users to re-use
|
||||||
|
|
Loading…
Reference in New Issue