Added Triangular expression to extract upper or lower (strictly or not)

part of a matrix. Triangular also provide an optimised method for forward
and backward substitution. Further optimizations regarding assignments and
products might come later.

Updated determinant() to take into account triangular matrices.

Started the QR module with a QR decompostion algorithm.
Help needed to build a QR algorithm (eigen solver) based on it.
This commit is contained in:
Gael Guennebaud
2008-04-26 18:26:05 +00:00
parent 62bf0bbd59
commit 4c92150676
21 changed files with 586 additions and 19 deletions

View File

@@ -30,15 +30,24 @@ const int Dynamic = 10000;
// matrix/expression flags
const unsigned int RowMajorBit = 0x1;
const unsigned int EvalBeforeNestingBit = 0x2;
const unsigned int EvalBeforeAssigningBit = 0x4;
const unsigned int EvalBeforeNestingBit = 0x2; ///< means the expression should be evaluated by the calling expression
const unsigned int EvalBeforeAssigningBit = 0x4;///< means the expression should be evaluated before any assignement
const unsigned int LargeBit = 0x8;
#ifdef EIGEN_VECTORIZE
const unsigned int VectorizableBit = 0x10;
const unsigned int VectorizableBit = 0x10; ///< means the expression might be vectorized
#else
const unsigned int VectorizableBit = 0x0;
#endif
const unsigned int Like1DArrayBit = 0x20;
const unsigned int Like1DArrayBit = 0x20; ///< means the expression can be seen as 1D vector (used for explicit vectorization)
const unsigned int NullDiagBit = 0x40; ///< means all diagonal coefficients are equal to 0
const unsigned int UnitDiagBit = 0x80; ///< means all diagonal coefficients are equal to 1
const unsigned int NullLowerBit = 0x200; ///< means the strictly triangular lower part is 0
const unsigned int NullUpperBit = 0x400; ///< means the strictly triangular upper part is 0
enum { Upper=NullLowerBit, Lower=NullUpperBit };
// list of flags that are lost by default
const unsigned int DefaultLostFlagMask = ~(VectorizableBit | Like1DArrayBit | NullDiagBit | UnitDiagBit | NullLowerBit | NullUpperBit);
enum { ConditionalJumpCost = 5 };
enum CornerType { TopLeft, TopRight, BottomLeft, BottomRight };

View File

@@ -47,8 +47,9 @@ template<typename Lhs, typename Rhs, int EvalMode=ei_product_eval_mode<Lhs,Rhs>:
template<typename CoeffsVectorType> class DiagonalMatrix;
template<typename MatrixType> class DiagonalCoeffs;
template<typename MatrixType> class Map;
template<typename Derived> class Eval;
// template<typename Derived> class Eval;
template<int Direction, typename UnaryOp, typename MatrixType> class PartialRedux;
template<int Mode, typename MatrixType> class Triangular;
template<typename Scalar> struct ei_scalar_sum_op;
template<typename Scalar> struct ei_scalar_difference_op;
@@ -71,5 +72,6 @@ template<typename Scalar> struct ei_scalar_min_op;
template<typename Scalar> struct ei_scalar_max_op;
template<typename ExpressionType, bool CheckExistence = true> class Inverse;
template<typename MatrixType> class QR;
#endif // EIGEN_FORWARDDECLARATIONS_H