Go to the documentation of this file.
15 #ifndef FIELD_INCLUDED
16 #define FIELD_INCLUDED
64 size_t myindex(
const int jin,
const int site,
const int jex)
const
81 Field(
const int Nin,
const int Nvol,
const int Nex,
95 void reset(
const int Nin,
const int Nvol,
const int Nex,
143 double cmp(
const int jin,
const int site,
const int jex)
const
148 double cmp(
const int i)
const
153 const double *
ptr(
const int jin,
const int site,
const int jex)
const
156 return &(
const_cast<std::valarray<double>&
>(
field)[
myindex(jin, site, jex)]);
159 double *
ptr(
const int jin,
const int site,
const int jex)
164 const double *
ptr(
const int i)
const
167 return &(
const_cast<std::valarray<double>&
>(
field)[i]);
175 void set(
const int jin,
const int site,
const int jex,
double v)
180 void set(
const int i,
double v)
189 void setc(dcomplex a);
191 void add(
const int jin,
const int site,
const int jex,
double v)
196 void add(
const int i,
double v)
204 assert(exw < w.
nex());
205 return copy(*
this, ex, w, exw);
211 assert(exw < w.
nex());
212 return axpy(*
this, ex, 1.0, w, exw);
218 assert(exw < w.
nex());
219 return axpy(*
this, ex, prf, w, exw);
224 double norm2()
const;
234 double dot(
const Field& y,
const int exy,
const Field& x,
const int exx);
241 void dot_and_norm2(
double& yx,
double& y2,
double& x2,
const Field& y,
const int exy,
const Field& x,
const int exx);
247 dcomplex
dotc(
const Field& y,
const int exy,
const Field& x,
const int exx);
254 void dotc_and_norm2(
double& yx,
double& y2,
double& x2,
const Field& y,
const int exy,
const Field& x,
const int exx);
260 void axpy(
Field& y,
const int exy,
const double a,
const Field& x,
const int exx);
266 void axpy(
Field& y,
const int exy,
const dcomplex a,
const Field& x,
const int exx);
272 void scal(
Field& x,
const int exx,
const double a);
278 void scal(
Field& x,
const int exx,
const dcomplex a);
284 void copy(
Field& y,
const int exy,
const Field& x,
const int exx);
297 void stat(
double& Fave,
double& Fmax,
double& Fdev)
const;
308 double dot(
const Field& y,
const int exy,
const Field& x,
const int exx);
315 dcomplex
dotc(
const Field& y,
const int exy,
const Field& x,
const int nexx);
321 void axpy(
Field& y,
const int exy,
const double a,
const Field& x,
const int exx);
328 void axpy(
Field& y,
const int exy,
const dcomplex a,
const Field& x,
const int exx);
334 void scal(
Field& x,
const int exx,
const double a);
341 void scal(
Field& x,
const int exx,
const dcomplex a);
347 void copy(
Field& y,
const int exy,
const Field& x,
const int exx);
size_t myindex(const int jin, const int site, const int jex) const
dcomplex dotc(const Field &y, const Field &x)
void setpart_ex(int ex, const Field &w, int exw)
double cmp(const int i) const
Bridge::VerboseLevel m_vl
void copy(Field &y, const Field &x)
copy(y, x): y = x
friend void dot_and_norm2(double &yx, double &y2, double &x2, const Field &y, const Field &x)
calculate <y|x>, <y|y> and <x|x> simultaneously
Common parameter class: provides parameters as singleton.
void set(const int jin, const int site, const int jex, double v)
double * ptr(const int jin, const int site, const int jex)
void aypx(const double a, Field &y, const Field &x)
aypx(y, a, x): y := a * y + x
friend void scal(Field &x, const double a)
scal(x, a): x = a * x
Field & operator=(const Field &v)
Element_type::type element_type
void scal(Field &x, const double a)
scal(x, a): x = a * x
friend double dot(const Field &y, const Field &x)
bool check_size(const int nin, const int nvol, const int nex) const
checking size parameters. [23 May 2016 H.Matsufuru]
friend void copy(Field &y, const Field &x)
copy(y, x): y = x
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 set(const int i, double v)
element_type m_element_type
field complex type
void axpy(Field &y, const double a, const Field &x)
axpy(y, a, x): y := a * x + y
friend void axpy(Field &y, const double a, const Field &x)
axpy(y, a, x): y := a * x + y
void addpart_ex(int ex, const Field &w, int exw, double prf)
friend dcomplex dotc(const Field &y, const Field &x)
void addpart_ex(int ex, const Field &w, int exw)
Field(const int Nin, const int Nvol, const int Nex, const element_type cmpl=Element_type::COMPLEX)
static const std::string class_name
void add(const int i, double v)
friend void aypx(const double a, Field &y, const Field &x)
aypx(y, a, x): y := a * y + x
void reset(const int Nin, const int Nvol, const int Nex, const element_type cmpl=Element_type::COMPLEX)
element_type field_element_type() const
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
const double * ptr(const int jin, const int site, const int jex) const
std::valarray< double > field
friend void dotc_and_norm2(double &yx, double &y2, double &x2, const Field &y, const Field &x)
calculate <y|x>, <y|y> and <x|x> simultaneously
double dot(const Field &y, const Field &x)
Container of Field-type object.
const double * ptr(const int i) const
double * ptr(const int i)