15 #ifndef FIELD_INCLUDED
16 #define FIELD_INCLUDED
54 int myindex(
const int jin,
const int site,
const int jex)
const
84 void reset(
const int Nin,
const int Nvol,
const int Nex,
132 double cmp(
const int jin,
const int site,
const int jex)
const
137 double cmp(
const int i)
const
142 const double *
ptr(
const int jin,
const int site,
const int jex)
const
145 return &(
const_cast<std::valarray<double>&
>(
field)[
myindex(jin, site, jex)]);
148 double *
ptr(
const int jin,
const int site,
const int jex)
153 const double *
ptr(
const int i)
const
156 return &(
const_cast<std::valarray<double>&
>(
field)[i]);
164 void set(
const int jin,
const int site,
const int jex,
double v)
169 void set(
const int i,
double v)
176 void add(
const int jin,
const int site,
const int jex,
double v)
181 void add(
const int i,
double v)
189 assert(exw < w.
nex());
190 return copy(*
this, ex, w, exw);
196 assert(exw < w.
nex());
197 return axpy(*
this, ex, 1.0, w, exw);
203 assert(exw < w.
nex());
204 return axpy(*
this, ex, prf, w, exw);
209 double norm2()
const;
217 double dot(
const Field& y,
const int exy,
const Field& x,
const int exx);
223 dcomplex
dotc(
const Field& y,
const int exy,
const Field& x,
const int exx);
229 void axpy(
Field& y,
const int exy,
const double a,
const Field& x,
const int exx);
235 void axpy(
Field& y,
const int exy,
const dcomplex a,
const Field& x,
const int exx);
241 void scal(
Field& x,
const int exx,
const double a);
247 void scal(
Field& x,
const int exx,
const dcomplex a);
253 void copy(
Field& y,
const int exy,
const Field& x,
const int exx);
267 void stat(
double& Fave,
double& Fmax,
double& Fdev)
const;
278 double dot(
const Field& y,
const int exy,
const Field& x,
const int exx);
285 dcomplex
dotc(
const Field& y,
const int exy,
const Field& x,
const int nexx);
291 void axpy(
Field& y,
const int exy,
const double a,
const Field& x,
const int exx);
298 void axpy(
Field& y,
const int exy,
const dcomplex a,
const Field& x,
const int exx);
304 void scal(
Field& x,
const int exx,
const double a);
311 void scal(
Field& x,
const int exx,
const dcomplex a);
317 void copy(
Field& y,
const int exy,
const Field& x,
const int exx);
void report_field_stat(const Bridge::VerboseLevel vl, const std::string &msg, const Field &f)
void scal(Field &x, const double a)
scal(x, a): x = a * x
friend void scal(Field &x, const double a)
scal(x, a): x = a * x
void axpy(Field &y, const double a, const Field &x)
axpy(y, a, x): y := a * x + y
const double * ptr(const int jin, const int site, const int jex) const
void set(const int jin, const int site, const int jex, double v)
const double * ptr(const int i) const
double * ptr(const int i)
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 Field &v)
bool check_size(const int nin, const int nvol, const int nex) const
checking size parameters. [23 May 2016 H.Matsufuru]
void addpart_ex(int ex, const Field &w, int exw)
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 aypx(const double a, Field &y, const Field &x)
aypx(y, a, x): y := a * y + x
void set(const int i, double v)
friend dcomplex dotc(const Field &y, const Field &x)
void reset(const int Nin, const int Nvol, const int Nex, const element_type cmpl=COMPLEX)
dcomplex dotc(const Field &y, const Field &x)
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.
double dot(const Field &y, const Field &x)
std::valarray< double > field
void add(const int i, double v)
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)
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 copy(Field &y, const Field &x)
copy(y, x): y = x
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