aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2009-09-03 13:03:26 +0200
committerGravatar Gael Guennebaud <g.gael@free.fr>2009-09-03 13:03:26 +0200
commit3eb37fe1fb36be375c6211fc00d56a89b08b12fb (patch)
treed55350111a610554126316eb65525dcd794a1d63 /Eigen
parent00f4b4690872ea333d426611b3942f4aaacc0139 (diff)
update mixingtype unit test to reflect current status, but it is still clear
we should allow matrix products between complex and real ?
Diffstat (limited to 'Eigen')
-rw-r--r--Eigen/src/Core/Product.h18
-rw-r--r--Eigen/src/Core/products/GeneralMatrixMatrix.h6
2 files changed, 20 insertions, 4 deletions
diff --git a/Eigen/src/Core/Product.h b/Eigen/src/Core/Product.h
index 5c6cee426..dfdbca839 100644
--- a/Eigen/src/Core/Product.h
+++ b/Eigen/src/Core/Product.h
@@ -162,7 +162,11 @@ class GeneralProduct<Lhs, Rhs, InnerProduct>
public:
EIGEN_PRODUCT_PUBLIC_INTERFACE(GeneralProduct)
- GeneralProduct(const Lhs& lhs, const Rhs& rhs) : Base(lhs,rhs) {}
+ GeneralProduct(const Lhs& lhs, const Rhs& rhs) : Base(lhs,rhs)
+ {
+ EIGEN_STATIC_ASSERT((ei_is_same_type<typename Lhs::Scalar, typename Rhs::Scalar>::ret),
+ YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY)
+ }
EIGEN_STRONG_INLINE Scalar value() const
{
@@ -197,7 +201,11 @@ class GeneralProduct<Lhs, Rhs, OuterProduct>
public:
EIGEN_PRODUCT_PUBLIC_INTERFACE(GeneralProduct)
- GeneralProduct(const Lhs& lhs, const Rhs& rhs) : Base(lhs,rhs) {}
+ GeneralProduct(const Lhs& lhs, const Rhs& rhs) : Base(lhs,rhs)
+ {
+ EIGEN_STATIC_ASSERT((ei_is_same_type<typename Lhs::Scalar, typename Rhs::Scalar>::ret),
+ YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY)
+ }
template<typename Dest> void scaleAndAddTo(Dest& dest, Scalar alpha) const
{
@@ -251,7 +259,11 @@ class GeneralProduct<Lhs, Rhs, GemvProduct>
public:
EIGEN_PRODUCT_PUBLIC_INTERFACE(GeneralProduct)
- GeneralProduct(const Lhs& lhs, const Rhs& rhs) : Base(lhs,rhs) {}
+ GeneralProduct(const Lhs& lhs, const Rhs& rhs) : Base(lhs,rhs)
+ {
+ EIGEN_STATIC_ASSERT((ei_is_same_type<typename Lhs::Scalar, typename Rhs::Scalar>::ret),
+ YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY)
+ }
enum { Side = Lhs::IsVectorAtCompileTime ? OnTheLeft : OnTheRight };
typedef typename ei_meta_if<int(Side)==OnTheRight,_LhsNested,_RhsNested>::ret MatrixType;
diff --git a/Eigen/src/Core/products/GeneralMatrixMatrix.h b/Eigen/src/Core/products/GeneralMatrixMatrix.h
index c4692b872..beec17ee4 100644
--- a/Eigen/src/Core/products/GeneralMatrixMatrix.h
+++ b/Eigen/src/Core/products/GeneralMatrixMatrix.h
@@ -135,7 +135,11 @@ class GeneralProduct<Lhs, Rhs, GemmProduct>
public:
EIGEN_PRODUCT_PUBLIC_INTERFACE(GeneralProduct)
- GeneralProduct(const Lhs& lhs, const Rhs& rhs) : Base(lhs,rhs) {}
+ GeneralProduct(const Lhs& lhs, const Rhs& rhs) : Base(lhs,rhs)
+ {
+ EIGEN_STATIC_ASSERT((ei_is_same_type<typename Lhs::Scalar, typename Rhs::Scalar>::ret),
+ YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY)
+ }
template<typename Dest> void scaleAndAddTo(Dest& dst, Scalar alpha) const
{