diff options
author | Gael Guennebaud <g.gael@free.fr> | 2016-06-02 22:16:37 +0200 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2016-06-02 22:16:37 +0200 |
commit | 2c00ac0b53a207b1bcc303d3e02ded2edb8ca021 (patch) | |
tree | 4d46b297350f496ef8de2f04e4e3c970c3da1d2a /Eigen/src/Core/util/XprHelper.h | |
parent | 8b6f53222b84d1e4f0f1e86b1d321777b58a28dc (diff) |
Implement generic scalar*expr and expr*scalar operator based on scalar_product_traits.
This is especially useful for custom scalar types, e.g., to enable float*expr<multi_prec> without conversion.
Diffstat (limited to 'Eigen/src/Core/util/XprHelper.h')
-rw-r--r-- | Eigen/src/Core/util/XprHelper.h | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/Eigen/src/Core/util/XprHelper.h b/Eigen/src/Core/util/XprHelper.h index 58723d860..8a7e36253 100644 --- a/Eigen/src/Core/util/XprHelper.h +++ b/Eigen/src/Core/util/XprHelper.h @@ -466,34 +466,6 @@ struct special_scalar_op_base : public BaseType template<typename Derived,typename Scalar,typename OtherScalar, typename BaseType> struct special_scalar_op_base<Derived,Scalar,OtherScalar,BaseType,true> : public BaseType { - const CwiseUnaryOp<scalar_multiple2_op<Scalar,OtherScalar>, const Derived> - operator*(const OtherScalar& scalar) const - { -#ifdef EIGEN_SPECIAL_SCALAR_MULTIPLE_PLUGIN - EIGEN_SPECIAL_SCALAR_MULTIPLE_PLUGIN -#endif - return CwiseUnaryOp<scalar_multiple2_op<Scalar,OtherScalar>, const Derived> - (*static_cast<const Derived*>(this), scalar_multiple2_op<Scalar,OtherScalar>(scalar)); - } - - inline friend const CwiseUnaryOp<scalar_multiple2_op<Scalar,OtherScalar>, const Derived> - operator*(const OtherScalar& scalar, const Derived& matrix) - { -#ifdef EIGEN_SPECIAL_SCALAR_MULTIPLE_PLUGIN - EIGEN_SPECIAL_SCALAR_MULTIPLE_PLUGIN -#endif - return static_cast<const special_scalar_op_base&>(matrix).operator*(scalar); - } - - const CwiseUnaryOp<scalar_quotient2_op<Scalar,OtherScalar>, const Derived> - operator/(const OtherScalar& scalar) const - { -#ifdef EIGEN_SPECIAL_SCALAR_MULTIPLE_PLUGIN - EIGEN_SPECIAL_SCALAR_MULTIPLE_PLUGIN -#endif - return CwiseUnaryOp<scalar_quotient2_op<Scalar,OtherScalar>, const Derived> - (*static_cast<const Derived*>(this), scalar_quotient2_op<Scalar,OtherScalar>(scalar)); - } }; template<typename XprType, typename CastType> struct cast_return_type |