Go to the documentation of this file.
50 template<
typename _MatrixType,
int _UpLo>
class LDLT
104 template<
typename InputType>
121 template<
typename InputType>
141 inline typename Traits::MatrixU
matrixU()
const
148 inline typename Traits::MatrixL
matrixL()
const
198 template<
typename Rhs>
204 &&
"LDLT::solve(): invalid number of rows of the right hand side matrix b");
208 template<
typename Derived>
211 template<
typename InputType>
223 template <
typename Derived>
259 #ifndef EIGEN_PARSED_BY_DOXYGEN
260 template<
typename RhsType,
typename DstType>
262 void _solve_impl(
const RhsType &rhs, DstType &dst)
const;
293 template<
typename MatrixType,
typename TranspositionType,
typename Workspace>
299 typedef typename TranspositionType::StorageIndex IndexType;
302 bool found_zero_pivot =
false;
307 transpositions.setIdentity();
318 Index index_of_biggest_in_corner;
319 mat.diagonal().tail(
size-k).cwiseAbs().maxCoeff(&index_of_biggest_in_corner);
320 index_of_biggest_in_corner += k;
322 transpositions.coeffRef(k) = IndexType(index_of_biggest_in_corner);
323 if(k != index_of_biggest_in_corner)
328 mat.row(k).head(k).swap(
mat.row(index_of_biggest_in_corner).head(k));
329 mat.col(k).tail(
s).swap(
mat.col(index_of_biggest_in_corner).tail(
s));
330 std::swap(
mat.coeffRef(k,k),
mat.coeffRef(index_of_biggest_in_corner,index_of_biggest_in_corner));
331 for(
Index i=k+1;i<index_of_biggest_in_corner;++i)
338 mat.coeffRef(index_of_biggest_in_corner,k) =
numext::conj(
mat.coeff(index_of_biggest_in_corner,k));
352 temp.head(k) =
mat.diagonal().real().head(k).asDiagonal() * A10.adjoint();
353 mat.coeffRef(k,k) -= (A10 * temp.head(k)).value();
355 A21.noalias() -= A20 * temp.head(k);
365 if(k==0 && !pivot_is_valid)
372 transpositions.coeffRef(j) = IndexType(j);
378 if((rs>0) && pivot_is_valid)
383 if(found_zero_pivot && pivot_is_valid)
ret =
false;
384 else if(!pivot_is_valid) found_zero_pivot =
true;
406 template<
typename MatrixType,
typename WDerived>
437 w.tail(rs) -= wj *
mat.col(j).tail(rs);
444 template<
typename MatrixType,
typename TranspositionType,
typename Workspace,
typename WType>
448 tmp = transpositions * w;
456 template<
typename MatrixType,
typename TranspositionType,
typename Workspace>
463 template<
typename MatrixType,
typename TranspositionType,
typename Workspace,
typename WType>
491 template<
typename MatrixType,
int _UpLo>
492 template<
typename InputType>
495 check_template_parameters();
500 m_matrix =
a.derived();
508 abs_col_sum = m_matrix.col(
col).tail(
size -
col).template lpNorm<1>() + m_matrix.row(
col).head(
col).template lpNorm<1>();
510 abs_col_sum = m_matrix.col(
col).head(
col).template lpNorm<1>() + m_matrix.row(
col).tail(
size -
col).template lpNorm<1>();
511 if (abs_col_sum > m_l1_norm)
512 m_l1_norm = abs_col_sum;
515 m_transpositions.resize(
size);
516 m_isInitialized =
false;
517 m_temporary.resize(
size);
522 m_isInitialized =
true;
531 template<
typename MatrixType,
int _UpLo>
532 template<
typename Derived>
545 m_transpositions.resize(
size);
547 m_transpositions.coeffRef(i) = IndexType(i);
548 m_temporary.resize(
size);
550 m_isInitialized =
true;
558 #ifndef EIGEN_PARSED_BY_DOXYGEN
559 template<
typename _MatrixType,
int _UpLo>
560 template<
typename RhsType,
typename DstType>
565 dst = m_transpositions * rhs;
568 matrixL().solveInPlace(dst);
583 for (
Index i = 0; i < vecD.size(); ++i)
585 if(
abs(vecD(i)) > tolerance)
586 dst.row(i) /= vecD(i);
588 dst.row(i).setZero();
592 matrixU().solveInPlace(dst);
595 dst = m_transpositions.transpose() * dst;
612 template<
typename MatrixType,
int _UpLo>
613 template<
typename Derived>
616 eigen_assert(m_isInitialized &&
"LDLT is not initialized.");
619 bAndX = this->solve(bAndX);
627 template<
typename MatrixType,
int _UpLo>
630 eigen_assert(m_isInitialized &&
"LDLT is not initialized.");
636 res = transpositionsP() * res;
638 res = matrixU() * res;
640 res = vectorD().real().asDiagonal() * res;
642 res = matrixL() * res;
644 res = transpositionsP().transpose() * res;
653 template<
typename MatrixType,
unsigned int UpLo>
664 template<
typename Derived>
673 #endif // EIGEN_LDLT_H
const AutoDiffScalar< DerType > & conj(const AutoDiffScalar< DerType > &x)
LDLT(Index size)
Default Constructor with memory preallocation.
LDLT(EigenBase< InputType > &matrix)
Constructs a LDLT factorization from a given matrix.
PermutationMatrix< RowsAtCompileTime, MaxRowsAtCompileTime > PermutationType
static MatrixU getU(const MatrixType &m)
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bool() isfinite(const half &a)
Expression of a fixed-size or dynamic-size block.
Map< Matrix< Scalar, Dynamic, Dynamic, ColMajor >, 0, OuterStride<> > MatrixType
MatrixType reconstructedMatrix() const
TranspositionType m_transpositions
Matrix< Scalar, RowsAtCompileTime, 1, 0, MaxRowsAtCompileTime, 1 > TmpMatrixType
NumTraits< Scalar >::Real RealScalar
const LDLT< PlainObject, UpLo > ldlt() const
EIGEN_DEVICE_FUNC bool() isfinite(const T &x)
static MatrixL getL(const MatrixType &m)
const typedef TriangularView< const MatrixType, UnitUpper > MatrixU
EIGEN_DEVICE_FUNC ColXpr col(Index i)
This is the const version of col().
static void check_template_parameters()
const EIGEN_DEVICE_FUNC SignReturnType sign() const
bool isNegative(void) const
NumTraits< typename MatrixType::Scalar >::Real RealScalar
EIGEN_DEVICE_FUNC const EIGEN_STRONG_INLINE Abs2ReturnType abs2() const
Traits::MatrixU matrixU() const
MatrixType::StorageIndex StorageIndex
EIGEN_DEVICE_FUNC void _solve_impl(const RhsType &rhs, DstType &dst) const
Map< Matrix< T, Dynamic, Dynamic, ColMajor >, 0, OuterStride<> > matrix(T *data, int rows, int cols, int stride)
Decomposition::RealScalar rcond_estimate_helper(typename Decomposition::RealScalar matrix_norm, const Decomposition &dec)
Reciprocal condition number estimator.
Expression of the transpose of a matrix.
LDLT()
Default Constructor.
LDLT & rankUpdate(const MatrixBase< Derived > &w, const RealScalar &alpha=1)
const Solve< LDLT, Rhs > solve(const MatrixBase< Rhs > &b) const
const MatrixType & matrixLDLT() const
EIGEN_DEVICE_FUNC const EIGEN_STRONG_INLINE AbsReturnType abs() const
LDLT & compute(const EigenBase< InputType > &matrix)
internal::SignMatrix m_sign
Traits::MatrixL matrixL() const
Diagonal< const MatrixType > vectorD() const
Expression of a diagonal/subdiagonal/superdiagonal in a matrix.
const LDLT & adjoint() const
#define EIGEN_STRONG_INLINE
IndicesType::Scalar StorageIndex
Transpositions< RowsAtCompileTime, MaxRowsAtCompileTime > TranspositionType
Robust Cholesky decomposition of a matrix with pivoting.
static bool unblocked(MatrixType &mat, TranspositionType &transpositions, Workspace &temp, SignMatrix &sign)
const typedef TriangularView< const typename MatrixType::AdjointReturnType, UnitLower > MatrixL
static EIGEN_STRONG_INLINE bool update(MatrixType &mat, TranspositionType &transpositions, Workspace &tmp, WType &w, const typename MatrixType::RealScalar &sigma=1)
const typedef TriangularView< const typename MatrixType::AdjointReturnType, UnitUpper > MatrixU
Pseudo expression representing a solving operation.
bool solveInPlace(MatrixBase< Derived > &bAndX) const
TmpMatrixType m_temporary
static EIGEN_STRONG_INLINE bool unblocked(MatrixType &mat, TranspositionType &transpositions, Workspace &temp, SignMatrix &sign)
static bool update(MatrixType &mat, const TranspositionType &transpositions, Workspace &tmp, const WType &w, const typename MatrixType::RealScalar &sigma=1)
internal::LDLT_Traits< MatrixType, UpLo > Traits
static MatrixL getL(const MatrixType &m)
MatrixType::Scalar Scalar
static constexpr size_t size(Tuple< Args... > &)
Provides access to the number of elements in a tuple as a compile-time constant expression.
static MatrixU getU(const MatrixType &m)
LDLT(const EigenBase< InputType > &matrix)
Constructor with decomposition.
Base class for all dense matrices, vectors, and expressions.
ComputationInfo info() const
Reports whether previous computation was successful.
Expression of a triangular part in a matrix.
const typedef TriangularView< const MatrixType, UnitLower > MatrixL
static bool updateInPlace(MatrixType &mat, MatrixBase< WDerived > &w, const typename MatrixType::RealScalar &sigma=1)
int EIGEN_BLAS_FUNC() swap(int *n, RealScalar *px, int *incx, RealScalar *py, int *incy)
const LDLT< PlainObject > ldlt() const
Holds information about the various numeric (i.e. scalar) types allowed by Eigen.
const TranspositionType & transpositionsP() const
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
#define EIGEN_STATIC_ASSERT_NON_INTEGER(TYPE)
control_box_rst
Author(s): Christoph Rösmann
autogenerated on Wed Mar 2 2022 00:05:52