13 namespace MREInitCG4DChronoPredictorEnv
22 unsigned int max_chrono = 1;
28 XMLReader paramtop(xml, path);
29 read( paramtop,
"./MaxChrono", max_chrono);
30 read( paramtop,
"./MaxEvec", max_evec);
31 read( paramtop,
"./opt_eigen_id", opt_eigen_id);
34 QDPIO::cerr <<
"Caught exception reading XML: " << e << std::endl;
64 const LatticeFermion&
chi)
80 const LatticeFermion&
chi)
84 const Subset&
s=
A.subset();
91 QDPIO::cout <<
"MREInitCG Predictor: Got " << Nchrono <<
" chrono vecs" << std::endl;
101 LatticeFermion tmpvec;
110 multi1d<LatticeFermion> v(Nchrono);
111 QDPIO::cout <<
"MREInitCG Predictor: Orthonormalizing the " << Nchrono <<
" chrono vecs" << std::endl;
114 for(
int i=0;
i < Nchrono;
i++) {
122 LatticeFermion tmpvec;
148 multi2d<DComplex>
G(Nchrono,Nchrono);
150 for(
int m = 0 ;
m < Nchrono;
m++) {
151 LatticeFermion tmpvec;
154 for(
int n = 0;
n < Nchrono;
n++) {
160 multi1d<DComplex>
b(Nchrono);
162 for(
int n = 0;
n < Nchrono;
n++) {
169 multi1d<DComplex>
a(Nchrono);
174 psi[
s] = Complex(
a[0])*v[0];
175 for(
int n=1;
n < Nchrono;
n++) {
181 QDPIO::cout <<
"MRE InitCG predictor: psi prepared " << std::endl;
187 QDPIO::cout <<
"There are " << Nevec <<
" current EVs" << std::endl;
190 LatticeFermion tmpvec;
191 multi1d<LatticeFermion> ev(Nevec);
192 for(
int i=0;
i < Nevec;
i++) {
201 QDPIO::cout <<
"MREInitCG: Making up little matrix" << std::endl;
203 multi1d<Real> lambda(Nevec);
204 for(
int i=0;
i < Nevec;
i++) {
206 lambda[
i] = innerProductReal(ev[
i], tmpvec,
s);
210 multi1d<Complex> offd(Nevec*(Nevec-1)/2);
212 for(
int i=0;
i < Nevec;
i++) {
214 for(
int j=0;
j <
i;
j++) {
220 QDPIO::cout <<
"MREInitCG: Calling Jacobi Diagonalizer " << std::endl;
221 Real rsda=Real(1.0e-5);
222 int n_jacob =
SN_Jacob(ev, Nevec, lambda, offd,
226 int vecs_to_copy=Nevec;
231 QDPIO::cout <<
"MREInitCG: Copying " << vecs_to_copy <<
" vecs into EigInfo " << std::endl;
234 for(
int i=0;
i < vecs_to_copy;
i++) {
238 QDPIO::cout <<
"MREInitCG: Resetting nCurVal" << std::endl;
Primary include file for CHROMA library code.
void CvToLatFerm(LatticeFermion &lf, const Subset &s, int v) const
void CvToEigCGvec(const LatticeFermion &lf, const Subset &s, int v)
Minimal residual predictor.
Handle< CircularBuffer< LatticeFermion > > chrono_buf
void operator()(LatticeFermion &psi, const LinearOperator< LatticeFermion > &A, const LatticeFermion &chi)
void find_extrap_solution(LatticeFermion &psi, const LinearOperator< LatticeFermion > &A, const LatticeFermion &chi)
Gramm-Schmidt orthogonolization.
Gramm-Schmidt orthogonolization.
void GramSchm(multi1d< LatticeFermion > &psi, const int Npsi, const multi1d< LatticeFermion > &vec, const int Nvec, const Subset &sub)
Gramm-Schmidt orthogonolization.
int SN_Jacob(multi1d< LatticeFermion > &psi, const int N_eig, multi1d< Real > &lambda, multi1d< Complex > &off_diag, Real tolerance, int N_max, const Subset &sub)
Single-node Jacobi rotation.
void read(XMLReader &xml, const std::string &path, AsqtadFermActParams ¶m)
Read parameters.
void LUSolve(multi1d< DComplex > &a, const multi2d< DComplex > &M, const multi1d< DComplex > &b)
Solve M a = b by LU decomposition with partial pivoting.
Named object function std::map.
static bool registered
Local registration flag.
BinaryReturn< C1, C2, FnInnerProduct >::Type_t innerProduct(const QDPSubType< T1, C1 > &s1, const QDPType< T2, C2 > &s2)
bool registerAll()
Register all the factories.
multi1d< LatticeColorMatrix > G
Asqtad Staggered-Dirac operator.
multi1d< LatticeFermion > chi(Ncb)
multi1d< LatticeFermion > s(Ncb)
FloatingPoint< double > Double