* refactoring of Product:

* use ProductReturnType<>::Type to get the correct Product xpr type
  * Product is no longer instanciated for xpr types which are evaluated
  * vectorization of "a.transpose() * b" for the normal product (small and fixed-size matrix)
  * some cleanning
* removed ArrayBase
This commit is contained in:
Gael Guennebaud
2008-06-19 17:33:57 +00:00
parent 5dbfed1902
commit 82c3cea1d5
12 changed files with 359 additions and 247 deletions

View File

@@ -140,7 +140,7 @@ enum { Aligned=0, UnAligned=1 };
enum { ConditionalJumpCost = 5 };
enum CornerType { TopLeft, TopRight, BottomLeft, BottomRight };
enum DirectionType { Vertical, Horizontal };
enum ProductEvaluationMode { NormalProduct, CacheFriendlyProduct, DiagonalProduct, LazyProduct};
enum ProductEvaluationMode { NormalProduct, CacheFriendlyProduct, DiagonalProduct };
#endif // EIGEN_CONSTANTS_H

View File

@@ -26,7 +26,6 @@
#define EIGEN_FORWARDDECLARATIONS_H
template<typename T> struct ei_traits;
template<typename Lhs, typename Rhs> struct ei_product_eval_mode;
template<typename T> struct NumTraits;
template<typename Scalar, int Rows, int Cols, int MaxRows, int MaxCols, unsigned int SuggestedFlags> class ei_corrected_matrix_flags;
@@ -49,7 +48,7 @@ template<typename MatrixType> class Conjugate;
template<typename NullaryOp, typename MatrixType> class CwiseNullaryOp;
template<typename UnaryOp, typename MatrixType> class CwiseUnaryOp;
template<typename BinaryOp, typename Lhs, typename Rhs> class CwiseBinaryOp;
template<typename Lhs, typename Rhs, int EvalMode=ei_product_eval_mode<Lhs,Rhs>::value> class Product;
template<typename Lhs, typename Rhs, int ProductMode> class Product;
template<typename CoeffsVectorType> class DiagonalMatrix;
template<typename MatrixType> class DiagonalCoeffs;
template<typename MatrixType> class Map;
@@ -63,6 +62,8 @@ template<typename Scalar> class Rotation2D;
template<typename Scalar> class AngleAxis;
template<typename Scalar,int Dim> class Transform;
template<typename Lhs, typename Rhs> struct ei_product_mode;
template<typename Lhs, typename Rhs, int ProductMode = ei_product_mode<Lhs,Rhs>::value> struct ProductReturnType;
template<typename Scalar> struct ei_scalar_sum_op;
template<typename Scalar> struct ei_scalar_difference_op;

View File

@@ -160,10 +160,7 @@ class ei_corrected_matrix_flags
packet_access_bit
= ei_packet_traits<Scalar>::size > 1
&& (is_big || inner_size%ei_packet_traits<Scalar>::size==0)
? PacketAccessBit : 0,
_flags1 = (SuggestedFlags & ~(EvalBeforeNestingBit | EvalBeforeAssigningBit | PacketAccessBit | RowMajorBit))
| LinearAccessBit | DirectAccessBit
? PacketAccessBit : 0
};
public:
@@ -208,7 +205,7 @@ template<typename T> struct ei_must_nest_by_value { enum { ret = false }; };
template<typename T> struct ei_must_nest_by_value<NestByValue<T> > { enum { ret = true }; };
template<typename T, int n=1> struct ei_nested
template<typename T, int n=1, typename EvalType = typename ei_eval<T>::type> struct ei_nested
{
typedef typename ei_meta_if<
ei_must_nest_by_value<T>::ret,
@@ -216,7 +213,7 @@ template<typename T, int n=1> struct ei_nested
typename ei_meta_if<
(int(ei_traits<T>::Flags) & EvalBeforeNestingBit)
|| ((n+1) * int(NumTraits<typename ei_traits<T>::Scalar>::ReadCost) <= (n-1) * int(T::CoeffReadCost)),
typename ei_eval<T>::type,
EvalType,
const T&
>::ret
>::ret type;