diff options
author | Gael Guennebaud <g.gael@free.fr> | 2016-06-14 11:31:27 +0200 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2016-06-14 11:31:27 +0200 |
commit | bcc0f38f981f8efadeba314fb41e58f911c60ccc (patch) | |
tree | 65e503083e54ad2df973c10c6e0323b4d43d92e5 /Eigen/src/Core/functors/BinaryFunctors.h | |
parent | f57fd78e308c80d25b1f8c92ae8db2bdc5045a29 (diff) |
Add unittesting plugins to scalar_product_op and scalar_quotient_op to help chaking that types are properly propagated.
Diffstat (limited to 'Eigen/src/Core/functors/BinaryFunctors.h')
-rw-r--r-- | Eigen/src/Core/functors/BinaryFunctors.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Eigen/src/Core/functors/BinaryFunctors.h b/Eigen/src/Core/functors/BinaryFunctors.h index 637514a20..77e9e6e93 100644 --- a/Eigen/src/Core/functors/BinaryFunctors.h +++ b/Eigen/src/Core/functors/BinaryFunctors.h @@ -70,7 +70,13 @@ template<typename LhsScalar,typename RhsScalar> struct scalar_product_op : binary_op_base<LhsScalar,RhsScalar> { typedef typename ScalarBinaryOpTraits<LhsScalar,RhsScalar,scalar_product_op>::ReturnType result_type; +#ifndef EIGEN_SCALAR_BINARY_OP_PLUGIN EIGEN_EMPTY_STRUCT_CTOR(scalar_product_op) +#else + scalar_product_op() { + EIGEN_SCALAR_BINARY_OP_PLUGIN + } +#endif EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const result_type operator() (const LhsScalar& a, const RhsScalar& b) const { return a * b; } template<typename Packet> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Packet packetOp(const Packet& a, const Packet& b) const @@ -332,7 +338,13 @@ template<typename LhsScalar,typename RhsScalar> struct scalar_quotient_op : binary_op_base<LhsScalar,RhsScalar> { typedef typename ScalarBinaryOpTraits<LhsScalar,RhsScalar,scalar_quotient_op>::ReturnType result_type; +#ifndef EIGEN_SCALAR_BINARY_OP_PLUGIN EIGEN_EMPTY_STRUCT_CTOR(scalar_quotient_op) +#else + scalar_quotient_op() { + EIGEN_SCALAR_BINARY_OP_PLUGIN + } +#endif EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const result_type operator() (const LhsScalar& a, const RhsScalar& b) const { return a / b; } template<typename Packet> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Packet packetOp(const Packet& a, const Packet& b) const |