diff options
author | 2016-11-06 15:15:03 +0100 | |
---|---|---|
committer | 2016-11-06 15:15:03 +0100 | |
commit | 4d226ab5b546dad7ca394428af851e32b52a344d (patch) | |
tree | ef57ab3e05cba5769e4998523e9d51946b76cd60 /Eigen/src/SparseCore/SparseVector.h | |
parent | ad086b03e48cfae20697cc0b9af6debba26fdc0d (diff) |
Enable swapping between SparseMatrix and SparseVector
Diffstat (limited to 'Eigen/src/SparseCore/SparseVector.h')
-rw-r--r-- | Eigen/src/SparseCore/SparseVector.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Eigen/src/SparseCore/SparseVector.h b/Eigen/src/SparseCore/SparseVector.h index 00ee6ec89..7a3d88c38 100644 --- a/Eigen/src/SparseCore/SparseVector.h +++ b/Eigen/src/SparseCore/SparseVector.h @@ -290,6 +290,14 @@ class SparseVector m_data.swap(other.m_data); } + template<int OtherOptions> + inline void swap(SparseMatrix<Scalar,OtherOptions,StorageIndex>& other) + { + eigen_assert(other.outerSize()==1); + std::swap(m_size, other.m_innerSize); + m_data.swap(other.m_data); + } + inline SparseVector& operator=(const SparseVector& other) { if (other.isRValue()) |