13 #ifdef USE_FACTORY_AUTOREGISTER
15 bool init = ASolver_CGNR::register_factory();
19 template<
typename AFIELD>
23 template<
typename AFIELD>
26 int nin = m_fopr->field_nin();
27 int nvol = m_fopr->field_nvol();
28 int nex = m_fopr->field_nex();
30 m_b2.reset(nin, nvol, nex);
35 template<
typename AFIELD>
38 std::string str_vlevel = params.
get_string(
"verbose_level");
48 template<
typename AFIELD>
54 const std::string mode_prev = m_fopr->get_mode();
56 vout.
detailed(m_vl,
"%s: solver starts\n", class_name.c_str());
58 if ((mode_prev ==
"DdagD") || (mode_prev ==
"DdagD_prec")) {
60 class_name.c_str(), mode_prev.c_str());
63 m_mode_fopr = mode_prev;
72 if ((mode_prev ==
"D") || (mode_prev ==
"Ddag") ||
73 (mode_prev ==
"D_prec") || (mode_prev ==
"Ddag_prec")) {
74 vout.
detailed(m_vl,
" mode_prev = %s\n", mode_prev.c_str());
76 vout.
crucial(m_vl,
"Error at %s: unsupported mode for fopr %s.",
77 class_name.c_str(), mode_prev.c_str());
84 if ((m_b2.nin() != b.
nin()) || (m_b2.nvol() != b.
nvol()) ||
85 (m_b2.nex() != b.
nex())) {
93 m_fopr->mult_dag(m_b2, b);
96 m_flop = m_fopr->flop_count();
102 if (mode_prev ==
"D") {
103 m_mode_fopr =
"DdagD";
104 }
else if (mode_prev ==
"Ddag") {
105 m_mode_fopr =
"DDdag";
106 }
else if (mode_prev ==
"D_prec") {
107 m_mode_fopr =
"DdagD_prec";
108 }
else if (mode_prev ==
"Ddag_prec") {
109 m_mode_fopr =
"DDdag_prec";
111 vout.
crucial(m_vl,
"%s: unknown mode for fopr: %s\n",
112 class_name.c_str(), mode_prev.c_str());
116 m_fopr->set_mode(m_mode_fopr);
123 m_fopr->set_mode(mode_prev);
130 template<
typename AFIELD>
133 double flop_fopr = m_fopr->flop_count();
135 vout.
crucial(m_vl,
"Warning at %s: no fopr->flop_count() is"
136 "available, setting flop = 0\n", class_name.c_str());