|
enum | { MaxRowsAtCompileTime = MatrixType::MaxRowsAtCompileTime
, MaxColsAtCompileTime = MatrixType::MaxColsAtCompileTime
, UpLo = UpLo_
} |
|
typedef MatrixType_ | MatrixType |
|
typedef SolverBase< LDLT > | Base |
|
typedef Matrix< Scalar, RowsAtCompileTime, 1, 0, MaxRowsAtCompileTime, 1 > | TmpMatrixType |
|
typedef Transpositions< RowsAtCompileTime, MaxRowsAtCompileTime > | TranspositionType |
|
typedef PermutationMatrix< RowsAtCompileTime, MaxRowsAtCompileTime > | PermutationType |
|
typedef internal::LDLT_Traits< MatrixType, UpLo > | Traits |
|
enum | |
|
typedef EigenBase< LDLT< MatrixType_, UpLo_ > > | Base |
|
typedef internal::traits< LDLT< MatrixType_, UpLo_ > >::Scalar | Scalar |
|
typedef Scalar | CoeffReturnType |
|
typedef Transpose< const LDLT< MatrixType_, UpLo_ > > | ConstTransposeReturnType |
|
typedef std::conditional_t< NumTraits< Scalar >::IsComplex, CwiseUnaryOp< internal::scalar_conjugate_op< Scalar >, const ConstTransposeReturnType >, const ConstTransposeReturnType > | AdjointReturnType |
|
typedef Eigen::Index | Index |
| The interface type of indices. More...
|
|
typedef internal::traits< Derived >::StorageKind | StorageKind |
|
|
| LDLT () |
| Default Constructor. More...
|
|
| LDLT (Index size) |
| Default Constructor with memory preallocation. More...
|
|
template<typename InputType > |
| LDLT (const EigenBase< InputType > &matrix) |
| Constructor with decomposition. More...
|
|
template<typename InputType > |
| LDLT (EigenBase< InputType > &matrix) |
| Constructs a LDLT factorization from a given matrix. More...
|
|
void | setZero () |
|
Traits::MatrixU | matrixU () const |
|
Traits::MatrixL | matrixL () const |
|
const TranspositionType & | transpositionsP () const |
|
Diagonal< const MatrixType > | vectorD () const |
|
bool | isPositive () const |
|
bool | isNegative (void) const |
|
template<typename Derived > |
bool | solveInPlace (MatrixBase< Derived > &bAndX) const |
|
template<typename InputType > |
LDLT & | compute (const EigenBase< InputType > &matrix) |
|
RealScalar | rcond () const |
|
template<typename Derived > |
LDLT & | rankUpdate (const MatrixBase< Derived > &w, const RealScalar &alpha=1) |
|
const MatrixType & | matrixLDLT () const |
|
MatrixType | reconstructedMatrix () const |
|
const LDLT & | adjoint () const |
|
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index | rows () const EIGEN_NOEXCEPT |
|
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index | cols () const EIGEN_NOEXCEPT |
|
ComputationInfo | info () const |
| Reports whether previous computation was successful. More...
|
|
template<typename RhsType , typename DstType > |
void | _solve_impl (const RhsType &rhs, DstType &dst) const |
|
template<bool Conjugate, typename RhsType , typename DstType > |
void | _solve_impl_transposed (const RhsType &rhs, DstType &dst) const |
|
template<typename InputType > |
LDLT< MatrixType, UpLo_ > & | compute (const EigenBase< InputType > &a) |
|
template<typename Derived > |
LDLT< MatrixType, UpLo_ > & | rankUpdate (const MatrixBase< Derived > &w, const typename LDLT< MatrixType, UpLo_ >::RealScalar &sigma) |
|
| SolverBase () |
|
| ~SolverBase () |
|
const Solve< LDLT< MatrixType_, UpLo_ >, Rhs > | solve (const MatrixBase< Rhs > &b) const |
|
const ConstTransposeReturnType | transpose () const |
|
const AdjointReturnType | adjoint () const |
|
constexpr EIGEN_DEVICE_FUNC LDLT< MatrixType_, UpLo_ > & | derived () |
|
constexpr EIGEN_DEVICE_FUNC const LDLT< MatrixType_, UpLo_ > & | derived () const |
|
constexpr EIGEN_DEVICE_FUNC Derived & | derived () |
|
constexpr EIGEN_DEVICE_FUNC const Derived & | derived () const |
|
EIGEN_DEVICE_FUNC Derived & | const_cast_derived () const |
|
EIGEN_DEVICE_FUNC const Derived & | const_derived () const |
|
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index | rows () const EIGEN_NOEXCEPT |
|
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index | cols () const EIGEN_NOEXCEPT |
|
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index | size () const EIGEN_NOEXCEPT |
|
template<typename Dest > |
EIGEN_DEVICE_FUNC void | evalTo (Dest &dst) const |
|
template<typename Dest > |
EIGEN_DEVICE_FUNC void | addTo (Dest &dst) const |
|
template<typename Dest > |
EIGEN_DEVICE_FUNC void | subTo (Dest &dst) const |
|
template<typename Dest > |
EIGEN_DEVICE_FUNC void | applyThisOnTheRight (Dest &dst) const |
|
template<typename Dest > |
EIGEN_DEVICE_FUNC void | applyThisOnTheLeft (Dest &dst) const |
|
template<typename Device > |
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE DeviceWrapper< Derived, Device > | device (Device &device) |
|
template<typename Device > |
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE DeviceWrapper< const Derived, Device > | device (Device &device) const |
|
template<typename MatrixType_, int UpLo_>
class Eigen::LDLT< MatrixType_, UpLo_ >
Robust Cholesky decomposition of a matrix with pivoting.
- Template Parameters
-
MatrixType_ | the type of the matrix of which to compute the LDL^T Cholesky decomposition |
UpLo_ | the triangular part that will be used for the decomposition: Lower (default) or Upper. The other triangular part won't be read. |
Perform a robust Cholesky decomposition of a positive semidefinite or negative semidefinite matrix \( A \) such that \( A = P^TLDL^*P \), where P is a permutation matrix, L is lower triangular with a unit diagonal and D is a diagonal matrix.
The decomposition uses pivoting to ensure stability, so that D will have zeros in the bottom right rank(A) - n submatrix. Avoiding the square root on D also stabilizes the computation.
Remember that Cholesky decompositions are not rank-revealing. Also, do not use a Cholesky decomposition to determine whether a system of equations has a solution.
This class supports the inplace decomposition mechanism.
- See also
- MatrixBase::ldlt(), SelfAdjointView::ldlt(), class LLT
template<typename MatrixType_ , int UpLo_>
template<bool Conjugate, typename RhsType , typename DstType >
void Eigen::LDLT< MatrixType_, UpLo_ >::_solve_impl_transposed |
( |
const RhsType & |
rhs, |
|
|
DstType & |
dst |
|
) |
| const |
549 matrixL().template conjugateIf<!Conjugate>().solveInPlace(dst);
555 const typename Diagonal<const MatrixType>::RealReturnType vecD(
vectorD());
563 for (
Index i = 0;
i < vecD.size(); ++
i) {
564 if (
abs(vecD(
i)) > tolerance)
565 dst.row(
i) /= vecD(
i);
567 dst.row(
i).setZero();
572 matrixL().transpose().template conjugateIf<Conjugate>().solveInPlace(dst);
AnnoyingScalar abs(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:135
int i
Definition: BiCGSTAB_step_by_step.cpp:9
NumTraits< Scalar >::Real RealScalar
Definition: bench_gemm.cpp:46
Traits::MatrixL matrixL() const
Definition: LDLT.h:147
Diagonal< const MatrixType > vectorD() const
Definition: LDLT.h:160
Transpose< TranspositionsBase > transpose() const
Definition: Transpositions.h:95
#define min(a, b)
Definition: datatypes.h:22
Eigen::Index Index
The interface type of indices.
Definition: EigenBase.h:43
References abs(), i, Eigen::LDLT< MatrixType_, UpLo_ >::m_transpositions, Eigen::LDLT< MatrixType_, UpLo_ >::matrixL(), min, Eigen::TranspositionsBase< Derived >::transpose(), and Eigen::LDLT< MatrixType_, UpLo_ >::vectorD().
template<typename MatrixType_ , int UpLo_>
template<typename InputType >
Compute / recompute the LDLT decomposition A = L D L^* = U^* D U of matrix
#define eigen_assert(x)
Definition: Macros.h:910
ComputationInfo m_info
Definition: LDLT.h:269
RealScalar m_l1_norm
Definition: LDLT.h:264
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE void resize(Index rows, Index cols)
Definition: PlainObjectBase.h:294
void resize(Index newSize)
Definition: Transpositions.h:63
@ Lower
Definition: Constants.h:211
@ NumericalIssue
Definition: Constants.h:442
@ Success
Definition: Constants.h:440
const Scalar * a
Definition: level2_cplx_impl.h:32
References a, col(), eigen_assert, Eigen::Lower, Eigen::LDLT< MatrixType_, UpLo_ >::m_info, Eigen::LDLT< MatrixType_, UpLo_ >::m_isInitialized, Eigen::LDLT< MatrixType_, UpLo_ >::m_l1_norm, Eigen::LDLT< MatrixType_, UpLo_ >::m_matrix, Eigen::LDLT< MatrixType_, UpLo_ >::m_sign, Eigen::LDLT< MatrixType_, UpLo_ >::m_temporary, Eigen::LDLT< MatrixType_, UpLo_ >::m_transpositions, Eigen::NumericalIssue, Eigen::TranspositionsBase< Derived >::resize(), Eigen::PlainObjectBase< Derived >::resize(), Eigen::EigenBase< Derived >::size(), Eigen::Success, and Eigen::internal::ZeroSign.
template<typename MatrixType_ , int UpLo_>
template<typename Derived >
Update the LDLT decomposition: given A = L D L^T, efficiently compute the decomposition of A + sigma w w^T.
- Parameters
-
w | a vector to be incorporated into the decomposition. |
sigma | a scalar, +1 for updates and -1 for "downdates," which correspond to removing previously-added column vectors. Optional; default value is +1. |
- See also
- setZero()
RowVector3d w
Definition: Matrix_resize_int.cpp:3
StorageIndex & coeffRef(Index i)
Definition: Transpositions.h:47
IndicesType::Scalar StorageIndex
Definition: Transpositions.h:147
int sigma
Definition: calibrate.py:179
References Eigen::TranspositionsBase< Derived >::coeffRef(), eigen_assert, i, Eigen::LDLT< MatrixType_, UpLo_ >::m_isInitialized, Eigen::LDLT< MatrixType_, UpLo_ >::m_matrix, Eigen::LDLT< MatrixType_, UpLo_ >::m_sign, Eigen::LDLT< MatrixType_, UpLo_ >::m_temporary, Eigen::LDLT< MatrixType_, UpLo_ >::m_transpositions, Eigen::internal::NegativeSemiDef, Eigen::internal::PositiveSemiDef, Eigen::TranspositionsBase< Derived >::resize(), Eigen::PlainObjectBase< Derived >::resize(), calibrate::sigma, Eigen::EigenBase< Derived >::size(), and w.
template<typename MatrixType , int UpLo_>
- Returns
- the matrix represented by the decomposition, i.e., it returns the product: P^T L D L^* P. This function is provided for debug purpose.
cout<< "Here is the matrix m:"<< endl<< m<< endl;Matrix< ptrdiff_t, 3, 1 > res
Definition: PartialRedux_count.cpp:3
MatrixXf MatrixType
Definition: benchmark-blocking-sizes.cpp:52
const TranspositionType & transpositionsP() const
Definition: LDLT.h:154
Traits::MatrixU matrixU() const
Definition: LDLT.h:141
References eigen_assert, Eigen::LDLT< MatrixType_, UpLo_ >::m_isInitialized, Eigen::LDLT< MatrixType_, UpLo_ >::m_matrix, Eigen::LDLT< MatrixType_, UpLo_ >::matrixL(), Eigen::LDLT< MatrixType_, UpLo_ >::matrixU(), res, Eigen::EigenBase< Derived >::size(), Eigen::TranspositionsBase< Derived >::transpose(), Eigen::LDLT< MatrixType_, UpLo_ >::transpositionsP(), and Eigen::LDLT< MatrixType_, UpLo_ >::vectorD().
Referenced by cholesky(), cholesky_cplx(), cholesky_definiteness(), and cholesky_faillure_cases().
template<typename MatrixType , int UpLo_>
template<typename Derived >
use x = ldlt_object.solve(x);
This is the in-place version of solve().
- Parameters
-
bAndX | represents both the right-hand side matrix b and result x. |
- Returns
- true always! If you need to check for existence of solutions, use another decomposition like LU, QR, or SVD.
This version avoids a copy when the right hand side matrix b is not needed anymore.
- See also
- LDLT::solve(), MatrixBase::ldlt()
599 bAndX = this->
solve(bAndX);
const Solve< LDLT< MatrixType_, UpLo_ >, Rhs > solve(const MatrixBase< Rhs > &b) const
Definition: SolverBase.h:106
References eigen_assert, Eigen::LDLT< MatrixType_, UpLo_ >::m_isInitialized, Eigen::LDLT< MatrixType_, UpLo_ >::m_matrix, and Eigen::SolverBase< LDLT< MatrixType_, UpLo_ > >::solve().
Referenced by cholesky_verify_assert().
template<typename MatrixType_ , int UpLo_>
Used to compute and store the Cholesky decomposition A = L D L^* = U^* D U. The strict upper part is used during the decomposition, the strict lower part correspond to the coefficients of L (its diagonal is equal to 1 and is not stored), and the diagonal entries correspond to D.
Referenced by Eigen::LDLT< MatrixType_, UpLo_ >::cols(), Eigen::LDLT< MatrixType_, UpLo_ >::compute(), Eigen::SelfAdjointView< MatrixType_, UpLo >::ldlt(), Eigen::LDLT< MatrixType_, UpLo_ >::matrixL(), Eigen::LDLT< MatrixType_, UpLo_ >::matrixLDLT(), Eigen::LDLT< MatrixType_, UpLo_ >::matrixU(), Eigen::LDLT< MatrixType_, UpLo_ >::rankUpdate(), Eigen::LDLT< MatrixType_, UpLo_ >::reconstructedMatrix(), Eigen::LDLT< MatrixType_, UpLo_ >::rows(), Eigen::LDLT< MatrixType_, UpLo_ >::solveInPlace(), and Eigen::LDLT< MatrixType_, UpLo_ >::vectorD().