aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/MatrixBase.h
diff options
context:
space:
mode:
authorGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2007-09-05 11:39:42 +0000
committerGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2007-09-05 11:39:42 +0000
commit9477e62b68cd25e48d3e6e4cc5d9fa4cb61cd26f (patch)
treee73211fe46cb6db0f6cee5b417be5ee035849c21 /src/MatrixBase.h
parent13a82795f7aa79915b6accd0f097ae8d0fd801d3 (diff)
add a missing operator= for copying a matrix into an expression.
Diffstat (limited to 'src/MatrixBase.h')
-rw-r--r--src/MatrixBase.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/MatrixBase.h b/src/MatrixBase.h
index 8e2be915b..bcc747aca 100644
--- a/src/MatrixBase.h
+++ b/src/MatrixBase.h
@@ -211,6 +211,16 @@ class MatrixBase
MatrixBase() {};
};
+template<typename Content>
+template<typename Derived>
+void MatrixXpr<Content>::operator=(const MatrixBase<Derived>& matrix)
+{
+ assert(rows() == matrix.rows() && cols() == matrix.cols());
+ for(int i = 0; i < rows(); i++)
+ for(int j = 0; j < cols(); j++)
+ this->operator()(i, j) = matrix(i, j);
+}
+
template<typename Derived>
std::ostream & operator <<
( std::ostream & s,