* LU decomposition, supporting all rectangular matrices, with full

pivoting for better numerical stability. For now the only application is
determinant.
* New determinant unit-test.
* Disable most of Swap.h for now as it makes LU fail (mysterious).
Anyway Swap needs a big overhaul as proposed on IRC.
* Remnants of old class Inverse removed.
* Some warnings fixed.
This commit is contained in:
Benoit Jacob
2008-08-04 04:45:59 +00:00
parent f81dfcf00b
commit c2f8ecf466
11 changed files with 237 additions and 50 deletions

View File

@@ -139,7 +139,7 @@ template<int Offset,typename PacketType>
struct ei_palign_impl
{
// by default data are aligned, so there is nothing to be done :)
inline static void run(PacketType& first, const PacketType& second) {}
inline static void run(PacketType&, const PacketType&) {}
};
/** \internal update \a first using the concatenation of the \a Offset last elements

View File

@@ -526,6 +526,7 @@ template<typename Derived> class MatrixBase
/////////// LU module ///////////
const LU<EvalType> lu() const;
const EvalType inverse() const;
void computeInverse(EvalType *result) const;
Scalar determinant() const;

View File

@@ -42,7 +42,9 @@ template<typename OtherDerived>
void MatrixBase<Derived>::swap(const MatrixBase<OtherDerived>& other)
{
MatrixBase<OtherDerived> *_other = const_cast<MatrixBase<OtherDerived>*>(&other);
if(SizeAtCompileTime == Dynamic)
// disable that path: it makes LU decomposition fail ! I can't see the bug though.
if(false /*SizeAtCompileTime == Dynamic*/)
{
ei_swap_selector<Derived,OtherDerived>::run(derived(),other.const_cast_derived());
}

View File

@@ -95,7 +95,7 @@ void ei_cache_friendly_product(
bool _rhsRowMajor, const Scalar* _rhs, int _rhsStride,
bool resRowMajor, Scalar* res, int resStride);
template<typename ExpressionType, bool CheckExistence = true> class Inverse;
template<typename MatrixType> class LU;
template<typename MatrixType> class QR;
template<typename MatrixType> class Cholesky;
template<typename MatrixType> class CholeskyWithoutSquareRoot;

View File

@@ -135,7 +135,6 @@ typedef typename Eigen::NumTraits<Scalar>::Real RealScalar; \
typedef typename Base::PacketScalar PacketScalar; \
typedef typename Eigen::ei_nested<Derived>::type Nested; \
typedef typename Eigen::ei_eval<Derived>::type Eval; \
typedef typename Eigen::Inverse<Eval> InverseType; \
enum { RowsAtCompileTime = Eigen::ei_traits<Derived>::RowsAtCompileTime, \
ColsAtCompileTime = Eigen::ei_traits<Derived>::ColsAtCompileTime, \
MaxRowsAtCompileTime = Eigen::ei_traits<Derived>::MaxRowsAtCompileTime, \