38 #ifdef USE_TESTMANAGER_AUTOREGISTER
59 namespace Test_Spectrum_CRSMatrix {
62 const std::string filename_input =
"test_Spectrum_CRSMatrix_Overlap5d.yaml";
63 const std::string filename_output =
"stdout";
65 class Parameters_Test_Spectrum_CRSMatrix :
public Parameters {
67 Parameters_Test_Spectrum_CRSMatrix()
69 Register_string(
"gauge_config_type_input",
"NULL");
70 Register_string(
"config_filename_input",
"NULL");
72 Register_string(
"matrix_output",
"NULL");
73 Register_string(
"source_output",
"NULL");
74 Register_string(
"solution_output",
"NULL");
76 Register_string(
"verbose_level",
"NULL");
78 Register_double(
"expected_result", 0.0);
87 const string& solution,
94 #ifdef USE_TESTMANAGER_AUTOREGISTER
117 Parameters_Test_Spectrum_CRSMatrix params_test;
124 params_manager.
read_params(filename_input, ¶ms_all);
126 const string str_gconf_read = params_test.get_string(
"gauge_config_type_input");
127 const string readfile = params_test.get_string(
"config_filename_input");
128 const string matrix_file = params_test.get_string(
"matrix_output");
129 const string source_file = params_test.get_string(
"source_output");
130 const string solution_file = params_test.get_string(
"solution_output");
131 const string str_vlevel = params_test.get_string(
"verbose_level");
133 const double expected_result = params_test.get_double(
"expected_result");
139 vout.
general(vl,
" gconf_read = %s\n", str_gconf_read.c_str());
140 vout.
general(vl,
" readfile = %s\n", readfile.c_str());
141 vout.
general(vl,
" matrix_output = %s\n", matrix_file.c_str());
142 vout.
general(vl,
" source_output = %s\n", source_file.c_str());
143 vout.
general(vl,
" solution_output = %s\n", solution_file.c_str());
144 vout.
general(vl,
" vlevel = %s\n", str_vlevel.c_str());
155 vout.
crucial(vl,
"Test_Spectrum_CRSMatrix: Input parameters have not been set.\n");
178 double Niter_ms = 1000;
179 double Stop_cond_ms = 1.0e-28;
180 valarray<int> boundary(Ndim);
188 double kappa = 0.5 / (4.0 - M0);
194 Niter_ms, Stop_cond_ms, boundary);
208 Niter_ms, Stop_cond_ms, boundary);
212 double Stop_cond_5d = 1.0e-28;
216 valarray<int> source_position(Ndim);
217 source_position[0] = 0;
218 source_position[1] = 0;
219 source_position[2] = 0;
220 source_position[3] = 0;
226 valarray<Field_F> sq(Nc * Nd);
227 for (
int cd = 0; cd < Nc * Nd; ++cd) {
239 Field v(Nin, Nvol2, Npl);
240 Field t(Nin, Nvol2, Npl);
241 Field p(Nin, Nvol2, Npl);
242 Field s(Nin, Nvol2, Npl);
243 Field x(Nin, Nvol2, Npl);
245 Field be(Nin, Nvol2, 1);
246 Field bo(Nin, Nvol2, 1);
247 Field xqe(Nin, Nvol2, 1);
248 Field xqo(Nin, Nvol2, 1);
249 Field xt(Nin, Nvol2, 1);
258 for (
int ispin = 0; ispin < Nd; ++ispin) {
259 for (
int icolor = 0; icolor < Nc; ++icolor) {
260 source->
set(b, icolor, ispin);
262 double snorm = 1.0 / b.
norm2();
283 solver->
solve(x, s, Nconv, diff);
304 v1 = fopr_ov->
mult(xq);
310 sq[icolor + Nc * ispin] = (
Field_F)xq;
316 CRSsolver(solution_file, matrix_file, source_file, result);