|
EllAlgo 1.6.13
|
LDLT factorization. More...
#include <ldlt_mgr.hpp>
Public Member Functions | |
| LDLTMgr (size_t N) | |
| Construct a new ldlt ext object. | |
| LDLTMgr (const LDLTMgr &)=delete | |
| LDLTMgr & | operator= (const LDLTMgr &)=delete |
| LDLTMgr (LDLTMgr &&)=default | |
| LDLTMgr & | operator= (LDLTMgr &&)=delete |
| ~LDLTMgr ()=default | |
| template<typename Mat > | |
| auto | factorize (const Mat &A) -> bool |
| Perform LDLT Factorization. | |
| template<typename Fn > | |
| auto | factor (Fn get_matrix_elem) -> bool |
| Perform LDLT Factorization (Lazy evaluation) | |
| template<typename Fn > | |
| auto | factor_with_allow_semidefinite (Fn get_matrix_elem) -> bool |
| Perform LDLT Factorization (Lazy evaluation) | |
| constexpr auto | is_spd () const noexcept -> bool |
| Check if the matrix is symmetric positive definite. | |
| auto | witness () -> double |
| witness that certifies $A$ is not symmetric positive definite (spd) | |
| template<typename Arr036 > | |
| auto | set_witness_vec (Arr036 &v) const -> void |
| Set the witness vec object. | |
| template<typename Mat > | |
| auto | sym_quad (const Mat &A) const -> double |
| Calculate v'*{A}(pos,pos)*v. | |
| template<typename Mat > | |
| auto | sqrt (Mat &M) -> void |
| Return upper triangular matrix $R$ where $A = R^T R$. | |
Public Attributes | |
| Rng | pos {0U, 0U} |
| the rows where the process starts and stops | |
| Vec | witness_vec |
| witness vector | |
| size_t | _n |
| dimension | |
LDLT factorization.
LDLTMgr is a class that performs the LDLT factorization for a given symmetric matrix. The LDLT factorization decomposes a symmetric matrix A into the product of a lower triangular matrix L, a diagonal matrix D, and the transpose of L. This factorization is useful for solving linear systems and eigenvalue problems. The class provides methods to perform the factorization, check if the matrix is positive definite, calculate a witness vector if it is not positive definite, and calculate the symmetric quadratic form.
|
inlineexplicit |
Construct a new ldlt ext object.
| [in] | N | dimension |
|
default |
|
default |
Perform LDLT Factorization (Lazy evaluation)
| Fn | callable type with signature double(size_t, size_t) |
| [in] | get_matrix_elem | function to access the elements of A |
See also: factorize()
Perform LDLT Factorization (Lazy evaluation)
| Fn | callable type with signature double(size_t, size_t) |
| [in] | get_matrix_elem | function to access the elements of A |
See also: factorize()
Perform LDLT Factorization.
The factorize function is a template function that takes a symmetric matrix A as input and performs the LDLT factorization on it. It calls the factor function with a lambda function as an argument. The lambda function takes the indices i and j and returns the element A(i, j) of the matrix A. The factor function performs the actual factorization using the provided lambda function. The factorize function returns a boolean value indicating whether the factorization was successful or not.
| [in] | A | Symmetric Matrix |
Check if the matrix is symmetric positive definite.
Set the witness vec object.
| Arr036 |
| [in] | v |
Return upper triangular matrix $R$ where $A = R^T R$.
The sqrt function calculates the square root of a symmetric positive definite matrix M. It assumes that M is a zero matrix and calculates the upper triangular matrix R such that M = R^T * R.
| Mat |
| [in,out] | M |
Calculate v'*{A}(pos,pos)*v.
| Mat |
| [in] | A |
witness that certifies $A$ is not symmetric positive definite (spd)
The witness() function calculates a witness that certifies that the matrix A is not symmetric positive definite (spd). It returns a double value that represents the witness.
| size_t LDLTMgr::_n |
dimension
| Rng LDLTMgr::pos {0U, 0U} |
the rows where the process starts and stops
| Vec LDLTMgr::witness_vec |
witness vector