|
akreon-linalg
Fixed-size linear algebra and numerical methods in C++26.
|
Factors a real symmetric matrix as A = L D L^T without pivoting. More...
#include <ldl.hpp>
Public Types | |
| using | SymmetricBase = SymmetricOperator< Mat, LDL< Mat > > |
| alias for symmetric matrix | |
Public Types inherited from linalg::SymmetricOperator< Mat, LDL< Mat > > | |
| using | OperatorBase = Endomorphism< Mat, SymmetricOperator< Mat, LDL< Mat > > > |
| alias to extract base types | |
Public Types inherited from linalg::Endomorphism< Mat, Derived > | |
| using | T = matrix_scalar_t< Mat > |
| alias helpers for types | |
| using | ScalarT = real_type_t< T > |
| using | ComplexT = std::complex< ScalarT > |
Public Member Functions | |
| constexpr | LDL (const Mat &A) |
| Factor a symmetric matrix as A = L D L^T. | |
| constexpr | LDL (const Mat &A, const config::FactorConfig< T > &config_in) |
| Factor a symmetric matrix with explicit pivot tolerance. | |
| constexpr auto | D () const |
| Reconstruct the diagonal factor. | |
| constexpr auto | L () const |
| Reconstruct the unit lower-triangular factor. | |
| constexpr auto | solve (const Vector< T, N > &b) const |
| Solve A x = b using the stored LDL^T factors. | |
| constexpr T | det () const |
| Compute the determinant from the diagonal pivots. | |
| template<linalg::MatrixContainer MatIn> requires (std::same_as<linalg::matrix_scalar_t<MatIn>, T>) | |
| constexpr auto | apply (const MatIn &Y) const |
| Solve A X = Y one column at a time. | |
Public Member Functions inherited from linalg::SymmetricOperator< Mat, LDL< Mat > > | |
| constexpr | SymmetricOperator (const Mat &A) |
| CTOR. | |
| constexpr auto | operator() (std::size_t i, std::size_t j) const |
| get element at (i,j) index | |
| constexpr std::size_t | index (std::size_t i, std::size_t j) const |
| index from (row, col) | |
| constexpr bool | is_pd () const |
| is pd check | |
| constexpr bool | is_nd () const |
| is nd check | |
| constexpr bool | is_psd () const |
| is psd check | |
| constexpr bool | is_nsd () const |
| is nsd check | |
| constexpr bool | is_ind () const |
| is indefinite | |
| constexpr bool | is_valid () const |
| is valid | |
| constexpr void | compute_definiteness (const Vector< DiagT, N > &diag, const ScalarT &tol) |
| compute definiteness | |
| constexpr const LDL< Mat > & | self () const |
| self | |
Public Member Functions inherited from linalg::Endomorphism< Mat, Derived > | |
| constexpr const T & | operator() (std::size_t i, std::size_t j) const |
| get element at (i,j) index | |
| constexpr T & | operator() (std::size_t i, std::size_t j) |
| get element at (i,j) index | |
| constexpr Derived & | self () |
| self | |
| constexpr const Derived & | self () const |
| self | |
Additional Inherited Members | |
Public Attributes inherited from linalg::SymmetricOperator< Mat, LDL< Mat > > | |
| SymmetricOperatorType | type |
| member variables | |
| Vector< T, DIM > | svec |
Static Public Attributes inherited from linalg::SymmetricOperator< Mat, LDL< Mat > > | |
| static constexpr std::size_t | DIM |
| helpers to get DIM from mat | |
Static Public Attributes inherited from linalg::Endomorphism< Mat, Derived > | |
| static constexpr std::size_t | N = mat_rows_v<Mat> |
| helper to extract N | |
Factors a real symmetric matrix as A = L D L^T without pivoting.
forward declaration of LDL^T operator
| Mat | Square symmetric matrix type. |
| using linalg::LDL< Mat >::SymmetricBase = SymmetricOperator<Mat, LDL<Mat> > |
|
inlineexplicitconstexpr |
Factor a symmetric matrix as A = L D L^T.
| [in] | A | Square symmetric input matrix. |
Definition at line 40 of file ldl.hpp.
References linalg::mat_rows_v.
|
inlineexplicitconstexpr |
Factor a symmetric matrix with explicit pivot tolerance.
| [in] | A | Square symmetric input matrix. |
| [in] | config_in | Factorization settings, including pivot tolerance. |
Definition at line 48 of file ldl.hpp.
References linalg::mat_rows_v.
|
inlineconstexpr |
Solve A X = Y one column at a time.
| MatIn | Matrix type sharing the factorization scalar type. |
| [in] | Y | Right-hand-side matrix with N rows. |
Definition at line 106 of file ldl.hpp.
References linalg::get_col(), linalg::is_fatal_event(), linalg::mat_rows_v, linalg::Endomorphism< Mat, Derived >::N, linalg::NONE, and linalg::LDL< Mat >::solve().
|
inlineconstexpr |
Reconstruct the diagonal factor.
Definition at line 58 of file ldl.hpp.
References linalg::make_diag().
|
inlineconstexpr |
Compute the determinant from the diagonal pivots.
Definition at line 90 of file ldl.hpp.
References linalg::mat_rows_v.
|
inlineconstexpr |
Reconstruct the unit lower-triangular factor.
Definition at line 65 of file ldl.hpp.
References linalg::mat_rows_v.
Referenced by linalg::LDL< Mat >::solve().
|
inlineconstexpr |
Solve A x = b using the stored LDL^T factors.
Solve L y = b, D z = y, then L^T x = z.
| [in] | b | Right-hand side with N entries. |
Definition at line 75 of file ldl.hpp.
References linalg::is_fatal_event(), linalg::LDL< Mat >::L(), linalg::mat_rows_v, linalg::NONE, and linalg::transpose().
Referenced by linalg::LDL< Mat >::apply().