Bridge++  Version 1.5.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Field Class Reference

Container of Field-type object. More...

#include <field.h>

Inheritance diagram for Field:
Field_F Field_G Field_G_SF

Public Types

typedef Element_type::type element_type
 
typedef double real_t
 

Public Member Functions

 Field ()
 
 Field (const int Nin, const int Nvol, const int Nex, const element_type cmpl=Element_type::COMPLEX)
 
Field clone () const
 
void reset (const int Nin, const int Nvol, const int Nex, const element_type cmpl=Element_type::COMPLEX)
 
Fieldoperator= (const Field &v)
 
int nin () const
 
int nvol () const
 
int nex () const
 
element_type field_element_type () const
 
int ntot () const
 
int size () const
 
bool check_size (const int nin, const int nvol, const int nex) const
 checking size parameters. [23 May 2016 H.Matsufuru] More...
 
double cmp (const int jin, const int site, const int jex) const
 
double cmp (const int i) const
 
const double * ptr (const int jin, const int site, const int jex) const
 
double * ptr (const int jin, const int site, const int jex)
 
const double * ptr (const int i) const
 
double * ptr (const int i)
 
void set (const int jin, const int site, const int jex, double v)
 
void set (const int i, double v)
 
void set (double a)
 
void add (const int jin, const int site, const int jex, double v)
 
void add (const int i, double v)
 
void setpart_ex (int ex, const Field &w, int exw)
 
void addpart_ex (int ex, const Field &w, int exw)
 
void addpart_ex (int ex, const Field &w, int exw, double prf)
 
double norm2 () const
 
double norm () const
 
void stat (double &Fave, double &Fmax, double &Fdev) const
 determines the statistics of the field. average, maximum value, and deviation is determined over global lattice. On-site degree of freedom is sumed over in quadrature, not averaged. This function works only on single node. More...
 

Protected Member Functions

size_t myindex (const int jin, const int site, const int jex) const
 

Protected Attributes

int m_Nin
 
int m_Nvol
 
int m_Nex
 
element_type m_element_type
 
std::valarray< double > field
 
Bridge::VerboseLevel m_vl
 

Private Member Functions

void check ()
 

Friends

double dot (const Field &y, const Field &x)
 
double dot (const Field &y, const int exy, const Field &x, const int exx)
 dot(y[j], x[k]) := y[j]^T x[k] More...
 
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 More...
 
void dot_and_norm2 (double &yx, double &y2, double &x2, const Field &y, const int exy, const Field &x, const int exx)
 
dcomplex dotc (const Field &y, const Field &x)
 
dcomplex dotc (const Field &y, const int exy, const Field &x, const int exx)
 dotc(y, j, x, k) := y[j]^dag x[k] More...
 
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 More...
 
void dotc_and_norm2 (double &yx, double &y2, double &x2, const Field &y, const int exy, const Field &x, const int exx)
 
void axpy (Field &y, const double a, const Field &x)
 axpy(y, a, x): y := a * x + y More...
 
void axpy (Field &y, const int exy, const double a, const Field &x, const int exx)
 axpy(y, j, a, x, k): y[j] := a * x[k] + y[j] More...
 
void axpy (Field &y, const dcomplex a, const Field &x)
 
void axpy (Field &y, const int exy, const dcomplex a, const Field &x, const int exx)
 axpy(y, j, a, x, k): y[j] := a * x[k] + y[j] More...
 
void scal (Field &x, const double a)
 scal(x, a): x = a * x More...
 
void scal (Field &x, const int exx, const double a)
 scal(x, k, a): x[k] = a * x[k] More...
 
void scal (Field &x, const dcomplex a)
 
void scal (Field &x, const int exx, const dcomplex a)
 scal(x, k, a): x[k] = a * x[k] More...
 
void copy (Field &y, const Field &x)
 copy(y, x): y = x More...
 
void copy (Field &y, const int exy, const Field &x, const int exx)
 copy(y, j, x, k): y[j] = x[k] More...
 
void aypx (const double a, Field &y, const Field &x)
 aypx(y, a, x): y := a * y + x More...
 
void aypx (const dcomplex a, Field &y, const Field &x)
 

Detailed Description

Container of Field-type object.

