Bridge++  Ver. 1.2.x
 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_F_1spinor Field_G Field_G_SF

Public Types

enum  element_type { REAL = 1, COMPLEX = 2 }
 

Public Member Functions

 Field ()
 
 Field (const int Nin, const int Nvol, const int Nex, const element_type cmpl=COMPLEX)
 
Field clone () const
 
void reset (const int Nin, const int Nvol, const int Nex, const element_type cmpl=COMPLEX)
 
Fieldoperator= (const double a)
 
int nin () const
 
int nvol () const
 
int nex () const
 
element_type field_element_type () const
 
int ntot () const
 
int size () const
 
double cmp (const int jin, const int site, const int jex) const
 
double cmp (const int i) const
 
double * ptr (const int jin, const int site, const int jex)
 
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)
 
Fieldoperator+= (const Field &v)
 
Fieldoperator-= (const Field &v)
 
Fieldoperator*= (const double a)
 
Fieldoperator/= (const double a)
 
Fieldoperator*= (const dcomplex a)
 
double operator* (const Field &rhs)
 
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

int 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...
 
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 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]

Definition at line 37 of file field.h.

Member Enumeration Documentation

Enumerator
REAL 
COMPLEX 

Definition at line 40 of file field.h.

Constructor & Destructor Documentation

Field::Field ( )
inline

Definition at line 61 of file field.h.

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

Definition at line 69 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 140 of file field.h.

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

Definition at line 145 of file field.h.

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

Definition at line 162 of file field.h.

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

Definition at line 174 of file field.h.

void Field::check ( )
private

Definition at line 39 of file field.cpp.

Field Field::clone ( ) const
inline

Definition at line 77 of file field.h.

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

Definition at line 108 of file field.h.

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

Definition at line 113 of file field.h.

element_type Field::field_element_type ( ) const
inline

Definition at line 103 of file field.h.

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

Definition at line 52 of file field.h.

int Field::nex ( ) const
inline

Definition at line 102 of file field.h.

int Field::nin ( ) const
inline

Definition at line 100 of file field.h.

double Field::norm ( ) const
inline

Definition at line 210 of file field.h.

double Field::norm2 ( ) const

Definition at line 469 of file field.cpp.

int Field::ntot ( ) const
inline

Definition at line 105 of file field.h.

int Field::nvol ( ) const
inline

Definition at line 101 of file field.h.

double Field::operator* ( const Field rhs)
inline

Definition at line 204 of file field.h.

Field& Field::operator*= ( const double  a)
inline

Definition at line 191 of file field.h.

Field& Field::operator*= ( const dcomplex  a)
inline

Definition at line 193 of file field.h.

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

Definition at line 189 of file field.h.

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

Definition at line 190 of file field.h.

Field& Field::operator/= ( const double  a)
inline

Definition at line 192 of file field.h.

Field& Field::operator= ( const double  a)
inline

Definition at line 94 of file field.h.

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

Definition at line 118 of file field.h.

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

Definition at line 123 of file field.h.

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

Definition at line 82 of file field.h.

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

Definition at line 128 of file field.h.

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

Definition at line 133 of file field.h.

void Field::set ( double  a)

Definition at line 454 of file field.cpp.

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

Definition at line 150 of file field.h.

int Field::size ( ) const
inline

Definition at line 106 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 544 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 193 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 211 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 231 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 270 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 489 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 505 of file field.cpp.

void copy ( Field y,
const Field x 
)
friend

copy(y, x): y = x

Definition at line 409 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 430 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 71 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 98 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 145 of file field.cpp.

void scal ( Field x,
const double  a 
)
friend

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

Definition at line 310 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 326 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 343 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 376 of file field.cpp.

Member Data Documentation

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

Definition at line 49 of file field.h.

element_type Field::m_element_type
protected

Definition at line 46 of file field.h.

int Field::m_Nex
protected

Definition at line 45 of file field.h.

int Field::m_Nin
protected

Definition at line 43 of file field.h.

int Field::m_Nvol
protected

Definition at line 44 of file field.h.

Bridge::VerboseLevel Field::m_vl
protected

Definition at line 57 of file field.h.


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