aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/Core/Matrix.h
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2008-07-02 16:05:33 +0000
committerGravatar Gael Guennebaud <g.gael@free.fr>2008-07-02 16:05:33 +0000
commit8463b7d3f4ba6b94d79503d30b7822f064adbb08 (patch)
tree5d03ec7ad2a7722fd0bc9520fdb38477f50f2f0f /Eigen/src/Core/Matrix.h
parent9433df83a773d3ccfe0a481ae36e5e3a6e60fd50 (diff)
* fix compilation issue in Product
* added some tests for product and swap * overload .swap() for dynamic-sized matrix of same size
Diffstat (limited to 'Eigen/src/Core/Matrix.h')
-rw-r--r--Eigen/src/Core/Matrix.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/Eigen/src/Core/Matrix.h b/Eigen/src/Core/Matrix.h
index 5074ea88f..379b5e1f4 100644
--- a/Eigen/src/Core/Matrix.h
+++ b/Eigen/src/Core/Matrix.h
@@ -346,6 +346,17 @@ class Matrix : public MatrixBase<Matrix<_Scalar, _Rows, _Cols, _MaxRows, _MaxCol
{
return *this;
}
+
+ /** Override MatrixBase::swap() since for dynamic-sized matrices of same type it is enough to swap the
+ * data pointers.
+ */
+ void swap(Matrix& other)
+ {
+ if (Base::SizeAtCompileTime==Dynamic)
+ m_storage.swap(other.m_storage);
+ else
+ this->Base::swap(other);
+ }
};
#define EIGEN_MAKE_TYPEDEFS(Type, TypeSuffix, Size, SizeSuffix) \