Bridge++  Version 1.4.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

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 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

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 39 of file field.h.

Member Enumeration Documentation

Enumerator
REAL 
COMPLEX 

Definition at line 42 of file field.h.

Constructor & Destructor Documentation

Field::Field ( )
inline

Definition at line 63 of file field.h.

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

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

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

Definition at line 181 of file field.h.

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

Definition at line 193 of file field.h.

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

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

Field Field::clone ( ) const
inline

Definition at line 79 of file field.h.

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

Definition at line 132 of file field.h.

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

Definition at line 137 of file field.h.

element_type Field::field_element_type ( ) const
inline

Definition at line 118 of file field.h.

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

Definition at line 54 of file field.h.

int Field::nex ( ) const
inline

Definition at line 117 of file field.h.

int Field::nin ( ) const
inline

Definition at line 115 of file field.h.

double Field::norm ( ) const
inline

Definition at line 211 of file field.h.

double Field::norm2 ( ) const

Definition at line 441 of file field.cpp.

int Field::ntot ( ) const
inline

Definition at line 120 of file field.h.

int Field::nvol ( ) const
inline

Definition at line 116 of file field.h.

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

Definition at line 102 of file field.h.

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

Definition at line 142 of file field.h.

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

Definition at line 148 of file field.h.

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

Definition at line 153 of file field.h.

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

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

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

Definition at line 164 of file field.h.

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

Definition at line 169 of file field.h.

void Field::set ( double  a)

Definition at line 426 of file field.cpp.

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

Definition at line 186 of file field.h.

int Field::size ( ) const
inline

Definition at line 121 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 516 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 168 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 185 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 204 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 243 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 461 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 477 of file field.cpp.

void copy ( Field y,
const Field x 
)
friend

copy(y, x): y = x

Definition at line 381 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 402 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.

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 92 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 130 of file field.cpp.

void scal ( Field x,
const double  a 
)
friend

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

Definition at line 282 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 298 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 315 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 348 of file field.cpp.

Member Data Documentation

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

Definition at line 51 of file field.h.

element_type Field::m_element_type
protected

Definition at line 48 of file field.h.

int Field::m_Nex
protected

Definition at line 47 of file field.h.

int Field::m_Nin
protected

Definition at line 45 of file field.h.

int Field::m_Nvol
protected

Definition at line 46 of file field.h.

Bridge::VerboseLevel Field::m_vl
protected

Definition at line 59 of file field.h.


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