EllAlgo 1.6.13
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
LDLTMgr Class Reference

LDLT factorization. More...

#include <ldlt_mgr.hpp>

Public Member Functions

 LDLTMgr (size_t N)
 Construct a new ldlt ext object.
 
 LDLTMgr (const LDLTMgr &)=delete
 
LDLTMgroperator= (const LDLTMgr &)=delete
 
 LDLTMgr (LDLTMgr &&)=default
 
LDLTMgroperator= (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
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ LDLTMgr() [1/3]

LDLTMgr::LDLTMgr ( size_t  N)
inlineexplicit

Construct a new ldlt ext object.

Parameters
[in]Ndimension

◆ LDLTMgr() [2/3]

LDLTMgr::LDLTMgr ( const LDLTMgr )
delete

◆ LDLTMgr() [3/3]

LDLTMgr::LDLTMgr ( LDLTMgr &&  )
default

◆ ~LDLTMgr()

LDLTMgr::~LDLTMgr ( )
default

Member Function Documentation

◆ factor()

template<typename Fn >
auto LDLTMgr::factor ( Fn  get_matrix_elem) -> bool
inline

Perform LDLT Factorization (Lazy evaluation)

Template Parameters
Fncallable type with signature double(size_t, size_t)
Parameters
[in]get_matrix_elemfunction to access the elements of A
Returns
bool true if factorization was successful, false otherwise

See also: factorize()

◆ factor_with_allow_semidefinite()

template<typename Fn >
auto LDLTMgr::factor_with_allow_semidefinite ( Fn  get_matrix_elem) -> bool
inline

Perform LDLT Factorization (Lazy evaluation)

Template Parameters
Fncallable type with signature double(size_t, size_t)
Parameters
[in]get_matrix_elemfunction to access the elements of A
Returns
bool true if factorization was successful, false otherwise

See also: factorize()

◆ factorize()

template<typename Mat >
auto LDLTMgr::factorize ( const Mat &  A) -> bool
inline

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.

Parameters
[in]ASymmetric Matrix

◆ is_spd()

constexpr auto LDLTMgr::is_spd ( ) const -> bool
inlineconstexprnoexcept

Check if the matrix is symmetric positive definite.

Returns
bool True if the matrix is SPD, false otherwise.

◆ operator=() [1/2]

LDLTMgr & LDLTMgr::operator= ( const LDLTMgr )
delete

◆ operator=() [2/2]

LDLTMgr & LDLTMgr::operator= ( LDLTMgr &&  )
delete

◆ set_witness_vec()

template<typename Arr036 >
auto LDLTMgr::set_witness_vec ( Arr036 v) const -> void
inline

Set the witness vec object.

Template Parameters
Arr036
Parameters
[in]v

◆ sqrt()

template<typename Mat >
auto LDLTMgr::sqrt ( Mat &  M) -> void
inline

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.

Template Parameters
Mat
Parameters
[in,out]M

◆ sym_quad()

template<typename Mat >
auto LDLTMgr::sym_quad ( const Mat &  A) const -> double
inline

Calculate v'*{A}(pos,pos)*v.

Template Parameters
Mat
Parameters
[in]A
Returns
double

◆ witness()

auto LDLTMgr::witness ( ) -> double

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.

Returns
double

Member Data Documentation

◆ _n

size_t LDLTMgr::_n

dimension

◆ pos

Rng LDLTMgr::pos {0U, 0U}

the rows where the process starts and stops

◆ witness_vec

Vec LDLTMgr::witness_vec

witness vector


The documentation for this class was generated from the following file: