diff options
Diffstat (limited to 'Eigen/src/Core/Product.h')
-rw-r--r-- | Eigen/src/Core/Product.h | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/Eigen/src/Core/Product.h b/Eigen/src/Core/Product.h index d64fbae35..12726ed12 100644 --- a/Eigen/src/Core/Product.h +++ b/Eigen/src/Core/Product.h @@ -109,16 +109,6 @@ public: { return typename internal::evaluator<ProductXpr>::type(derived()).coeff(0,0); } - - Scalar coeff(Index row, Index col) const - { - return typename internal::evaluator<ProductXpr>::type(derived()).coeff(row,col); - } - - Scalar coeff(Index i) const - { - return typename internal::evaluator<ProductXpr>::type(derived()).coeff(i); - } }; } // namespace internal @@ -132,6 +122,22 @@ class ProductImpl<Lhs,Rhs,Option,Dense> typedef typename internal::dense_product_base<Lhs, Rhs, Option> Base; EIGEN_DENSE_PUBLIC_INTERFACE(Derived) + + Scalar coeff(Index row, Index col) const + { + EIGEN_STATIC_ASSERT_SIZE_1x1(Derived) + eigen_assert(this->rows() == 1 && this->cols() == 1); + + return typename internal::evaluator<Derived>::type(derived()).coeff(row,col); + } + + Scalar coeff(Index i) const + { + EIGEN_STATIC_ASSERT_SIZE_1x1(Derived) + eigen_assert(this->rows() == 1 && this->cols() == 1); + + return typename internal::evaluator<Derived>::type(derived()).coeff(i); + } }; /*************************************************************************** |