From f5a05e7ed159d771545767c430d12263e205ec87 Mon Sep 17 00:00:00 2001 From: Benoit Jacob Date: Sun, 21 Dec 2008 20:55:46 +0000 Subject: unfuck v.cwise()*w where v is real and w is complex --- Eigen/src/Core/Functors.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'Eigen/src/Core/Functors.h') 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 struct ei_functor_traits > { enum { Cost = NumTraits::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 struct ei_functor_has_linear_access { enum { ret = 1 }; }; template struct ei_functor_has_linear_access > { 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. +template struct ei_functor_allows_mixing_real_and_complex { enum { ret = 0 }; }; +template struct ei_functor_allows_mixing_real_and_complex > { enum { ret = 1 }; }; + #endif // EIGEN_FUNCTORS_H -- cgit v1.2.3