aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/Core/Product.h
diff options
context:
space:
mode:
Diffstat (limited to 'Eigen/src/Core/Product.h')
-rw-r--r--Eigen/src/Core/Product.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/Eigen/src/Core/Product.h b/Eigen/src/Core/Product.h
index 3b8fd7d9a..b37fd2ff7 100644
--- a/Eigen/src/Core/Product.h
+++ b/Eigen/src/Core/Product.h
@@ -79,6 +79,12 @@ class Product : public ProductImpl<_Lhs,_Rhs,Option,
const LhsNestedCleaned& lhs() const { return m_lhs; }
const RhsNestedCleaned& rhs() const { return m_rhs; }
+
+ /** Convertion to scalar for inner-products */
+ operator const Scalar() const {
+ EIGEN_STATIC_ASSERT(SizeAtCompileTime==1, IMPLICIT_CONVERSION_TO_SCALAR_IS_FOR_INNER_PRODUCT_ONLY);
+ return typename internal::evaluator<Product>::type(*this).coeff(0,0);
+ }
protected: