- introduce Part and Extract classes, splitting and extending the former

Triangular class
- full meta-unrolling in Part
- move inverseProduct() to MatrixBase
- compilation fix in ProductWIP: introduce a meta-selector to only do
  direct access on types that support it.
- phase out the old Product, remove the WIP_DIRTY stuff.
- misc renaming and fixes
This commit is contained in:
Benoit Jacob
2008-05-27 05:47:30 +00:00
parent 8f1fc80a77
commit 953efdbfe7
22 changed files with 530 additions and 434 deletions

View File

@@ -58,9 +58,9 @@ template<typename MatrixType> class Cholesky
compute(matrix);
}
Triangular<Lower, MatrixType> matrixL(void) const
Extract<MatrixType, Lower> matrixL(void) const
{
return m_matrix.lower();
return m_matrix;
}
bool isPositiveDefinite(void) const { return m_isPositiveDefinite; }
@@ -118,7 +118,7 @@ typename Derived::Eval Cholesky<MatrixType>::solve(MatrixBase<Derived> &b)
const int size = m_matrix.rows();
ei_assert(size==b.size());
return m_matrix.adjoint().upper().inverseProduct(m_matrix.lower().inverseProduct(b));
return m_matrix.adjoint().template extract<Upper>().inverseProduct(matrixL().inverseProduct(b));
}

View File

@@ -58,9 +58,9 @@ template<typename MatrixType> class CholeskyWithoutSquareRoot
}
/** \returns the lower triangular matrix L */
Triangular<Lower|UnitDiagBit, MatrixType > matrixL(void) const
Extract<MatrixType, UnitLower> matrixL(void) const
{
return m_matrix.lowerWithUnitDiag();
return m_matrix;
}
/** \returns the coefficients of the diagonal matrix D */
@@ -131,9 +131,9 @@ typename Derived::Eval CholeskyWithoutSquareRoot<MatrixType>::solve(MatrixBase<D
const int size = m_matrix.rows();
ei_assert(size==vecB.size());
return m_matrix.adjoint().upperWithUnitDiag()
return m_matrix.adjoint().template extract<UnitUpper>()
.inverseProduct(
(m_matrix.lowerWithUnitDiag()
(matrixL()
.inverseProduct(vecB))
.cwiseQuotient(m_matrix.diagonal())
);