mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Add free-function swap.
This commit is contained in:
committed by
Rasmus Munk Larsen
parent
820e8a45fb
commit
b396a6fbb2
@@ -829,6 +829,8 @@ class SparseMatrix : public SparseCompressedBase<SparseMatrix<Scalar_, Options_,
|
||||
std::swap(m_innerNonZeros, other.m_innerNonZeros);
|
||||
m_data.swap(other.m_data);
|
||||
}
|
||||
/** Free-function swap. */
|
||||
friend EIGEN_DEVICE_FUNC void swap(SparseMatrix& a, SparseMatrix& b) { a.swap(b); }
|
||||
|
||||
/** Sets *this to the identity matrix.
|
||||
* This function also turns the matrix into compressed mode, and drop any reserved memory. */
|
||||
|
||||
Reference in New Issue
Block a user