aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/plugins/MatrixCwiseBinaryOps.h
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2009-12-10 22:00:35 +0100
committerGravatar Gael Guennebaud <g.gael@free.fr>2009-12-10 22:00:35 +0100
commit7caf751fddf51aacb1a2fbea8f2a92bd3492b0e1 (patch)
tree2936cb411e9cbc9f92da91f9d53c886530e7b1e3 /Eigen/src/plugins/MatrixCwiseBinaryOps.h
parent8e05f9cfa1538d76a9d3e01e08ba565bd581806a (diff)
adapt select, replicate and reverse
Diffstat (limited to 'Eigen/src/plugins/MatrixCwiseBinaryOps.h')
-rw-r--r--Eigen/src/plugins/MatrixCwiseBinaryOps.h19
1 files changed, 17 insertions, 2 deletions
diff --git a/Eigen/src/plugins/MatrixCwiseBinaryOps.h b/Eigen/src/plugins/MatrixCwiseBinaryOps.h
index 74b7a5610..2b9621977 100644
--- a/Eigen/src/plugins/MatrixCwiseBinaryOps.h
+++ b/Eigen/src/plugins/MatrixCwiseBinaryOps.h
@@ -32,13 +32,28 @@
*
* \sa class CwiseBinaryOp, cwiseAbs2
*/
+
+#define EIGEN_CWISE_PRODUCT_RETURN_TYPE \
+ CwiseBinaryOp< \
+ ei_scalar_product_op< \
+ typename ei_scalar_product_traits< \
+ typename ei_traits<Derived>::Scalar, \
+ typename ei_traits<OtherDerived>::Scalar \
+ >::ReturnType \
+ >, \
+ Derived, \
+ OtherDerived \
+ >
+
template<typename OtherDerived>
-EIGEN_STRONG_INLINE const CwiseBinaryOp<ei_scalar_product_op<Scalar>, Derived, OtherDerived>
+EIGEN_STRONG_INLINE const EIGEN_CWISE_PRODUCT_RETURN_TYPE
cwiseProduct(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived> &other) const
{
- return CwiseBinaryOp<ei_scalar_product_op<Scalar>, Derived, OtherDerived>(derived(), other.derived());
+ return EIGEN_CWISE_PRODUCT_RETURN_TYPE(derived(), other.derived());
}
+#undef EIGEN_CWISE_PRODUCT_RETURN_TYPE
+
/** \returns an expression of the coefficient-wise == operator of *this and \a other
*
* \warning this performs an exact comparison, which is generally a bad idea with floating-point types.