Bridge++  Ver. 2.0.2
aeigensolver_IRLanczos-tmpl.h
Go to the documentation of this file.
1 
14 #include "aeigensolver_IRLanczos.h"
15 
16 #ifdef __PGI
17 #pragma global opt=1
18 // This is becaouse for PGI compiler on some environment,
19 // compilation with optimization level higher than O2 fails.
20 // [12 Feb 2021 H.Matsufuru]
21 #endif
22 
23 using std::string;
24 
25 template<typename FIELD, typename FOPR>
26 const std::string AEigensolver_IRLanczos<FIELD, FOPR>::
27 class_name = "AEigensolver_IRLanczos";
28 
29 //====================================================================
30 template<typename FIELD, typename FOPR>
32 {
33  if (m_sorter) delete m_sorter;
34 }
35 
36 
37 //====================================================================
38 template<typename FIELD, typename FOPR>
40  const Parameters& params)
41 {
42  std::string vlevel;
43  if (!params.fetch_string("verbose_level", vlevel)) {
44  m_vl = vout.set_verbose_level(vlevel);
45  }
46 
47  //- fetch and check input parameters
48  string str_sortfield_type;
49  int Nk, Np;
50  int Niter_eigen;
51  double Enorm_eigen, Vthreshold;
52 
53  int err = 0;
54  err += params.fetch_string("eigensolver_mode", str_sortfield_type);
55  err += params.fetch_int("number_of_wanted_eigenvectors", Nk);
56  err += params.fetch_int("number_of_working_eigenvectors", Np);
57  err += params.fetch_int("maximum_number_of_iteration", Niter_eigen);
58  err += params.fetch_double("convergence_criterion_squared", Enorm_eigen);
59  err += params.fetch_double("threshold_value", Vthreshold);
60 
61  if (err) {
62  vout.crucial(m_vl, "Error at %s: input parameter not found.\n",
63  class_name.c_str());
64  exit(EXIT_FAILURE);
65  }
66 
67  set_parameters(str_sortfield_type, Nk, Np, Niter_eigen, Enorm_eigen,
68  Vthreshold);
69 }
70 
71 
72 //====================================================================
73 template<typename FIELD, typename FOPR>
75 {
76  params.set_string("eigensolver_mode", m_sort_type);
77  params.set_int("number_of_wanted_eigenvectors", m_Nk);
78  params.set_int("number_of_working_eigenvectors", m_Np);
79  params.set_int("maximum_number_of_iteration", m_Niter_eigen);
80  params.set_double("convergence_criterion_squared", m_Enorm_eigen);
81  params.set_double("threshold_value", m_Vthreshold);
82 
83  params.set_string("verbose_level", vout.get_verbose_level(m_vl));
84 }
85 
86 
87 //====================================================================
88 template<typename FIELD, typename FOPR>
90  const std::string& sort_type,
91  int Nk, int Np,
92  int Niter_eigen,
93  double Enorm_eigen,
94  double Vthreshold)
95 {
96  if (m_sorter) delete m_sorter;
97 
98  m_sort_type = sort_type;
99  m_sorter = new Sorter<real_t>(sort_type);
100 
101  set_parameters(Nk, Np, Niter_eigen, Enorm_eigen, Vthreshold);
102 }
103 
104 
105 //====================================================================
106 template<typename FIELD, typename FOPR>
108  int Nk, int Np,
109  int Niter_eigen,
110  double Enorm_eigen,
111  double Vthreshold)
112 {
113  //- range check
114  int err = 0;
115  err += ParameterCheck::non_negative(Nk);
116  err += ParameterCheck::non_negative(Np);
117  err += ParameterCheck::non_negative(Niter_eigen);
118  err += ParameterCheck::square_non_zero(Enorm_eigen);
119  // NB. Vthreshold == 0 is allowed.
120 
121  if (err) {
122  vout.crucial(m_vl, "Error at %s: parameter range check failed.\n",
123  class_name.c_str());
124  exit(EXIT_FAILURE);
125  }
126 
127  //- store values
128  m_Nk = Nk;
129  m_Np = Np;
130  m_Niter_eigen = Niter_eigen;
131  m_Enorm_eigen = real_t(Enorm_eigen);
132  m_Vthreshold = real_t(Vthreshold);
133 
134  //- print input parameters
135  vout.general(m_vl, "%s:\n", class_name.c_str());
136  vout.general(m_vl, " Nk = %d\n", m_Nk);
137  vout.general(m_vl, " Np = %d\n", m_Np);
138  vout.general(m_vl, " Niter_eigen = %d\n", m_Niter_eigen);
139  vout.general(m_vl, " Enorm_eigen = %16.8e\n", m_Enorm_eigen);
140  vout.general(m_vl, " Vthreshold = %16.8e\n", m_Vthreshold);
141 
142  int Nm = m_Nk + m_Np;
143  m_TDb.resize(Nm);
144  m_TDa2.resize(Nm);
145  m_TDb2.resize(Nm);
146  m_Qt.resize(Nm * Nm);
147  m_Iconv.resize(Nm);
148 
149  int Nin = m_fopr->field_nin();
150  int Nvol = m_fopr->field_nvol();
151  int Nex = m_fopr->field_nex();
152 
153  m_B.resize(Nm);
154  for (int k = 0; k < Nm; ++k) {
155  m_B[k].reset(Nin, Nvol, Nex);
156  }
157 
158  m_f.reset(Nin, Nvol, Nex);
159  m_v.reset(Nin, Nvol, Nex);
160 }
161 
162 
163 //====================================================================
164 template<typename FIELD, typename FOPR>
166  std::vector<complex_t>& TDac,
167  std::vector<FIELD>& vk,
168  int& Nsbt, int& Nconv, const FIELD& b)
169 {
170  int size = TDac.size();
171  std::vector<real_t> TDa(size);
172 
173  solve(TDa, vk, Nsbt, Nconv, b);
174 
175  for (int i = 0; i < size; ++i) {
176  TDac[i] = cmplx(TDa[i], real_t(0.0));
177  }
178 }
179 
180 
181 //====================================================================
182 template<typename FIELD, typename FOPR>
184  std::vector<real_t>& TDa,
185  std::vector<FIELD>& vk,
186  int& Nsbt, int& Nconv, const FIELD& b)
187 {
188  int Nk = m_Nk;
189  int Np = m_Np;
190  int Niter_eigen = m_Niter_eigen;
191  real_t Enorm_eigen = m_Enorm_eigen;
192  real_t Vthreshold = m_Vthreshold;
193 
194  int Nm = Nk + Np;
195 
196  if (Nk + Np > TDa.size()) {
197  vout.crucial(m_vl, "Error at %s: std::vector TDa is too small.\n",
198  class_name.c_str());
199  exit(EXIT_FAILURE);
200  } else if (Nk + Np > vk.size()) {
201  vout.crucial(m_vl, "Error at %s: std::vector vk is too small.\n",
202  class_name.c_str());
203  exit(EXIT_FAILURE);
204  }
205 
206  vout.general(m_vl, " Nk = %d Np = %d\n", Nk, Np);
207  vout.general(m_vl, " Nm = %d\n", Nm);
208  vout.general(m_vl, " size of TDa = %d\n", TDa.size());
209  vout.general(m_vl, " size of vk = %d\n", vk.size());
210 
211  Nconv = -1;
212  Nsbt = 0;
213 
214  int k1 = 1;
215  int k2 = Nk;
216  int Kdis = 0;
217  int Kthreshold = 0;
218 
219  int nconv;
220 
221 #pragma omp parallel
222  {
223  //- set initial vector
224  real_t bnorm2 = b.norm2();
225  if (bnorm2 > 1.e-12) { // b is regarded as a nonzero vector
226  copy(vk[0], b);
227  } else {
228  vk[0].set(1.0); // start with a uniform vector
229  }
230 
231  //- normalizing the initial vector
232  real_t vnorm = vk[0].norm2();
233  vnorm = 1.0 / sqrt(vnorm);
234  scal(vk[0], vnorm);
235 
236  //- initial Nk steps
237  for (int k = 0; k < k2; ++k) {
238  step(Nm, k, TDa, m_TDb, vk, m_f);
239  }
240 
241 #pragma omp barrier
242 
243  //- restarting loop begins
244  for (int iter = 0; iter < Niter_eigen; ++iter) {
245  vout.detailed(m_vl, "\n iter=%d\n", iter);
246 
247  for (int k = k2; k < Nm; ++k) {
248  step(Nm, k, TDa, m_TDb, vk, m_f);
249  }
250 
251  scal(m_f, m_TDb[Nm - 1]);
252 
253 #pragma omp master
254  {
255  for (int k = 0; k < Nm; ++k) {
256  m_TDa2[k] = TDa[k + k1 - 1];
257  m_TDb2[k] = m_TDb[k + k1 - 1];
258  }
259 
260  //- getting eigenvalues
261  setUnit_Qt(Nm, m_Qt);
262  tqri(m_TDa2, m_TDb2, Nm, Nm, m_Qt, nconv);
263  }
264 #pragma omp barrier
265 
266  if (nconv == -1) {
267  vout.crucial(m_vl, "Error at %s: QR method NOT converged.\n",
268  class_name.c_str());
269  exit(EXIT_FAILURE);
270  } else {
271  vout.paranoiac(m_vl, " tqri: converged at iter = %d\n", nconv);
272  }
273 
274 #pragma omp master
275  {
276  //- sorting
277  m_sorter->sort(m_TDa2, Nm);
278 
279  //- implicitly shifted QR transformations
280  setUnit_Qt(Nm, m_Qt);
281  for (int ip = k2; ip < Nm; ++ip) {
282  real_t Dsh = m_TDa2[ip];
283  int kmin = k1;
284  int kmax = Nm;
285  qrtrf(TDa, m_TDb, Nm, Nm, m_Qt, Dsh, kmin, kmax);
286  }
287  }
288 #pragma omp barrier
289 
290  for (int i = 0; i < (Nk + 1); ++i) {
291  m_B[i].set(0.0);
292  }
293 
294  for (int j = k1 - 1; j < k2 + 1; ++j) {
295  for (int k = 0; k < Nm; ++k) {
296  axpy(m_B[j], m_Qt[k + Nm * j], vk[k]);
297  }
298  }
299 
300  for (int j = k1 - 1; j < k2 + 1; ++j) {
301  copy(vk[j], m_B[j]);
302  }
303 
304  //- Compressed vector f and beta(k2)
305  scal(m_f, m_Qt[Nm - 1 + Nm * (k2 - 1)]);
306 
307  axpy(m_f, m_TDb[k2 - 1], vk[k2]);
308 
309  real_t beta_k;
310  beta_k = m_f.norm2();
311  beta_k = sqrt(beta_k);
312 
313  vout.detailed(m_vl, " beta(k) = %20.14f\n", beta_k);
314 
315  real_t beta_r = 1.0 / beta_k;
316  copy(vk[k2], m_f);
317  scal(vk[k2], beta_r);
318 
319  //- Convergence test
320 
321 #pragma omp master
322  {
323  m_TDb[k2 - 1] = beta_k;
324 
325  m_TDa2 = TDa;
326  m_TDb2 = m_TDb;
327 
328  setUnit_Qt(Nm, m_Qt);
329  // int nconv = -1;
330  tqri(m_TDa2, m_TDb2, Nk, Nm, m_Qt, nconv);
331  }
332 #pragma omp barrier
333 
334  if (nconv == -1) {
335  vout.crucial(m_vl, "Error at %s: QR method NOT converged.\n",
336  class_name.c_str());
337  exit(EXIT_FAILURE);
338  } else {
339  vout.paranoiac(m_vl, " tqri: converged at iter = %d\n", nconv);
340  }
341 
342  for (int k = 0; k < Nk; ++k) {
343  m_B[k].set(0.0);
344  }
345 
346  for (int j = 0; j < Nk; ++j) {
347  for (int k = 0; k < Nk; ++k) {
348  axpy(m_B[j], m_Qt[k + j * Nm], vk[k]);
349  }
350  }
351 
352 #pragma omp master
353  {
354  Kdis = 0;
355  Kthreshold = 0;
356  }
357 
358  for (int i = 0; i < Nk; ++i) {
359  m_fopr->mult(m_v, m_B[i]);
360  real_t vnum = dot(m_B[i], m_v);
361  real_t vden = dot(m_B[i], m_B[i]);
362  // real_t vden = m_B[i].norm2();
363  real_t vnorm = dot(m_v, m_v);
364  //real_t vnorm = m_v.norm2();
365  real_t TDa2_tmp = vnum / vden;
366  axpy(m_v, -TDa2_tmp, m_B[i]);
367 
368  //real_t vv = m_v.norm2();
369  real_t vv = dot(m_v, m_v);
370  vout.detailed(m_vl, " %4d %18.14f %18.14e\n", i, TDa2_tmp, vv);
371 
372 #pragma omp master
373  {
374  m_TDa2[i] = TDa2_tmp;
375  if (vv < Enorm_eigen) {
376  m_Iconv[Kdis] = i;
377  ++Kdis;
378  if (!m_sorter->comp(m_TDa2[i], Vthreshold)) {
379  ++Kthreshold;
380  }
381  }
382  } // omp master
383 #pragma omp barrier
384  } // i-loop end
385 
386  vout.detailed(m_vl, " #modes converged: %d\n", Kdis);
387 
388  if (Kthreshold > 0) {
389 #pragma omp master
390  {
391  // (there is a converged eigenvalue larger than Vthreshold.)
392  //- Sorting
393  for (int i = 0; i < Kdis; ++i) {
394  TDa[i] = m_TDa2[m_Iconv[i]];
395  }
396  Nsbt = Kdis - Kthreshold;
397  Nconv = iter;
398  }
399 #pragma omp barrier
400 
401  /*
402  std::vector<int> idx = m_sorter->sort_index(TDa, Kdis);
403  for (int i = 0; i < Kdis; ++i) {
404  copy(vk[i], m_B[m_Iconv[idx[i]]]);
405  }
406  */
407 #pragma omp barrier
408 
409  // break;
410  iter = Niter_eigen;
411  }
412  } // end of iter loop
413  } // omp parallel
414 
415  std::vector<int> idx = m_sorter->sort_index(TDa, Kdis);
416  for (int i = 0; i < Kdis; ++i) {
417  copy(vk[i], m_B[m_Iconv[idx[i]]]);
418  real_t vv = vk[i].norm2();
419  vv = 1.0 / sqrt(vv);
420  scal(vk[i], vv);
421  vv = vk[i].norm2();
422  vout.paranoiac(m_vl, " vk[%d]: norm2 = %22.14e\n", i, vv);
423  }
424 
425  if (Nconv == -1) {
426  vout.crucial(m_vl, "Error at %s: NOT converged.\n", class_name.c_str());
427  exit(EXIT_FAILURE);
428  } else {
429  vout.general(m_vl, "\n Converged:\n");
430  vout.general(m_vl, " Nconv = %d\n", Nconv);
431  // vout.general(m_vl, " beta(k) = %20.14e\n", beta_k);
432  vout.general(m_vl, " Kdis = %d\n", Kdis);
433  vout.general(m_vl, " Nsbt = %d\n", Nsbt);
434  }
435 }
436 
437 
438 //====================================================================
439 template<typename FIELD, typename FOPR>
441  int Nm, int k, std::vector<real_t>& TDa,
442  std::vector<real_t>& TDb, std::vector<FIELD>& vk,
443  FIELD& w)
444 {
445  if (k >= Nm) {
446  vout.crucial(m_vl, "Error at %s: k is larger than Nm.\n",
447  class_name.c_str());
448  exit(EXIT_FAILURE);
449  } else if (k == 0) { // Initial step
450  m_fopr->mult(w, vk[k]);
451 
452  real_t alph = dot(vk[k], w);
453 
454  axpy(w, -alph, vk[k]);
455 
456  real_t beta = dot(w, w);
457  beta = sqrt(beta);
458  real_t beta_r = 1.0 / beta;
459  copy(vk[k + 1], w);
460  scal(vk[k + 1], beta_r);
461 
462  // vout.paranoiac(m_vl, " step %d alph = %e beta = %e\n",
463  // k, alph, beta);
464 #pragma omp master
465  {
466  TDa[k] = alph;
467  TDb[k] = beta;
468  }
469  } else { // Iteration step
470  m_fopr->mult(w, vk[k]);
471 
472  axpy(w, -TDb[k - 1], vk[k - 1]);
473 
474  real_t alph = dot(vk[k], w);
475 
476  axpy(w, -alph, vk[k]);
477 
478  real_t beta = dot(w, w);
479  beta = sqrt(beta);
480  real_t beta_r = 1.0 / beta;
481  scal(w, beta_r);
482 
483  // vout.paranoiac(m_vl, " step %d alph = %e beta = %e\n",
484  // k, alph, beta);
485 
486 #pragma omp master
487  {
488  TDa[k] = alph;
489  TDb[k] = beta;
490  }
491 
492  schmidt_orthogonalization(w, vk, k);
493 
494  if (k < Nm - 1) copy(vk[k + 1], w);
495  }
496 }
497 
498 
499 //====================================================================
500 template<typename FIELD, typename FOPR>
502  FIELD& w,
503  std::vector<FIELD>& vk,
504  int k)
505 {
506  for (int j = 0; j < k; ++j) {
507  // dcomplex prod = dotc(vk[j], w);
508  complex_t prod = dotc(vk[j], w);
509  prod *= cmplx(-1.0, 0.0);
510  axpy(w, prod, vk[j]);
511 
512  // vout.paranoiac(m_vl, "Schmitd (%d, %d): %e %e\n",
513  // j, k, real(prod), imag(prod) );
514  }
515 }
516 
517 
518 //====================================================================
519 template<typename FIELD, typename FOPR>
521  int Nm, std::vector<real_t>& Qt)
522 {
523  for (int i = 0; i < Qt.size(); ++i) {
524  Qt[i] = 0.0;
525  }
526 
527  for (int k = 0; k < Nm; ++k) {
528  Qt[k + k * Nm] = 1.0;
529  }
530 }
531 
532 
533 //====================================================================
534 template<typename FIELD, typename FOPR>
536  std::vector<real_t>& TDa, std::vector<real_t>& TDb,
537  int Nk, int Nm, std::vector<real_t>& Qt, int& nconv)
538 {
539  int Niter = 100 * Nm;
540  int kmin = 1;
541  int kmax = Nk;
542  // (these parameters should be tuned)
543 
544  nconv = -1;
545 
546  for (int iter = 0; iter < Niter; ++iter) {
547  //- determination of 2x2 leading submatrix
548  real_t dsub = TDa[kmax - 1] - TDa[kmax - 2];
549  real_t dd = sqrt(dsub * dsub + 4.0 * TDb[kmax - 2] * TDb[kmax - 2]);
550  real_t Dsh = 0.5 * (TDa[kmax - 2] + TDa[kmax - 1]
551  + fabs(dd) * (dsub / fabs(dsub)));
552  // (Dsh: shift)
553 
554  //- transformation
555  qrtrf(TDa, TDb, Nk, Nm, Qt, Dsh, kmin, kmax);
556 
557  //- Convergence criterion (redef of kmin and kmax)
558  for (int j = kmax - 1; j >= kmin; --j) {
559  real_t dds = fabs(TDa[j - 1]) + fabs(TDa[j]);
560  if (fabs(TDb[j - 1]) + dds > dds) {
561  kmax = j + 1;
562 
563  for (int j = 0; j < kmax - 1; ++j) {
564  real_t dds = fabs(TDa[j]) + fabs(TDa[j + 1]);
565 
566  if (fabs(TDb[j]) + dds > dds) {
567  kmin = j + 1;
568 
569  break;
570  }
571  }
572 
573  break;
574  }
575 
576  if (j == kmin) {
577  nconv = iter;
578  // vout.paranoiac(m_vl, " tqri: converged at iter = %d\n", Nconv);
579  return;
580  }
581  } // end of j loop
582  } // end of iter loop
583 
584  /*
585  if (Nconv == -1) {
586  vout.crucial(m_vl, "Error at %s: QR method NOT converged, Niter = %d.\n",
587  class_name.c_str(), Niter);
588  exit(EXIT_FAILURE);
589  }
590  */
591 }
592 
593 
594 //====================================================================
595 template<typename FIELD, typename FOPR>
597  std::vector<real_t>& TDa,
598  std::vector<real_t>& TDb,
599  int Nk, int Nm, std::vector<real_t>& Qt,
600  real_t Dsh, int kmin, int kmax)
601 {
602  int k = kmin - 1;
603  real_t x;
604 
605  real_t Fden = 1.0 / sqrt((TDa[k] - Dsh) * (TDa[k] - Dsh)
606  + TDb[k] * TDb[k]);
607  real_t c = (TDa[k] - Dsh) * Fden;
608  real_t s = -TDb[k] * Fden;
609 
610  real_t tmpa1 = TDa[k];
611  real_t tmpa2 = TDa[k + 1];
612  real_t tmpb = TDb[k];
613 
614  TDa[k] = c * c * tmpa1 + s * s * tmpa2 - 2.0 * c * s * tmpb;
615  TDa[k + 1] = s * s * tmpa1 + c * c * tmpa2 + 2.0 * c * s * tmpb;
616  TDb[k] = c * s * (tmpa1 - tmpa2) + (c * c - s * s) * tmpb;
617  x = -s * TDb[k + 1];
618  TDb[k + 1] = c * TDb[k + 1];
619 
620  for (int i = 0; i < Nk; ++i) {
621  real_t Qtmp1 = Qt[i + Nm * k];
622  real_t Qtmp2 = Qt[i + Nm * (k + 1)];
623  Qt[i + Nm * k] = c * Qtmp1 - s * Qtmp2;
624  Qt[i + Nm * (k + 1)] = s * Qtmp1 + c * Qtmp2;
625  }
626 
627  //- Givens transformations
628  for (int k = kmin; k < kmax - 1; ++k) {
629  real_t Fden = 1.0 / sqrt(x * x + TDb[k - 1] * TDb[k - 1]);
630  real_t c = TDb[k - 1] * Fden;
631  real_t s = -x * Fden;
632 
633  real_t tmpa1 = TDa[k];
634  real_t tmpa2 = TDa[k + 1];
635  real_t tmpb = TDb[k];
636  TDa[k] = c * c * tmpa1 + s * s * tmpa2 - 2.0 * c * s * tmpb;
637  TDa[k + 1] = s * s * tmpa1 + c * c * tmpa2 + 2.0 * c * s * tmpb;
638  TDb[k] = c * s * (tmpa1 - tmpa2) + (c * c - s * s) * tmpb;
639  TDb[k - 1] = c * TDb[k - 1] - s * x;
640  if (k != kmax - 2) {
641  x = -s * TDb[k + 1];
642  TDb[k + 1] = c * TDb[k + 1];
643  }
644 
645  for (int i = 0; i < Nk; ++i) {
646  real_t Qtmp1 = Qt[i + Nm * k];
647  real_t Qtmp2 = Qt[i + Nm * (k + 1)];
648  Qt[i + Nm * k] = c * Qtmp1 - s * Qtmp2;
649  Qt[i + Nm * (k + 1)] = s * Qtmp1 + c * Qtmp2;
650  }
651  }
652 }
653 
654 
655 //====================================================================
656 //============================================================END=====
AEigensolver_IRLanczos::qrtrf
void qrtrf(std::vector< real_t > &TDa, std::vector< real_t > &TDb, int Nk, int Nm, std::vector< real_t > &Qt, real_t Dsh, int kmin, int kmax)
Definition: aeigensolver_IRLanczos-tmpl.h:596
AEigensolver_IRLanczos::setUnit_Qt
void setUnit_Qt(int Nm, std::vector< real_t > &Qt)
Definition: aeigensolver_IRLanczos-tmpl.h:520
Parameters::set_string
void set_string(const string &key, const string &value)
Definition: parameters.cpp:39
Parameters
Class for parameters.
Definition: parameters.h:46
Parameters::set_double
void set_double(const string &key, const double value)
Definition: parameters.cpp:33
Bridge::BridgeIO::detailed
void detailed(const char *format,...)
Definition: bridgeIO.cpp:219
AEigensolver::real_t
FIELD::real_t real_t
Definition: aeigensolver.h:45
AEigensolver_IRLanczos::~AEigensolver_IRLanczos
~AEigensolver_IRLanczos()
Definition: aeigensolver_IRLanczos-tmpl.h:31
AEigensolver::complex_t
ComplexTraits< real_t >::complex_t complex_t
Definition: aeigensolver.h:46
axpy
void axpy(Field &y, const double a, const Field &x)
axpy(y, a, x): y := a * x + y
Definition: field.cpp:380
dot
double dot(const Field &y, const Field &x)
Definition: field.cpp:576
real_t
double real_t
Definition: bridgeQXS_Clover_coarse_double.cpp:16
ParameterCheck::non_negative
int non_negative(const int v)
Definition: parameterCheck.cpp:21
copy
void copy(Field &y, const Field &x)
copy(y, x): y = x
Definition: field.cpp:212
Bridge::BridgeIO::paranoiac
void paranoiac(const char *format,...)
Definition: bridgeIO.cpp:238
AIndex_eo_qxs::idx
int idx(const int in, const int Nin, const int ist, const int Nx2, const int Ny, const int leo, const int Nvol2, const int ex)
Definition: aindex_eo.h:27
AEigensolver_IRLanczos::step
void step(int Nm, int k, std::vector< real_t > &TDa, std::vector< real_t > &TDb, std::vector< FIELD > &vk, FIELD &f)
Definition: aeigensolver_IRLanczos-tmpl.h:440
ParameterCheck::square_non_zero
int square_non_zero(const double v)
Definition: parameterCheck.cpp:43
dotc
dcomplex dotc(const Field &y, const Field &x)
Definition: field.cpp:712
Test_Eigensolver::solve
int solve(void)
Definition: test_Eigensolver.cpp:65
aeigensolver_IRLanczos.h
Bridge::BridgeIO::set_verbose_level
static VerboseLevel set_verbose_level(const std::string &str)
Definition: bridgeIO.cpp:133
AEigensolver_IRLanczos
Eigenvalue solver with Implicitly Restarted Lanczos algorithm.
Definition: aeigensolver_IRLanczos.h:44
Parameters::set_int
void set_int(const string &key, const int value)
Definition: parameters.cpp:36
scal
void scal(Field &x, const double a)
scal(x, a): x = a * x
Definition: field.cpp:261
Parameters::fetch_string
int fetch_string(const string &key, string &value) const
Definition: parameters.cpp:378
Parameters::fetch_double
int fetch_double(const string &key, double &value) const
Definition: parameters.cpp:327
AEigensolver_IRLanczos::tqri
void tqri(std::vector< real_t > &TDa, std::vector< real_t > &TDb, int Nk, int Nm, std::vector< real_t > &Qt, int &nconv)
Definition: aeigensolver_IRLanczos-tmpl.h:535
AEigensolver_IRLanczos::schmidt_orthogonalization
void schmidt_orthogonalization(FIELD &w, std::vector< FIELD > &vk, int k)
Definition: aeigensolver_IRLanczos-tmpl.h:501
Bridge::BridgeIO::crucial
void crucial(const char *format,...)
Definition: bridgeIO.cpp:180
AEigensolver_IRLanczos::get_parameters
void get_parameters(Parameters &params) const
Definition: aeigensolver_IRLanczos-tmpl.h:74
Sorter< real_t >
AEigensolver_IRLanczos::set_parameters
void set_parameters(const Parameters &params)
Definition: aeigensolver_IRLanczos-tmpl.h:39
Parameters::fetch_int
int fetch_int(const string &key, int &value) const
Definition: parameters.cpp:346
Bridge::BridgeIO::general
void general(const char *format,...)
Definition: bridgeIO.cpp:200
AEigensolver_IRLanczos::solve
void solve(std::vector< real_t > &TDa, std::vector< FIELD > &vk, int &Nsbt, int &Nconv, const FIELD &b)
Definition: aeigensolver_IRLanczos-tmpl.h:183
Bridge::vout
BridgeIO vout
Definition: bridgeIO.cpp:512
Bridge::BridgeIO::get_verbose_level
static std::string get_verbose_level(const VerboseLevel vl)
Definition: bridgeIO.cpp:154