mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
- 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:
@@ -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));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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())
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user