diff options
Diffstat (limited to 'Eigen/src')
-rw-r--r-- | Eigen/src/Core/ProductBase.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Eigen/src/Core/ProductBase.h b/Eigen/src/Core/ProductBase.h index 8dccf6418..6cf02a649 100644 --- a/Eigen/src/Core/ProductBase.h +++ b/Eigen/src/Core/ProductBase.h @@ -154,7 +154,8 @@ class ProductBase : public MatrixBase<Derived> #else EIGEN_STATIC_ASSERT_SIZE_1x1(Derived) eigen_assert(this->rows() == 1 && this->cols() == 1); - return derived().coeff(row,col); + Matrix<Scalar,1,1> result = *this; + return result.coeff(row,col); #endif } @@ -162,7 +163,8 @@ class ProductBase : public MatrixBase<Derived> { EIGEN_STATIC_ASSERT_SIZE_1x1(Derived) eigen_assert(this->rows() == 1 && this->cols() == 1); - return derived().coeff(i); + Matrix<Scalar,1,1> result = *this; + return result.coeff(i); } const Scalar& coeffRef(Index row, Index col) const |