|
ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
|
Right-preconditioned CGS with a compact active set of columns. More...
#include <linear_cgs.h>
Public Member Functions | |
| LinearCGS (const double tolerance, const diag_comm_info &comm) | |
| LinearSolveResult | solve (const LinearOperator< T, Device > &op, const LinearOperator< T, Device > &preconditioner, int ld, int nband, int dim, T *x, const T *b, const T *initial_residual, const int max_iterations) |
| Solve A*x=b in Device memory, preserving padding and caller column order. | |
Private Types | |
| enum | WorkspaceSlot { residual_slot = 0 , shadow_slot = 1 , direction_slot = 2 , q_slot = 3 , u_slot = 4 , image_slot = 5 , scratch_slot = 6 , update_slot = 7 , solution_slot = 8 } |
Private Member Functions | |
| bool | iterate (const LinearOperator< T, Device > &op, const LinearOperator< T, Device > &preconditioner, const bool first_iteration, LinearSolveResult *result) |
| void | retire_converged () |
Private Attributes | |
| const double | tolerance_ |
| LinearWorkspace< T, Device > | work_ |
| int | ld_ = 0 |
| int | dim_ = 0 |
| int | active_ = 0 |
| std::vector< T > | beta_ |
| std::vector< T > | rho_ |
| std::vector< T > | rho_prev_ |
| std::vector< T > | alpha_ |
| std::vector< T > | denominator_ |
| std::vector< T > | norm_ |
| std::vector< double > | threshold_ |
| std::vector< int > | original_ |
| std::vector< int > | swaps_ |
Right-preconditioned CGS with a compact active set of columns.
|
private |
| hsolver::LinearCGS< T, Device >::LinearCGS | ( | const double | tolerance, |
| const diag_comm_info & | comm ) |
|
private |
|
private |
| LinearSolveResult hsolver::LinearCGS< T, Device >::solve | ( | const LinearOperator< T, Device > & | op, |
| const LinearOperator< T, Device > & | preconditioner, | ||
| int | ld, | ||
| int | nband, | ||
| int | dim, | ||
| T * | x, | ||
| const T * | b, | ||
| const T * | initial_residual, | ||
| const int | max_iterations ) |
Solve A*x=b in Device memory, preserving padding and caller column order.
| initial_residual | Optional initial residual, reused on the first cycle only; otherwise nullptr. |
| max_iterations | Iteration budget for this call, shared by all restart cycles. |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |