From 7518201de8e4515bc60c9c68e3d1f7b974d3a24c Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Wed, 25 Jul 2012 23:03:10 +0200 Subject: [PATCH] SparseMatrix: add missing ctor for ReturnByValue --- Eigen/src/SparseCore/SparseMatrix.h | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Eigen/src/SparseCore/SparseMatrix.h b/Eigen/src/SparseCore/SparseMatrix.h index 0a53ecbea..743fa3afc 100644 --- a/Eigen/src/SparseCore/SparseMatrix.h +++ b/Eigen/src/SparseCore/SparseMatrix.h @@ -637,6 +637,16 @@ class SparseMatrix *this = other.derived(); } + /** \brief Copy constructor with in-place evaluation */ + template + SparseMatrix(const ReturnByValue& other) + : Base(), m_outerSize(0), m_innerSize(0), m_outerIndex(0), m_innerNonZeros(0) + { + check_template_parameters(); + initAssignment(other); + other.evalTo(*this); + } + /** Swaps the content of two sparse matrices of the same type. * This is a fast operation that simply swaps the underlying pointers and parameters. */ inline void swap(SparseMatrix& other) @@ -678,7 +688,10 @@ class SparseMatrix template inline SparseMatrix& operator=(const ReturnByValue& other) - { return Base::operator=(other.derived()); } + { + initAssignment(other); + return Base::operator=(other.derived()); + } template inline SparseMatrix& operator=(const EigenBase& other)