|
TRIQS/nda 2.0.0
Multi-dimensional array library for C++
|
Various other linear algebra related operations.
Functions | |
| template<Scalar T, typename LP = F_layout> | |
| auto | nda::linalg::get_permutation_matrix (Vector auto const &ipiv, int m) |
| Get the permutation matrix \( \mathbf{P} \) from the pivot indices returned by nda::lapack::getrf or other LAPACK routines. | |
| template<Scalar T, typename LP = F_layout> | |
| auto | nda::linalg::get_permutation_matrix (Vector auto const &sigma, bool column_permutations=false) |
| Get the permutation matrix \( \mathbf{P} \) from a permutation vector \( \mathbf{\sigma} \). | |
| auto | nda::linalg::get_permutation_vector (Vector auto const &ipiv, int m) |
| Get the permutation vector \( \mathbf{\sigma} \) from the pivot indices returned by nda::lapack::getrf or other LAPACK routines. | |
| auto nda::linalg::get_permutation_matrix | ( | Vector auto const & | ipiv, |
| int | m ) |
#include <nda/linalg/utils.hpp>
Get the permutation matrix \( \mathbf{P} \) from the pivot indices returned by nda::lapack::getrf or other LAPACK routines.
It simply calls nda::linalg::get_permutation_vector to get the permutation vector from the pivot indices, and then calls nda::linalg::get_permutation_matrix to get the permutation matrix.
| T | nda::Scalar value type of the permutation matrix. |
| LP | Policy determining the memory layout of the permutation matrix. |
| ipiv | nda::Vector containing the pivot indices returned by nda::lapack::getrf. |
| m | Number of rows/columns of the square permutation matrix \( \mathbf{P} \). |
| auto nda::linalg::get_permutation_matrix | ( | Vector auto const & | sigma, |
| bool | column_permutations = false ) |
#include <nda/linalg/utils.hpp>
Get the permutation matrix \( \mathbf{P} \) from a permutation vector \( \mathbf{\sigma} \).
The function constructs the permutation matrix \( \mathbf{P} \) of size \( m \times m \) from the permutation vector \( \sigma \) of size \( m \).
The permutation matrix only has the following non-zero elements (for all \( i = 0, 1, \ldots, m - 1 \)):
| T | nda::Scalar value type of the permutation matrix. |
| LP | Policy determining the memory layout of the permutation matrix. |
| sigma | nda::Vector containing the permutation vector with values \( \in \{0, 1, \ldots, m - 1 \} \). |
| column_permutations | If true, constructs the permutation matrix for column permutations. |
| auto nda::linalg::get_permutation_vector | ( | Vector auto const & | ipiv, |
| int | m ) |
#include <nda/linalg/utils.hpp>
Get the permutation vector \( \mathbf{\sigma} \) from the pivot indices returned by nda::lapack::getrf or other LAPACK routines.
The function constructs the permutation vector \( \mathbf{\sigma} \) of size \( m \) from the pivot index vector ipiv of size \( l \). Starting from an identity permutation, i.e. \( \mathbf{\sigma} = (0, 1, \ldots, m - 1) \), it interchanges \( \sigma_i \) with \( \sigma_{\mathrm{ipiv}_i - 1} \) for all \( i = 0, 1, \dots, l - 1 \).
| ipiv | nda::Vector containing the pivot indices returned by nda::lapack::getrf. |
| m | Number of elements of the permutation vector \( \mathbf{\sigma} \). |