Namespaces | |
| namespace | detail |
Functions | |
| template<typename T > | |
| std::vector< T > | gram_schmidt (const Matrix< T > &s, Matrix< T > &l, T norm_thresh=precision_scaled< T >(1e-14)) |
| Performs Gram-Schmidt orthogonalisation without normalisation. | |
| template<typename value_type , typename value_type_abs > | |
| Matrix< value_type > | construct_lin_trans_in_orthogonal_set (const Matrix< value_type > &overlap, const Matrix< value_type > &lin_trans, const std::vector< value_type_abs > &norm) |
| Construct Gram-Schmidt linear transformation in orthogonal vectors. | |
| template<class R , typename value_type_abs > | |
| auto | modified_gram_schmidt (VecRef< R > ¶ms, array::ArrayHandler< R, R > &handler, value_type_abs null_thresh) |
| Apply modified Gram-Schmidt procedure to orthonormalise parameters. | |
| template<class R , class Q , class Z , class W > | |
| auto | overlap (const CVecRef< R > &left, const CVecRef< Q > &right, array::ArrayHandler< Z, W > &handler) -> std::enable_if_t< detail::Z_and_W_are_one_of_R_and_Q< R, Q, Z, W >, Matrix< typename array::ArrayHandler< Z, W >::value_type > > |
| Calculates overlap matrix between left and right vectors. | |
| template<class R > | |
| Matrix< typename array::ArrayHandler< R, R >::value_type > | overlap (const CVecRef< R > ¶ms, array::ArrayHandler< R, R > &handler) |
| Calculates overlap matrix for a parameter set. Matrix is hermitian by construction. | |
| template<typename T > | |
| std::vector< real_type_t< T > > | solution_norms (const Matrix< T > &solutions, const Matrix< T > &overlap) |
| The Euclidean norms of the solutions x_i = sum_j c_ij b_j, from their subspace coefficients c (one row per solution) and the overlap matrix S_jk = <b_j|b_k> of the subspace vectors, as sqrt((c S c^dagger)_ii), calculated together with one matrix product. | |
| template<typename T > | |
| Matrix< T > | unit_length_solutions (const Matrix< T > &solutions, const Matrix< T > &overlap) |
| The subspace coefficients of the solutions scaled to unit Euclidean length, so that their sizes can be compared with thresholds whatever the normalisation of the solutions (e.g. in the metric of a generalised eigenproblem) | |
| template<typename T > | |
| void | matrix_symmetrize (Matrix< T > &mat) |
| Replaces a matrix by its hermitian part, which for a real element type is its symmetric part. | |
| template<typename T > | |
| Matrix< T >::coord_type | max_element_index (const std::list< size_t > &rows, const std::list< size_t > &cols, const Matrix< T > &mat) |
| Return maximum element in a matrix along specified rows and columns. | |
| template<typename Slice > | |
| std::vector< size_t > | eye_order (const Slice &mat) |
| Returns order of rows in a matrix slice that brings it closest to identity. | |
| Matrix< value_type > molpro::linalg::itsolv::subspace::util::construct_lin_trans_in_orthogonal_set | ( | const Matrix< value_type > & | overlap, |
| const Matrix< value_type > & | lin_trans, | ||
| const std::vector< value_type_abs > & | norm | ||
| ) |
Construct Gram-Schmidt linear transformation in orthogonal vectors.
Let {v} be the original vectors, and {u} their orthogonal set.
We can construct {u} from {v} using lower triangular linear transformation matrix L u_0 = v_0 u_1 = v_1 + L_{1,0} v_0 u_i = \sum_{j=0}^i L_{i,j} v_j
However, we can also construct u_i using v_i and previous {u}, using a lower triangular transformation matrix T, u_i = v_i - \sum_{j=0}^{i-1} <v_i,u_j> / <u_j, u_j> u_j = v_i + \sum_j=0^{i-1} T_{i,j} u_j
T_{i,j} = - <v_i,u_j> / <u_j, u_j> = - \sum_{k=0}^{j} L_{j,k} <v_i,v_k> / <u_j, u_j>
T_{i,j} = 0 if i >= j
| overlap | Overlap matrix of original non-orthogonal vectors |
| lin_trans | Gram-Schmidt linear transformation to an orthogonal set in terms of original vectors |
| norm | norms of orthogonal vectors constructed from lin_trans @Returns linear transformation set |
| std::vector< size_t > molpro::linalg::itsolv::subspace::util::eye_order | ( | const Slice & | mat | ) |
Returns order of rows in a matrix slice that brings it closest to identity.
| Slice | Slice type |
| mat | square matrix |
| std::vector< T > molpro::linalg::itsolv::subspace::util::gram_schmidt | ( | const Matrix< T > & | s, |
| Matrix< T > & | l, | ||
| T | norm_thresh = precision_scaled<T>(1e-14) |
||
| ) |
Performs Gram-Schmidt orthogonalisation without normalisation.
Any orthogonal vector with a norm less than threshold is not orthogonalised against.
For a vector set {v} with overlap matrix 

