22 template <
typename MatrixType_,
int UpLo_>
30 template <
typename MatrixType,
int UpLo>
62 template <
typename MatrixType_,
int UpLo_>
108 template <
typename InputType>
125 template <
typename InputType>
141 inline typename Traits::MatrixU
matrixU()
const {
147 inline typename Traits::MatrixL
matrixL()
const {
177 #ifdef EIGEN_PARSED_BY_DOXYGEN
193 template <
typename Rhs>
197 template <
typename Derived>
200 template <
typename InputType>
211 template <
typename Derived>
246 #ifndef EIGEN_PARSED_BY_DOXYGEN
247 template <
typename RhsType,
typename DstType>
248 void _solve_impl(
const RhsType& rhs, DstType& dst)
const;
250 template <
bool Conjugate,
typename RhsType,
typename DstType>
279 template <
typename MatrixType,
typename TranspositionType,
typename Workspace>
287 bool found_zero_pivot =
false;
291 transpositions.setIdentity();
305 Index index_of_biggest_in_corner;
306 mat.
diagonal().tail(
size -
k).cwiseAbs().maxCoeff(&index_of_biggest_in_corner);
307 index_of_biggest_in_corner +=
k;
309 transpositions.coeffRef(
k) = IndexType(index_of_biggest_in_corner);
310 if (
k != index_of_biggest_in_corner) {
313 Index s =
size - index_of_biggest_in_corner - 1;
314 mat.row(
k).head(
k).
swap(
mat.row(index_of_biggest_in_corner).head(
k));
315 mat.col(
k).tail(
s).
swap(
mat.col(index_of_biggest_in_corner).tail(
s));
317 for (
Index i =
k + 1;
i < index_of_biggest_in_corner; ++
i) {
336 temp.head(
k) =
mat.
diagonal().real().head(
k).asDiagonal() * A10.adjoint();
338 if (rs > 0) A21.noalias() -= A20 * temp.head(
k);
348 if (
k == 0 && !pivot_is_valid) {
353 transpositions.coeffRef(
j) = IndexType(
j);
359 if ((rs > 0) && pivot_is_valid)
364 if (found_zero_pivot && pivot_is_valid)
366 else if (!pivot_is_valid)
367 found_zero_pivot =
true;
376 else if (realAkk <
static_cast<RealScalar>(0))
391 template <
typename MatrixType,
typename WDerived>
419 w.tail(rs) -= wj *
mat.col(
j).tail(rs);
425 template <
typename MatrixType,
typename TranspositionType,
typename Workspace,
typename WType>
429 tmp = transpositions *
w;
437 template <
typename MatrixType,
typename TranspositionType,
typename Workspace>
444 template <
typename MatrixType,
typename TranspositionType,
typename Workspace,
typename WType>
452 template <
typename MatrixType>
460 template <
typename MatrixType>
472 template <
typename MatrixType,
int UpLo_>
473 template <
typename InputType>
511 template <
typename MatrixType,
int UpLo_>
512 template <
typename Derived>
534 #ifndef EIGEN_PARSED_BY_DOXYGEN
535 template <
typename MatrixType_,
int UpLo_>
536 template <
typename RhsType,
typename DstType>
538 _solve_impl_transposed<true>(rhs, dst);
541 template <
typename MatrixType_,
int UpLo_>
542 template <
bool Conjugate,
typename RhsType,
typename DstType>
549 matrixL().template conjugateIf<!Conjugate>().solveInPlace(dst);
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);
593 template <
typename MatrixType,
int UpLo_>
594 template <
typename Derived>
599 bAndX = this->
solve(bAndX);
607 template <
typename MatrixType,
int UpLo_>
632 template <
typename MatrixType,
unsigned int UpLo>
642 template <
typename Derived>
AnnoyingScalar abs(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:135
AnnoyingScalar conj(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:133
int i
Definition: BiCGSTAB_step_by_step.cpp:9
#define EIGEN_GENERIC_PUBLIC_INTERFACE(Derived)
Definition: Macros.h:1149
#define EIGEN_NOEXCEPT
Definition: Macros.h:1267
#define EIGEN_CONSTEXPR
Definition: Macros.h:758
#define EIGEN_DEVICE_FUNC
Definition: Macros.h:892
#define eigen_assert(x)
Definition: Macros.h:910
#define EIGEN_STRONG_INLINE
Definition: Macros.h:834
RowVector3d w
Definition: Matrix_resize_int.cpp:3
cout<< "Here is the matrix m:"<< endl<< m<< endl;Matrix< ptrdiff_t, 3, 1 > res
Definition: PartialRedux_count.cpp:3
#define EIGEN_STATIC_ASSERT_NON_INTEGER(TYPE)
Definition: StaticAssert.h:74
Scalar * b
Definition: benchVecAdd.cpp:17
SCALAR Scalar
Definition: bench_gemm.cpp:45
NumTraits< Scalar >::Real RealScalar
Definition: bench_gemm.cpp:46
MatrixXf MatrixType
Definition: benchmark-blocking-sizes.cpp:52
Expression of a fixed-size or dynamic-size block.
Definition: Block.h:110
Expression of a diagonal/subdiagonal/superdiagonal in a matrix.
Definition: Diagonal.h:68
Robust Cholesky decomposition of a matrix with pivoting.
Definition: LDLT.h:63
MatrixType_ MatrixType
Definition: LDLT.h:65
LDLT & compute(const EigenBase< InputType > &matrix)
const TranspositionType & transpositionsP() const
Definition: LDLT.h:154
Traits::MatrixL matrixL() const
Definition: LDLT.h:147
Diagonal< const MatrixType > vectorD() const
Definition: LDLT.h:160
ComputationInfo m_info
Definition: LDLT.h:269
internal::SignMatrix m_sign
Definition: LDLT.h:267
const MatrixType & matrixLDLT() const
Definition: LDLT.h:218
bool m_isInitialized
Definition: LDLT.h:268
void setZero()
Definition: LDLT.h:138
void _solve_impl(const RhsType &rhs, DstType &dst) const
Definition: LDLT.h:537
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT
Definition: LDLT.h:234
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT
Definition: LDLT.h:233
TranspositionType m_transpositions
Definition: LDLT.h:265
Transpositions< RowsAtCompileTime, MaxRowsAtCompileTime > TranspositionType
Definition: LDLT.h:77
RealScalar rcond() const
Definition: LDLT.h:206
internal::LDLT_Traits< MatrixType, UpLo > Traits
Definition: LDLT.h:80
MatrixType m_matrix
Definition: LDLT.h:263
bool isNegative(void) const
Definition: LDLT.h:172
LDLT()
Default Constructor.
Definition: LDLT.h:87
bool isPositive() const
Definition: LDLT.h:166
void _solve_impl_transposed(const RhsType &rhs, DstType &dst) const
Definition: LDLT.h:543
LDLT(const EigenBase< InputType > &matrix)
Constructor with decomposition.
Definition: LDLT.h:109
SolverBase< LDLT > Base
Definition: LDLT.h:66
RealScalar m_l1_norm
Definition: LDLT.h:264
LDLT(Index size)
Default Constructor with memory preallocation.
Definition: LDLT.h:95
LDLT & rankUpdate(const MatrixBase< Derived > &w, const RealScalar &alpha=1)
LDLT(EigenBase< InputType > &matrix)
Constructs a LDLT factorization from a given matrix.
Definition: LDLT.h:126
Matrix< Scalar, RowsAtCompileTime, 1, 0, MaxRowsAtCompileTime, 1 > TmpMatrixType
Definition: LDLT.h:75
TmpMatrixType m_temporary
Definition: LDLT.h:266
MatrixType reconstructedMatrix() const
Definition: LDLT.h:608
ComputationInfo info() const
Reports whether previous computation was successful.
Definition: LDLT.h:241
Traits::MatrixU matrixU() const
Definition: LDLT.h:141
bool solveInPlace(MatrixBase< Derived > &bAndX) const
Definition: LDLT.h:595
const LDLT & adjoint() const
Definition: LDLT.h:231
@ MaxColsAtCompileTime
Definition: LDLT.h:72
@ MaxRowsAtCompileTime
Definition: LDLT.h:71
@ UpLo
Definition: LDLT.h:73
PermutationMatrix< RowsAtCompileTime, MaxRowsAtCompileTime > PermutationType
Definition: LDLT.h:78
Base class for all dense matrices, vectors, and expressions.
Definition: MatrixBase.h:52
const LDLT< PlainObject > ldlt() const
Definition: LDLT.h:643
Permutation matrix.
Definition: PermutationMatrix.h:280
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE void resize(Index rows, Index cols)
Definition: PlainObjectBase.h:294
const LDLT< PlainObject, UpLo > ldlt() const
Definition: LDLT.h:634
Pseudo expression representing a solving operation.
Definition: Solve.h:62
A base class for matrix decomposition and solvers.
Definition: SolverBase.h:72
internal::traits< LDLT< MatrixType_, UpLo_ > >::Scalar Scalar
Definition: SolverBase.h:75
constexpr EIGEN_DEVICE_FUNC LDLT< MatrixType_, UpLo_ > & derived()
Definition: EigenBase.h:49
const Solve< LDLT< MatrixType_, UpLo_ >, Rhs > solve(const MatrixBase< Rhs > &b) const
Definition: SolverBase.h:106
Scalar coeff(Index row, Index col) const
Definition: SparseMatrix.h:211
const ConstDiagonalReturnType diagonal() const
Definition: SparseMatrix.h:757
void swap(SparseMatrix &other)
Definition: SparseMatrix.h:829
Index cols() const
Definition: SparseMatrix.h:161
Scalar & coeffRef(Index row, Index col)
Definition: SparseMatrix.h:275
Index rows() const
Definition: SparseMatrix.h:159
Expression of the transpose of a matrix.
Definition: Transpose.h:56
Transpose< TranspositionsBase > transpose() const
Definition: Transpositions.h:95
void resize(Index newSize)
Definition: Transpositions.h:63
StorageIndex & coeffRef(Index i)
Definition: Transpositions.h:47
IndicesType::Scalar StorageIndex
Definition: Transpositions.h:147
Expression of a triangular part in a matrix.
Definition: TriangularMatrix.h:167
Eigen::Map< Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic, Eigen::ColMajor >, 0, Eigen::OuterStride<> > matrix(T *data, int rows, int cols, int stride)
Definition: common.h:85
float real
Definition: datatypes.h:10
#define min(a, b)
Definition: datatypes.h:22
static constexpr Eigen::internal::all_t all
Definition: IndexedViewHelper.h:86
ComputationInfo
Definition: Constants.h:438
@ Lower
Definition: Constants.h:211
@ Upper
Definition: Constants.h:213
@ NumericalIssue
Definition: Constants.h:442
@ Success
Definition: Constants.h:440
RealScalar s
Definition: level1_cplx_impl.h:130
Eigen::DenseIndex ret
Definition: level1_cplx_impl.h:43
RealScalar alpha
Definition: level1_cplx_impl.h:151
EIGEN_BLAS_FUNC() swap(int *n, RealScalar *px, int *incx, RealScalar *py, int *incy)
Definition: level1_impl.h:117
const Scalar * a
Definition: level2_cplx_impl.h:32
int * m
Definition: level2_cplx_impl.h:294
char char char int int * k
Definition: level2_impl.h:374
Eigen::Matrix< Scalar, Dynamic, Dynamic, ColMajor > tmp
Definition: level3_impl.h:365
#define isfinite(X)
Definition: main.h:111
SignMatrix
Definition: LDLT.h:34
@ PositiveSemiDef
Definition: LDLT.h:34
@ ZeroSign
Definition: LDLT.h:34
@ NegativeSemiDef
Definition: LDLT.h:34
@ Indefinite
Definition: LDLT.h:34
Decomposition::RealScalar rcond_estimate_helper(typename Decomposition::RealScalar matrix_norm, const Decomposition &dec)
Reciprocal condition number estimator.
Definition: ConditionEstimator.h:157
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE bool() isfinite(const Eigen::bfloat16 &h)
Definition: BFloat16.h:752
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bool is_exactly_zero(const X &x)
Definition: Meta.h:592
EIGEN_DEVICE_FUNC bool abs2(bool x)
Definition: MathFunctions.h:1102
Namespace containing all symbols from the Eigen library.
Definition: bench_norm.cpp:70
squared absolute value
Definition: GlobalFunctions.h:87
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:83
Extend namespace for flags.
Definition: fsi_chan_precond_driver.cc:56
T sign(T x)
Definition: cxx11_tensor_builtins_sycl.cpp:172
int sigma
Definition: calibrate.py:179
Definition: Eigen_Colamd.h:49
Mdouble gamma(Mdouble gamma_in)
This is the gamma function returns the true value for the half integer value.
Definition: ExtendedMath.cc:116
Definition: EigenBase.h:33
Eigen::Index Index
The interface type of indices.
Definition: EigenBase.h:43
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index size() const EIGEN_NOEXCEPT
Definition: EigenBase.h:64
Definition: Constants.h:534
Holds information about the various numeric (i.e. scalar) types allowed by Eigen.
Definition: NumTraits.h:217
Definition: Constants.h:525
static MatrixL getL(const MatrixType &m)
Definition: LDLT.h:456
const TriangularView< const typename MatrixType::AdjointReturnType, UnitUpper > MatrixU
Definition: LDLT.h:455
static MatrixU getU(const MatrixType &m)
Definition: LDLT.h:457
const TriangularView< const MatrixType, UnitLower > MatrixL
Definition: LDLT.h:454
const TriangularView< const typename MatrixType::AdjointReturnType, UnitLower > MatrixL
Definition: LDLT.h:462
static MatrixL getL(const MatrixType &m)
Definition: LDLT.h:464
const TriangularView< const MatrixType, UnitUpper > MatrixU
Definition: LDLT.h:463
static MatrixU getU(const MatrixType &m)
Definition: LDLT.h:465
static bool updateInPlace(MatrixType &mat, MatrixBase< WDerived > &w, const typename MatrixType::RealScalar &sigma=1)
Definition: LDLT.h:392
static bool unblocked(MatrixType &mat, TranspositionType &transpositions, Workspace &temp, SignMatrix &sign)
Definition: LDLT.h:280
static bool update(MatrixType &mat, const TranspositionType &transpositions, Workspace &tmp, const WType &w, const typename MatrixType::RealScalar &sigma=1)
Definition: LDLT.h:426
static EIGEN_STRONG_INLINE bool update(MatrixType &mat, TranspositionType &transpositions, Workspace &tmp, WType &w, const typename MatrixType::RealScalar &sigma=1)
Definition: LDLT.h:445
static EIGEN_STRONG_INLINE bool unblocked(MatrixType &mat, TranspositionType &transpositions, Workspace &temp, SignMatrix &sign)
Definition: LDLT.h:438
MatrixXpr XprKind
Definition: LDLT.h:24
SolverStorage StorageKind
Definition: LDLT.h:25
int StorageIndex
Definition: LDLT.h:26
Definition: ForwardDeclarations.h:21
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2