aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/Core/Product.h
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2014-06-27 15:53:51 +0200
committerGravatar Gael Guennebaud <g.gael@free.fr>2014-06-27 15:53:51 +0200
commitae039dde135a6af852d7028abd772316613a5249 (patch)
tree41e2bf4a7aa0c49e316b74dc8c860366349619d9 /Eigen/src/Core/Product.h
parentf0648f886058a85930186bd935ffb2c9fa87b1f3 (diff)
Add a NoPreferredStorageOrderBit flag for expression having no preferred storage order.
It is currently only used in Product.
Diffstat (limited to 'Eigen/src/Core/Product.h')
-rw-r--r--Eigen/src/Core/Product.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/Eigen/src/Core/Product.h b/Eigen/src/Core/Product.h
index 626b737c7..e381ac46a 100644
--- a/Eigen/src/Core/Product.h
+++ b/Eigen/src/Core/Product.h
@@ -82,7 +82,10 @@ struct traits<Product<Lhs, Rhs, Option> >
#endif
// The storage order is somewhat arbitrary here. The correct one will be determined through the evaluator.
- Flags = (MaxRowsAtCompileTime==1 ? RowMajorBit : 0)
+ Flags = ( MaxRowsAtCompileTime==1
+ || ((LhsCleaned::Flags&NoPreferredStorageOrderBit) && (RhsCleaned::Flags&RowMajorBit))
+ || ((RhsCleaned::Flags&NoPreferredStorageOrderBit) && (LhsCleaned::Flags&RowMajorBit)) )
+ ? RowMajorBit : (MaxColsAtCompileTime==1 ? 0 : NoPreferredStorageOrderBit)
};
};
@@ -156,6 +159,16 @@ public:
} // namespace internal
+#ifdef EIGEN_TEST_EVALUATORS
+// Generic API dispatcher
+template<typename Lhs, typename Rhs, int Option, typename StorageKind>
+class ProductImpl : public internal::generic_xpr_base<Product<Lhs,Rhs,Option>, MatrixXpr, StorageKind>::type
+{
+ public:
+ typedef typename internal::generic_xpr_base<Product<Lhs,Rhs,Option>, MatrixXpr, StorageKind>::type Base;
+};
+#endif
+
template<typename Lhs, typename Rhs, int Option>
class ProductImpl<Lhs,Rhs,Option,Dense>
: public internal::dense_product_base<Lhs,Rhs,Option>