diff options
author | 2008-12-21 20:55:46 +0000 | |
---|---|---|
committer | 2008-12-21 20:55:46 +0000 | |
commit | f5a05e7ed159d771545767c430d12263e205ec87 (patch) | |
tree | 15bd4c04bdabfcb7efe5c60787a60b6e77f42587 /Eigen/src/Core/Functors.h | |
parent | 9e00d945439d801d3f4e33ed1ce57545e3310723 (diff) |
unfuck v.cwise()*w where v is real and w is complex
Diffstat (limited to 'Eigen/src/Core/Functors.h')
-rw-r--r-- | Eigen/src/Core/Functors.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Eigen/src/Core/Functors.h b/Eigen/src/Core/Functors.h index 6784ea946..347f1b252 100644 --- a/Eigen/src/Core/Functors.h +++ b/Eigen/src/Core/Functors.h @@ -348,11 +348,15 @@ template<typename Scalar> struct ei_functor_traits<ei_scalar_identity_op<Scalar> > { enum { Cost = NumTraits<Scalar>::AddCost, PacketAccess = false, IsRepeatable = true }; }; -// FIXME quick hack: // all functors allow linear access, except ei_scalar_identity_op. So we fix here a quick meta // to indicate whether a functor allows linear access, just always answering 'yes' except for // ei_scalar_identity_op. template<typename Functor> struct ei_functor_has_linear_access { enum { ret = 1 }; }; template<typename Scalar> struct ei_functor_has_linear_access<ei_scalar_identity_op<Scalar> > { enum { ret = 0 }; }; +// in CwiseBinaryOp, we require the Lhs and Rhs to have the same scalar type, except for multiplication +// where we only require them to have the same _real_ scalar type so one may multiply, say, float by complex<float>. +template<typename Functor> struct ei_functor_allows_mixing_real_and_complex { enum { ret = 0 }; }; +template<typename Scalar> struct ei_functor_allows_mixing_real_and_complex<ei_scalar_product_op<Scalar> > { enum { ret = 1 }; }; + #endif // EIGEN_FUNCTORS_H |