QUDA
1.0.0
|
This computes the optimum guess for the system Ax=b in the L2 residual norm. For use in the HMD force calculations using a minimal residual chronological method. This computes the guess solution as a linear combination of a given number of previous solutions. Following Brower et al, only the orthogonalised vector basis is stored to conserve memory. More...
#include <invert_quda.h>
Public Member Functions | |
MinResExt (DiracMatrix &mat, bool orthogonal, bool apply_mat, bool hermitian, TimeProfile &profile) | |
virtual | ~MinResExt () |
void | operator() (ColorSpinorField &x, ColorSpinorField &b, std::vector< std::pair< ColorSpinorField *, ColorSpinorField *> > basis) |
void | operator() (ColorSpinorField &x, ColorSpinorField &b, std::vector< ColorSpinorField *> p, std::vector< ColorSpinorField *> q) |
Protected Member Functions | |
void | solve (Complex *psi_, std::vector< ColorSpinorField *> &p, std::vector< ColorSpinorField *> &q, ColorSpinorField &b, bool hermitian) |
Solve the equation A p_k psi_k = q_k psi_k = b by minimizing the residual and using Eigen's SVD algorithm for numerical stability. More... | |
Protected Attributes | |
const DiracMatrix & | mat |
bool | orthogonal |
bool | apply_mat |
Whether to construct an orthogonal basis or not. More... | |
bool | hermitian |
Whether to compute q = Ap or assume it is provided. More... | |
TimeProfile & | profile |
whether A is hermitian ot not More... | |
This computes the optimum guess for the system Ax=b in the L2 residual norm. For use in the HMD force calculations using a minimal residual chronological method. This computes the guess solution as a linear combination of a given number of previous solutions. Following Brower et al, only the orthogonalised vector basis is stored to conserve memory.
If Eigen support is enabled then Eigen's SVD algorithm is used for solving the linear system, else Gaussian elimination with partial pivots is used.
Definition at line 1171 of file invert_quda.h.
quda::MinResExt::MinResExt | ( | DiracMatrix & | mat, |
bool | orthogonal, | ||
bool | apply_mat, | ||
bool | hermitian, | ||
TimeProfile & | profile | ||
) |
mat | The operator for the linear system we wish to solve |
orthogonal | Whether to construct an orthogonal basis prior to constructing the linear system |
apply_mat | Whether to apply the operator in place or assume q already contains this Timing profile to use |
Definition at line 7 of file inv_mre.cpp.
|
virtual |
Definition at line 12 of file inv_mre.cpp.
void quda::MinResExt::operator() | ( | ColorSpinorField & | x, |
ColorSpinorField & | b, | ||
std::vector< std::pair< ColorSpinorField *, ColorSpinorField *> > | basis | ||
) |
x | The optimum for the solution vector. |
b | The source vector in the equation to be solved. This is not preserved and is overwritten by the new residual. |
basis | Vector of pairs storing the basis (p,Ap) |
Definition at line 165 of file inv_mre.cpp.
void quda::MinResExt::operator() | ( | ColorSpinorField & | x, |
ColorSpinorField & | b, | ||
std::vector< ColorSpinorField *> | p, | ||
std::vector< ColorSpinorField *> | q | ||
) |
x | The optimum for the solution vector. |
b | The source vector in the equation to be solved. This is not preserved. |
p | The basis vectors in which we are building the guess |
q | The basis vectors multiplied by A |
Definition at line 82 of file inv_mre.cpp.
References apply_mat, quda::blas::ax(), quda::blas::caxpy(), quda::blas::cDotProduct(), quda::blas::copy(), getVerbosity(), hermitian, quda::TimeProfile::isRunning(), mat, quda::blas::norm2(), orthogonal, printfQuda, profile, quda::QUDA_PROFILE_CHRONO, QUDA_SUMMARIZE, solve(), quda::sqrt(), X, and quda::blas::zero().
|
protected |
Solve the equation A p_k psi_k = q_k psi_k = b by minimizing the residual and using Eigen's SVD algorithm for numerical stability.
[out] | psi | Array of coefficients |
[in] | p | Search direction vectors |
[in] | q | Search direction vectors with the operator applied |
[in] | hermitian | Whether the linear system is Hermitian or not |
Definition at line 18 of file inv_mre.cpp.
References quda::blas::cDotProduct(), profile, quda::QUDA_PROFILE_CHRONO, and quda::QUDA_PROFILE_EIGEN.
Referenced by operator()().
|
protected |
Whether to construct an orthogonal basis or not.
Definition at line 1176 of file invert_quda.h.
Referenced by operator()().
|
protected |
Whether to compute q = Ap or assume it is provided.
Definition at line 1177 of file invert_quda.h.
Referenced by operator()().
|
protected |
Definition at line 1174 of file invert_quda.h.
Referenced by operator()().
|
protected |
Definition at line 1175 of file invert_quda.h.
Referenced by operator()().
|
protected |
whether A is hermitian ot not
Definition at line 1178 of file invert_quda.h.
Referenced by operator()(), and solve().