15 #ifndef FIELD_F_1sp_INCLUDED
16 #define FIELD_F_1sp_INCLUDED
38 int myindex(
const int c2,
const int site,
const int ex)
52 reset(m_Nc2, m_Nvol, m_Nex);
64 double cmp_r(
const int cc,
const int site,
const int e = 0)
67 return field[myindex(2 * cc, site, e)];
70 double cmp_i(
const int cc,
const int site,
const int e = 0)
73 return field[myindex(2 * cc + 1, site, e)];
76 void set_r(
const int cc,
const int site,
const int e,
79 field[myindex(2 * cc, site, e)] = re;
82 void set_i(
const int cc,
const int site,
const int e,
85 field[myindex(2 * cc + 1, site, e)] = im;
88 void set_ri(
const int cc,
const int site,
const int e,
89 const double re,
const double im)
91 field[myindex(2 * cc, site, e)] = re;
92 field[myindex(2 * cc + 1, site, e)] = im;
95 Vec_SU_N vec(
const int site,
const int e = 0)
const
99 for (
int cc = 0; cc < m_Nc; ++cc) {
100 Tmp.
set(cc, field[myindex(2 * cc, site, e)],
101 field[myindex(2 * cc + 1, site, e)]);
106 void set_vec(
const int site,
const int e,
const Vec_SU_N& F)
108 for (
int cc = 0; cc < m_Nc; ++cc) {
109 field[myindex(2 * cc, site, e)] = F.
r(cc);
110 field[myindex(2 * cc + 1, site, e)] = F.
i(cc);
114 void add_vec(
const int site,
const int e,
const Vec_SU_N& F)
116 for (
int cc = 0; cc < m_Nc; ++cc) {
117 field[myindex(2 * cc, site, e)] += F.
r(cc);
118 field[myindex(2 * cc + 1, site, e)] += F.
i(cc);
122 void clear_vec(
const int site,
const int e)
124 for (
int cc = 0; cc < m_Nc2; ++cc) {
125 field[myindex(cc, site, e)] = 0.0;
209 double a = (field * rhs.
field).sum();