15 #ifndef FIELD_INCLUDED
16 #define FIELD_INCLUDED
52 int myindex(
const int jin,
const int site,
const int jex)
const
82 void reset(
const int Nin,
const int Nvol,
const int Nex,
108 double cmp(
const int jin,
const int site,
const int jex)
const
113 double cmp(
const int i)
const
118 double *
ptr(
const int jin,
const int site,
const int jex)
128 void set(
const int jin,
const int site,
const int jex,
double v)
133 void set(
const int i,
double v)
140 void add(
const int jin,
const int site,
const int jex,
double v)
145 void add(
const int i,
double v)
153 assert(exw < w.
nex());
159 return copy(*
this, ex, w, exw);
165 assert(exw < w.
nex());
171 return axpy(*
this, ex, 1.0, w, exw);
177 assert(exw < w.
nex());
184 return axpy(*
this, ex, prf, w, exw);
195 if (imag(a) == 0.0) {
208 double norm2()
const;
216 double dot(
const Field& y,
const int exy,
const Field& x,
const int exx);
222 dcomplex
dotc(
const Field& y,
const int exy,
const Field& x,
const int exx);
228 void axpy(
Field& y,
const int exy,
const double a,
const Field& x,
const int exx);
234 void axpy(
Field& y,
const int exy,
const dcomplex a,
const Field& x,
const int exx);
240 void scal(
Field& x,
const int exx,
const double a);
246 void scal(
Field& x,
const int exx,
const dcomplex a);
252 void copy(
Field& y,
const int exy,
const Field& x,
const int exx);
266 void stat(
double& Fave,
double& Fmax,
double& Fdev)
const;
312 double dot(
const Field& y,
const int exy,
const Field& x,
const int exx);
319 dcomplex
dotc(
const Field& y,
const int exy,
const Field& x,
const int nexx);
325 void axpy(
Field& y,
const int exy,
const double a,
const Field& x,
const int exx);
332 void axpy(
Field& y,
const int exy,
const dcomplex a,
const Field& x,
const int exx);
338 void scal(
Field& x,
const int exx,
const double a);
345 void scal(
Field& x,
const int exx,
const dcomplex a);
351 void copy(
Field& y,
const int exy,
const Field& x,
const int exx);
void scal(Field &x, const double a)
scal(x, a): x = a * x
void report_field_stat(const Bridge::VerboseLevel vl, const std::string &msg, const Field &f)
friend void scal(Field &x, const double a)
scal(x, a): x = a * x
Field & operator+=(const Field &v)
Field operator-(const Field &lhs, const Field &rhs)
void set(const int jin, const int site, const int jex, double v)
double dot(const Field &y, const Field &x)
double * ptr(const int i)
Field & operator*=(const double a)
double * ptr(const int jin, const int site, const int jex)
Container of Field-type object.
Bridge::VerboseLevel m_vl
friend void copy(Field &y, const Field &x)
copy(y, x): y = x
double cmp(const int jin, const int site, const int jex) const
friend void axpy(Field &y, const double a, const Field &x)
axpy(y, a, x): y := a * x + y
Field & operator/=(const double a)
void copy(Field &y, const Field &x)
copy(y, x): y = x
void addpart_ex(int ex, const Field &w, int exw)
Field operator+(const Field &lhs, const Field &rhs)
static int send_1to1(int count, double *recv_buf, double *send_buf, int p_to, int p_from, int tag)
send array of double from rank p_from to rank p_to. communication distinguished by tag...
friend double dot(const Field &y, const Field &x)
void addpart_ex(int ex, const Field &w, int exw, double prf)
element_type m_element_type
void set(const int i, double v)
friend dcomplex dotc(const Field &y, const Field &x)
dcomplex dotc(const Field &y, const Field &x)
Field & operator*=(const dcomplex a)
void reset(const int Nin, const int Nvol, const int Nex, const element_type cmpl=COMPLEX)
void aypx(const double a, Field &y, const Field &x)
aypx(y, a, x): y := a * y + x
Field & operator-=(const Field &v)
static int exchange(int count, double *recv_buf, double *send_buf, int idir, int ipm, int tag)
receive array of double from upstream specified by idir and ipm, and send array to downstream...
Common parameter class: provides parameters as singleton.
std::valarray< double > field
Field operator*(const Field &v, const double s)
void axpy(Field &y, const double a, const Field &x)
axpy(y, a, x): y := a * x + y
void add(const int i, double v)
double operator*(const Field &rhs)
int send_1to1(int count, Field *recv_buf, Field *send_buf, int p_to, int p_from, int tag)
friend void aypx(const double a, Field &y, const Field &x)
aypx(y, a, x): y := a * y + x
Field(const int Nin, const int Nvol, const int Nex, const element_type cmpl=COMPLEX)
element_type field_element_type() const
void add(const int jin, const int site, const int jex, double v)
Field & operator=(const double a)
void stat(double &Fave, double &Fmax, double &Fdev) const
determines the statistics of the field. average, maximum value, and deviation is determined over glob...
void setpart_ex(int ex, const Field &w, int exw)
int myindex(const int jin, const int site, const int jex) const
int exchange(int count, Field *recv_buf, Field *send_buf, int idir, int ipm, int tag)
double cmp(const int i) const