Go to the documentation of this file.
7 #ifndef SPECTRA_RITZ_PAIRS_H
8 #define SPECTRA_RITZ_PAIRS_H
11 #include <Eigen/Eigenvalues>
13 #include "../Util/SelectionRule.h"
17 template <
typename Scalar>
22 template <
typename Scalar>
57 std::vector<Index>
ind = argsort(selection,
m_values);
76 bool converged =
true;
78 for (
Index j = 0;
j < norms.size();
j++)
81 if (
j < number_eigenvalues)
83 converged &= (norms[
j] <
tol);
106 template <
typename Scalar>
113 Matrix small_matrix = basis_vectors.transpose() * op_basis_prod;
121 m_vectors = basis_vectors * m_small_vectors;
124 m_residues = op_basis_prod * m_small_vectors - m_vectors * m_values.asDiagonal();
125 return eigen_solver.
info();
130 #endif // SPECTRA_RITZ_PAIRS_H
const Matrix & operator_basis_product() const
Returns the operator applied to basis vector.
const Matrix & basis_vectors() const
Returns the basis vectors.
General-purpose arrays with easy API for coefficient-wise operations.
const EIGEN_DEVICE_FUNC RealVectorType & eigenvalues() const
Returns the eigenvalues of given matrix.
void sort(SortRule selection)
BoolArray m_root_converged
const BoolArray & converged_eigenvalues() const
EIGEN_DEVICE_FUNC ComputationInfo info() const
Reports whether previous computation was successful.
const Matrix & ritz_vectors() const
const EIGEN_DEVICE_FUNC EigenvectorsType & eigenvectors() const
Returns the eigenvectors of given matrix.
const Matrix & small_ritz_vectors() const
Computes eigenvalues and eigenvectors of selfadjoint matrices.
Eigen::ComputationInfo compute_eigen_pairs(const SearchSpace< Scalar > &search_space)
const Matrix & residues() const
const Vector & ritz_values() const
bool check_convergence(Scalar tol, Index number_eigenvalues)
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
gtsam
Author(s):
autogenerated on Thu Apr 10 2025 03:03:07