u_0 = v_0 u_1 = v_1 - <v_1, u_0> / <u_0, u_0> u_i = v_i -\sum_j=0^{i-1} <v_i, u_j> / <u_j, u_j> u_j = v_i -\sum_j=0^{i-1} <v_i, u_j> / <u_j, u_j> \sum_{k=0}^j L_{jk} v_k = v_i -\sum_j=0^{i-1} (\sum_{k=0}^{j} W_{ij} / N_{jj} L_{jk}) v_k
Let the overlap between u and v be, 
W_{ij} = <v_i, u_j> = \sum_{k=0}^{j} S_{ik} L_{jk} N_{ii} = <u_i, u_i> = \sum_{k} L_{ik} <v_k, u_i> = \sum_{km} L_{ik} L_{im} S_{km}
L_{0,j} = \delta_{i,j} L_{i,k} = \delta_{i,k} - (1 + \delta_{i,k})(\sum_{j=0}^{k} W_{ij} / N_{jj} L_{jk})
| s | overlap matrix |
| l | row matrix with linear transformation into orthonormal basis. Upper triangular component is zero. |
| norm_thresh | generated vector with norm less than threshold is not used for subsequent orthogonalisation |
Replaces a matrix by its hermitian part, which for a real element type is its symmetric part.
| Matrix< T >::coord_type molpro::linalg::itsolv::subspace::util::max_element_index | ( | const std::list< size_t > & | rows, |
| const std::list< size_t > & | cols, | ||
| const Matrix< T > & | mat | ||
| ) |
Return maximum element in a matrix along specified rows and columns.
| auto molpro::linalg::itsolv::subspace::util::modified_gram_schmidt | ( | VecRef< R > & | params, |
| array::ArrayHandler< R, R > & | handler, | ||
| value_type_abs | null_thresh | ||
| ) |
Apply modified Gram-Schmidt procedure to orthonormalise parameters.
New vectors with norm less than threshold are considered null and are not normalised. Their indices in params are returned.
| R | |
| value_type_abs |
| params | |
| handler | |
| null_thresh |
| auto molpro::linalg::itsolv::subspace::util::overlap | ( | const CVecRef< R > & | left, |
| const CVecRef< Q > & | right, | ||
| array::ArrayHandler< Z, W > & | handler | ||
| ) | -> std::enable_if_t<detail::Z_and_W_are_one_of_R_and_Q<R, Q, Z, W>, Matrix<typename array::ArrayHandler<Z, W>::value_type>> |
Calculates overlap matrix between left and right vectors.
| Matrix< typename array::ArrayHandler< R, R >::value_type > molpro::linalg::itsolv::subspace::util::overlap | ( | const CVecRef< R > & | params, |
| array::ArrayHandler< R, R > & | handler | ||
| ) |
Calculates overlap matrix for a parameter set. Matrix is hermitian by construction.
| std::vector< real_type_t< T > > molpro::linalg::itsolv::subspace::util::solution_norms | ( | const Matrix< T > & | solutions, |
| const Matrix< T > & | overlap | ||
| ) |
The Euclidean norms of the solutions x_i = sum_j c_ij b_j, from their subspace coefficients c (one row per solution) and the overlap matrix S_jk = <b_j|b_k> of the subspace vectors, as sqrt((c S c^dagger)_ii), calculated together with one matrix product.
| Matrix< T > molpro::linalg::itsolv::subspace::util::unit_length_solutions | ( | const Matrix< T > & | solutions, |
| const Matrix< T > & | overlap | ||
| ) |
The subspace coefficients of the solutions scaled to unit Euclidean length, so that their sizes can be compared with thresholds whatever the normalisation of the solutions (e.g. in the metric of a generalised eigenproblem)
| solutions | coefficients of the solutions, one row per solution |
| overlap | overlap matrix of the subspace vectors |