diff options
author | Benoit Jacob <jacob.benoit.1@gmail.com> | 2007-09-05 11:39:42 +0000 |
---|---|---|
committer | Benoit Jacob <jacob.benoit.1@gmail.com> | 2007-09-05 11:39:42 +0000 |
commit | 9477e62b68cd25e48d3e6e4cc5d9fa4cb61cd26f (patch) | |
tree | e73211fe46cb6db0f6cee5b417be5ee035849c21 /src/MatrixBase.h | |
parent | 13a82795f7aa79915b6accd0f097ae8d0fd801d3 (diff) |
add a missing operator= for copying a matrix into an expression.
Diffstat (limited to 'src/MatrixBase.h')
-rw-r--r-- | src/MatrixBase.h | 10 |
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, |