This class defines field-type quantity which has three size parameters, Nin: on-site degree of freedom, Nvol: site d.o.f, Nex: extra d.o.f. The detailed structure of these degrees of freedom is not defined in this class but in subclasses. Expression template was implemented by J.Noaki. [28 Dec 2011 H.Matsufuru]

add dot_and_nomr2, dotc_and_norm2 [30 Sep 2019 I.Kanamori] change myindex from int to size_t [ 6 Jan 2020 I.Kanamori]

Definition at line 45 of file field.h.

Member Typedef Documentation

Definition at line 49 of file field.h.

typedef double Field::real_t

Definition at line 50 of file field.h.

Constructor & Destructor Documentation

Field::Field ( )
inline

Definition at line 73 of file field.h.

Field::Field ( const int  Nin,
const int  Nvol,
const int  Nex,
const element_type  cmpl = Element_type::COMPLEX 
)
inline

Definition at line 81 of file field.h.

Member Function Documentation

void Field::add ( const int  jin,
const int  site,
const int  jex,
double  v 
)
inline

Definition at line 187 of file field.h.

void Field::add ( const int  i,
double  v 
)
inline

Definition at line 192 of file field.h.

void Field::addpart_ex ( int  ex,
const Field w,
int  exw 
)
inline

Definition at line 204 of file field.h.

void Field::addpart_ex ( int  ex,
const Field w,
int  exw,
double  prf 
)
inline

Definition at line 211 of file field.h.

void Field::check ( )
private

Definition at line 39 of file field.cpp.

bool Field::check_size ( const int  nin,
const int  nvol,
const int  nex 
) const
inline

checking size parameters. [23 May 2016 H.Matsufuru]

Definition at line 135 of file field.h.

Field Field::clone ( ) const
inline

Definition at line 90 of file field.h.

double Field::cmp ( const int  jin,
const int  site,
const int  jex 
) const
inline

Definition at line 143 of file field.h.

double Field::cmp ( const int  i) const
inline

Definition at line 148 of file field.h.

element_type Field::field_element_type ( ) const
inline

Definition at line 129 of file field.h.

size_t Field::myindex ( const int  jin,
const int  site,
const int  jex 
) const
inlineprotected

Definition at line 64 of file field.h.

int Field::nex ( ) const
inline

Definition at line 128 of file field.h.

int Field::nin ( ) const
inline

Definition at line 126 of file field.h.

double Field::norm ( ) const
inline

Definition at line 222 of file field.h.

double Field::norm2 ( ) const

Definition at line 592 of file field.cpp.

int Field::ntot ( ) const
inline

Definition at line 131 of file field.h.

int Field::nvol ( ) const
inline

Definition at line 127 of file field.h.

Field& Field::operator= ( const Field v)
inline

Definition at line 113 of file field.h.

const double* Field::ptr ( const int  jin,
const int  site,
const int  jex 
) const
inline

Definition at line 153 of file field.h.

double* Field::ptr ( const int  jin,
const int  site,
const int  jex 
)
inline

Definition at line 159 of file field.h.

const double* Field::ptr ( const int  i) const
inline

Definition at line 164 of file field.h.

double* Field::ptr ( const int  i)
inline

Definition at line 170 of file field.h.

void Field::reset ( const int  Nin,
const int  Nvol,
const int  Nex,
const element_type  cmpl = Element_type::COMPLEX 
)
inline

Definition at line 95 of file field.h.

void Field::set ( const int  jin,
const int  site,
const int  jex,
double  v 
)
inline

Definition at line 175 of file field.h.

void Field::set ( const int  i,
double  v 
)
inline

Definition at line 180 of file field.h.

void Field::set ( double  a)

Definition at line 577 of file field.cpp.

void Field::setpart_ex ( int  ex,
const Field w,
int  exw 
)
inline

Definition at line 197 of file field.h.

int Field::size ( ) const
inline

Definition at line 132 of file field.h.

void Field::stat ( double &  Fave,
double &  Fmax,
double &  Fdev 
) const

determines the statistics of the field. average, maximum value, and deviation is determined over global lattice. On-site degree of freedom is sumed over in quadrature, not averaged. This function works only on single node.

Definition at line 667 of file field.cpp.

