aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/SparseCore/SparseVector.h
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2016-11-06 15:15:03 +0100
committerGravatar Gael Guennebaud <g.gael@free.fr>2016-11-06 15:15:03 +0100
commit4d226ab5b546dad7ca394428af851e32b52a344d (patch)
treeef57ab3e05cba5769e4998523e9d51946b76cd60 /Eigen/src/SparseCore/SparseVector.h
parentad086b03e48cfae20697cc0b9af6debba26fdc0d (diff)
Enable swapping between SparseMatrix and SparseVector
Diffstat (limited to 'Eigen/src/SparseCore/SparseVector.h')
-rw-r--r--Eigen/src/SparseCore/SparseVector.h8
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())