Go to the documentation of this file.
20 #ifdef USE_FACTORY_AUTOREGISTER
22 bool init = Fopr_CRS::register_factory();
51 if (ith == 0)
m_mode = mode;
70 const int Nsize = w.
size() / 2;
79 for (
int j = 0; j < Nsize; ++j) {
88 for (
int i = 0; i < Ncolumn; ++i) {
91 double wr = w.
cmp(2 * k);
92 double wi = w.
cmp(2 * k + 1);
107 const int Nsize = w.
size() / 2;
116 for (
int j = 0; j < Nsize; ++j) {
117 if (j == Nsize - 1) {
123 double wr = w.
cmp(2 * j);
124 double wi = w.
cmp(2 * j + 1);
126 for (
int i = 0; i < Ncolumn; ++i) {
133 v.
add(2 * k + 1, vi);
156 std::vector<int> index_nz1(
m_Nsize);
157 std::vector<double> elem_nz1(2 *
m_Nsize);
169 for (
int ex = 0; ex <
m_Nex; ++ex) {
171 w.set(in, site, ex, 1.0);
190 for (
int ex = 0; ex <
m_Nex; ++ex) {
192 for (
int site = 0; site <
m_Nvol; ++site) {
193 for (
int in2 = 0; in2 < (
m_Nin / 2); ++in2) {
197 w.set(2 * in2, site, ex, 1.0);
200 if (Nnz_tot + Nnz1 >
m_Nnz) {
206 for (
int i = 0; i < Nnz1; ++i) {
208 m_elem_nz[2 * (Nnz_tot + i)] = elem_nz1[2 * i];
209 m_elem_nz[2 * (Nnz_tot + i) + 1] = elem_nz1[2 * i + 1];
224 std::vector<double>& elem_nz,
const Field& v)
229 const int Nsize = v.
size() / 2;
233 for (
int i = 0; i < Nsize; ++i) {
234 if ((v.
cmp(2 * i) != 0.0) || (v.
cmp(2 * i + 1) != 0.0)) {
236 elem_nz[2 * j] = v.
cmp(2 * i);
237 elem_nz[2 * j + 1] = -v.
cmp(2 * i + 1);
252 config.open(fname.c_str(), std::ios::in);
253 if (!config.is_open()) {
254 vout.
crucial(
m_vl,
"Error at %s: Failed to open the next file %s in %s(%d)",
255 class_name.c_str(), fname.c_str(), __FILE__, __LINE__);
271 for (
int j = 0; j <
m_Nsize; ++j) {
276 for (
int j = 0; j <
m_Nnz; ++j) {
281 for (
int j = 0; j <
m_Nnz; ++j) {
297 config.open(fname.c_str(), std::ios::out);
298 if (!config.is_open()) {
299 vout.
crucial(
m_vl,
"Error at %s: Failed to open the text file %s(%d)\n",
306 config <<
m_Nin << std::endl;
307 config <<
m_Nvol << std::endl;
308 config <<
m_Nex << std::endl;
309 config <<
m_Nsize << std::endl;
310 config <<
m_Nnz << std::endl;
312 for (
int j = 0; j <
m_Nsize; ++j) {
316 for (
int j = 0; j <
m_Nnz; ++j) {
320 config.setf(std::ios_base::scientific, std::ios_base::floatfield);
321 config.precision(14);
323 for (
int j = 0; j <
m_Nnz; ++j) {
325 config <<
m_elem_nz[2 * j + 1] << std::endl;
342 const double gflop = 0.0;
void set_string(const string &key, const string &value)
void set(const int jin, const int site, const int jex, double v)
virtual int field_nex()=0
returns the external degree of freedom of the fermion field.
void D(Field &, const Field &)
void get_parameters(Parameters &) const
gets parameters by a Parameter object: to be implemented in a subclass.
static const std::string class_name
std::vector< int > m_column_nz
virtual void mult_dag(AFIELD &, const AFIELD &)
hermitian conjugate of mult.
Bridge::VerboseLevel m_vl
double flop_count()
this returns the number of floating point operations.
void Ddag(Field &, const Field &)
virtual int field_nvol()=0
returns the volume of the fermion field.
std::vector< double > m_elem_nz
void set_matrix_1row(int &, std::vector< int > &, std::vector< double > &, const Field &)
void set_parameters(const Parameters &)
sets parameters by a Parameter object: to be implemented in a subclass.
void set_mode(const std::string mode)
setting the mode of multiplication if necessary. Default implementation here is just to avoid irrelev...
void add(const int jin, const int site, const int jex, double v)
double cmp(const int jin, const int site, const int jex) const
static VerboseLevel set_verbose_level(const std::string &str)
void write_matrix(const std::string)
int fetch_string(const string &key, string &value) const
void crucial(const char *format,...)
std::vector< int > m_rowidx_nz
Container of Field-type object.
virtual int field_nin()=0
returns the on-site degree of freedom of the fermion field.
static int get_thread_id()
returns thread id.
void general(const char *format,...)
static std::string get_verbose_level(const VerboseLevel vl)
void DdagD(Field &, const Field &)