Friends And Related Function Documentation

void axpy ( Field y,
const double  a,
const Field x 
)
friend

axpy(y, a, x): y := a * x + y

Definition at line 319 of file field.cpp.

void axpy ( Field y,
const int  exy,
const double  a,
const Field x,
const int  exx 
)
friend

axpy(y, j, a, x, k): y[j] := a * x[k] + y[j]

Definition at line 336 of file field.cpp.

void axpy ( Field y,
const dcomplex  a,
const Field x 
)
friend

axpy(y, a, x): y := a * x + y fails if x or y is real vector

Definition at line 355 of file field.cpp.

void axpy ( Field y,
const int  exy,
const dcomplex  a,
const Field x,
const int  exx 
)
friend

axpy(y, j, a, x, k): y[j] := a * x[k] + y[j]

Definition at line 394 of file field.cpp.

void aypx ( const double  a,
Field y,
const Field x 
)
friend

aypx(y, a, x): y := a * y + x

Definition at line 612 of file field.cpp.

void aypx ( const dcomplex  a,
Field y,
const Field x 
)
friend

aypx(y, a, x): y := a * y + x fails if x or y is real vector

Definition at line 628 of file field.cpp.

void copy ( Field y,
const Field x 
)
friend

copy(y, x): y = x

Definition at line 532 of file field.cpp.

void copy ( Field y,
const int  exy,
const Field x,
const int  exx 
)
friend

copy(y, j, x, k): y[j] = x[k]

Definition at line 553 of file field.cpp.

double dot ( const Field y,
const Field x 
)
friend

dot(y,x) := y^T x N.B. treat as real vectors.

Definition at line 46 of file field.cpp.

double dot ( const Field y,
const int  exy,
const Field x,
const int  exx 
)
friend

dot(y[j], x[k]) := y[j]^T x[k]

Definition at line 68 of file field.cpp.

void dot_and_norm2 ( double &  yx,
double &  y2,
double &  x2,
const Field y,
const Field x 
)
friend

calculate <y|x>, <y|y> and <x|x> simultaneously

Definition at line 123 of file field.cpp.

void dot_and_norm2 ( double &  yx,
double &  y2,
double &  x2,
const Field y,
const int  exy,
const Field x,
const int  exx 
)
friend

Definition at line 92 of file field.cpp.

dcomplex dotc ( const Field y,
const Field x 
)
friend

dotc(y, x) := y^dag x x, y may be real or complex vectors. (must be of same element type)

Definition at line 155 of file field.cpp.

dcomplex dotc ( const Field y,
const int  exy,
const Field x,
const int  exx 
)
friend

dotc(y, j, x, k) := y[j]^dag x[k]

Definition at line 192 of file field.cpp.

void dotc_and_norm2 ( double &  yx,
double &  y2,
double &  x2,
const Field y,
const Field x 
)
friend

calculate <y|x>, <y|y> and <x|x> simultaneously

void dotc_and_norm2 ( double &  yx,
double &  y2,
double &  x2,
const Field y,
const int  exy,
const Field x,
const int  exx 
)
friend
void scal ( Field x,
const double  a 
)
friend

scal(x, a): x = a * x

Definition at line 433 of file field.cpp.

void scal ( Field x,
const int  exx,
const double  a 
)
friend

scal(x, k, a): x[k] = a * x[k]

Definition at line 449 of file field.cpp.

void scal ( Field x,
const dcomplex  a 
)
friend

scal(x, a): x = a * x fails if x is a real vector

Definition at line 466 of file field.cpp.

void scal ( Field x,
const int  exx,
const dcomplex  a 
)
friend

scal(x, k, a): x[k] = a * x[k]

Definition at line 499 of file field.cpp.

Member Data Documentation

std::valarray<double> Field::field
protected

Definition at line 60 of file field.h.

element_type Field::m_element_type
protected

Definition at line 57 of file field.h.

int Field::m_Nex
protected

Definition at line 55 of file field.h.

int Field::m_Nin
protected

Definition at line 53 of file field.h.

int Field::m_Nvol
protected

Definition at line 54 of file field.h.

Bridge::VerboseLevel Field::m_vl
protected

Definition at line 69 of file field.h.


The documentation for this class was generated from the following files: