Bridge++  Ver. 2.0.2
Field Class Reference

Container of Field-type object. More...

#include <field.h>

Inheritance diagram for Field:
Field_F Field_F_1spinor Field_G

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 setc (double a)
 
void setc (dcomplex 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 xI ()
 
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. More...
 

Static Public Attributes

static const std::string class_name = "Field"
 

Protected Member Functions

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

Protected Attributes

int m_Nin
 internal d.o.f. More...
 
int m_Nvol
 lattice volume More...
 
int m_Nex
 external d.o.f. More...
 
element_type m_element_type
 field complex type More...
 
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_norm2, dotc_and_norm2 [30 Sep 2019 I.Kanamori] Change myindex from int to size_t [ 6 Jan 2020 I.Kanamori] Fix dot(const Field& y, const int exy, ...) kindly reported by Hiroki Ohata. [ 7 May 2021 Y.Namekawa]

Definition at line 46 of file field.h.

Member Typedef Documentation

◆ element_type

Definition at line 50 of file field.h.

◆ real_t

typedef double Field::real_t

Definition at line 51 of file field.h.

Constructor & Destructor Documentation

◆ Field() [1/2]

Field::Field ( )
inline

Definition at line 73 of file field.h.

◆ Field() [2/2]

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

◆ add() [1/2]

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

Definition at line 196 of file field.h.

◆ add() [2/2]

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

Definition at line 191 of file field.h.

◆ addpart_ex() [1/2]

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

Definition at line 208 of file field.h.

◆ addpart_ex() [2/2]

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

Definition at line 215 of file field.h.

◆ check()

void Field::check ( )
private

Definition at line 28 of file field.cpp.

◆ check_size()

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.

◆ clone()

Field Field::clone ( ) const
inline

Definition at line 90 of file field.h.

◆ cmp() [1/2]

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

Definition at line 148 of file field.h.

◆ cmp() [2/2]

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

Definition at line 143 of file field.h.

◆ field_element_type()

element_type Field::field_element_type ( ) const
inline

Definition at line 129 of file field.h.

◆ myindex()

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

Definition at line 64 of file field.h.

◆ nex()

int Field::nex ( ) const
inline

Definition at line 128 of file field.h.

◆ nin()

int Field::nin ( ) const
inline

Definition at line 126 of file field.h.

◆ norm()

double Field::norm ( ) const
inline

Definition at line 226 of file field.h.

◆ norm2()

double Field::norm2 ( ) const

Definition at line 113 of file field.cpp.

◆ ntot()

int Field::ntot ( ) const
inline

Definition at line 131 of file field.h.

◆ nvol()

int Field::nvol ( ) const
inline

Definition at line 127 of file field.h.

◆ operator=()

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

Definition at line 112 of file field.h.

◆ ptr() [1/4]

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

Definition at line 170 of file field.h.

◆ ptr() [2/4]

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

Definition at line 164 of file field.h.

◆ ptr() [3/4]

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

Definition at line 159 of file field.h.

◆ ptr() [4/4]

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

Definition at line 153 of file field.h.

◆ reset()

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.

◆ set() [1/3]

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

Definition at line 180 of file field.h.

◆ set() [2/3]

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

Definition at line 175 of file field.h.

◆ set() [3/3]

void Field::set ( double  a)

Definition at line 36 of file field.cpp.

◆ setc() [1/2]

void Field::setc ( dcomplex  a)

Definition at line 70 of file field.cpp.

◆ setc() [2/2]

void Field::setc ( double  a)

Definition at line 55 of file field.cpp.

◆ setpart_ex()

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

Definition at line 201 of file field.h.

◆ size()

int Field::size ( ) const
inline

Definition at line 132 of file field.h.

◆ stat()

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.

Definition at line 169 of file field.cpp.

◆ xI()

void Field::xI ( )

Definition at line 138 of file field.cpp.

Friends And Related Function Documentation

◆ axpy [1/4]

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

◆ axpy [2/4]

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

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

Definition at line 380 of file field.cpp.

◆ axpy [3/4]

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

◆ axpy [4/4]

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

◆ aypx [1/2]

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

◆ aypx [2/2]

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

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

Definition at line 509 of file field.cpp.

◆ copy [1/2]

void copy ( Field y,
const Field x 
)
friend

copy(y, x): y = x

Definition at line 212 of file field.cpp.

◆ copy [2/2]

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

◆ dot [1/2]

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

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

Definition at line 576 of file field.cpp.

◆ dot [2/2]

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

◆ dot_and_norm2 [1/2]

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

◆ dot_and_norm2 [2/2]

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

◆ dotc [1/2]

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

◆ dotc [2/2]

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

◆ dotc_and_norm2 [1/2]

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

◆ dotc_and_norm2 [2/2]

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

◆ scal [1/4]

void scal ( Field x,
const dcomplex  a 
)
friend

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

Definition at line 304 of file field.cpp.

◆ scal [2/4]

void scal ( Field x,
const double  a 
)
friend

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

Definition at line 261 of file field.cpp.

◆ scal [3/4]

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

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

Definition at line 343 of file field.cpp.

◆ scal [4/4]

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

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

Definition at line 284 of file field.cpp.

Member Data Documentation

◆ class_name

const std::string Field::class_name = "Field"
static

Definition at line 52 of file field.h.

◆ field

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

Definition at line 60 of file field.h.

◆ m_element_type

element_type Field::m_element_type
protected

field complex type

Definition at line 58 of file field.h.

◆ m_Nex

int Field::m_Nex
protected

external d.o.f.

Definition at line 57 of file field.h.

◆ m_Nin

int Field::m_Nin
protected

internal d.o.f.

Definition at line 55 of file field.h.

◆ m_Nvol

int Field::m_Nvol
protected

lattice volume

Definition at line 56 of file field.h.

◆ m_vl

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: