1.1.2. chase::Algorithm
-
template<class T>
class Algorithm Implementation of ChASE solver using the abstract of interfaces of numerical components defined in class chase::ChASE.
This class contains the essential methods to solve eigenproblems using the ChASE algorithm, including Lanczos for spectrum bounds estimation, Chebyshev filters, and degree optimization for the filter.
- Template Parameters:
T – The data type used in the solver (e.g.,
float,double).
Public Static Functions
-
static void solve(ChaseBase<T> *single)
Solves eigenproblems using the ChASE solver.
This static method is used to solve eigenvalue problems using the ChASE algorithm, utilizing the provided kernel (which is a
ChaseBase<T>).- Parameters:
single – A pointer to an object that implements the
ChaseBase<T>interface. The object contains the actual computation logic for the solver.
-
static std::size_t calc_degrees(ChaseBase<T> *kernel, std::size_t N, std::size_t unconverged, std::size_t nex, Base<T> upperb, Base<T> lowerb, Base<T> tol, Base<T> *ritzv, Base<T> *resid, Base<T> *residLast, std::size_t *degrees, std::size_t locked)
Optimizes the degree of the Chebyshev polynomial based on the convergence of Ritz pairs.
This method optimizes the degree of the Chebyshev polynomial filter, adjusting it dynamically based on the convergence behavior of the Ritz pairs.
- Parameters:
kernel – A pointer to the
ChaseBase<T>instance, which provides the necessary numerical operations.N – The total size of the problem.
unconverged – The number of unconverged eigenpairs.
nex – The number of external searching space.
upperb – The upper bound for the spectrum.
lowerb – The lower bound for the spectrum.
tol – The tolerance for the degree calculation.
ritzv – The array storing the Ritz values.
resid – The array storing the residuals of the Ritz values.
residLast – The array storing the residuals from the previous iteration.
degrees – The array storing the degrees for each Ritz pair.
locked – The number of locked eigenpairs.
- Returns:
The optimized polynomial degree.
-
static std::size_t calc_degrees_quasi(ChaseBase<T> *kernel, std::size_t N, std::size_t unconverged, std::size_t nex, Base<T> upperb, Base<T> lowerb, Base<T> tol, Base<T> *ritzv, Base<T> *resid, Base<T> *residLast, std::size_t *degrees, std::size_t locked)
Specialized degree optimization for quasi-hermitian matrices with cluster-aware features.
This method provides enhanced degree optimization specifically designed for quasi-hermitian eigenvalue problems, including cluster detection and adaptive degree spacing.
- Parameters:
kernel – A pointer to the
ChaseBase<T>instance, which provides the necessary numerical operations.N – The total size of the problem.
unconverged – The number of unconverged eigenpairs.
nex – The number of external searching space.
upperb – The upper bound for the spectrum.
lowerb – The lower bound for the spectrum.
tol – The tolerance for the degree calculation.
ritzv – The array storing the Ritz values.
resid – The array storing the residuals of the Ritz values.
residLast – The array storing the residuals from the previous iteration.
degrees – The array storing the degrees for each Ritz pair.
locked – The number of locked eigenpairs.
- Returns:
The optimized polynomial degree.
-
static void detect_eigenvalue_clusters(Base<T> *ritzv, Base<T> *resid, Base<T> tol, std::size_t unconverged, std::size_t nex, Base<T> upperb, Base<T> lowerb, std::vector<Base<T>> &cluster_factors)
Detects eigenvalue clusters and computes spacing factors for degree optimization.
This helper method analyzes eigenvalue clustering and computes spacing factors to improve degree optimization for clustered eigenvalues.
- Parameters:
ritzv – The array storing the Ritz values.
resid – The array storing the residuals of the Ritz values.
tol – The convergence tolerance.
unconverged – The number of unconverged eigenpairs.
nex – The number of external searching space.
upperb – The upper bound for the spectrum.
lowerb – The lower bound for the spectrum.
cluster_factors – Output array for computed spacing factors.
-
static std::size_t locking(ChaseBase<T> *kernel, std::size_t N, std::size_t unconverged, Base<T> tol, Base<T> *ritzv, Base<T> *resid, Base<T> *residLast, std::size_t *degrees, std::size_t locked)
Sorts the Ritz values based on residuals and locks the converged ones.
This method sorts the Ritz values according to their residuals and locks the converged eigenpairs to prevent further processing.
- Parameters:
kernel – A pointer to the
ChaseBase<T>instance.N – The total size of the problem.
unconverged – The number of unconverged eigenpairs.
tol – The convergence tolerance for residuals.
ritzv – The array storing the Ritz values.
resid – The array storing the residuals of the Ritz values.
residLast – The array storing the residuals from the previous iteration.
degrees – The array storing the degrees of the Ritz pairs.
locked – The number of already locked eigenpairs.
- Returns:
The number of locked eigenpairs.
-
static std::size_t locking_quasi(ChaseBase<T> *single, std::size_t N, std::size_t unconverged, std::size_t nex, Base<T> tol, std::size_t *index, Base<T> *Lritzv, Base<T> *resid, Base<T> *residLast, std::size_t *degrees, std::size_t locked, std::size_t iteration)
-
static std::size_t filter(ChaseBase<T> *kernel, std::size_t n, std::size_t unprocessed, std::size_t deg, std::size_t *degrees, Base<T> lambda_1, Base<T> lower, Base<T> upper)
Implements the Chebyshev filter.
This method applies the Chebyshev filter for eigenvalue problems, typically used in conjunction with the other methods for solving large eigenvalue problems efficiently.
- Parameters:
kernel – A pointer to the
ChaseBase<T>instance.n – The number of vectors.
unprocessed – The number of unprocessed vectors.
deg – The degree of the Chebyshev filter.
degrees – An array containing the degrees of each Ritz pair.
lambda_1 – The lower bound for the Chebyshev filter.
lower – The lower bound of the spectrum.
upper – The upper bound of the spectrum.
- Returns:
The number of processed vectors after applying the filter.
-
static std::size_t lanczos(ChaseBase<T> *kernel, int N, int numvec, int m, int nevex, Base<T> *upperb, bool mode, Base<T> *ritzv_)
Implements the Lanczos method to estimate bounds in ChASE.
This method uses the Lanczos algorithm to estimate the required spectrum bounds for ChASE.
- Parameters:
kernel – A pointer to the
ChaseBase<T>instance.N – The total size of the problem.
numvec – The number of vectors.
m – The number of Lanczos iterations.
nevex – The number of eigenpairs to be computed.
upperb – The array storing the upper bounds of the spectrum.
mode – A boolean indicating whether to run Lanczos in a specific mode.
ritzv_ – The array storing the Ritz values.
- Returns:
The number of bounds estimated by Lanczos.