Go to the documentation of this file.
10 #ifndef ACCEL_AFIELD_INCLUDED
11 #define ACCEL_AFIELD_INCLUDED
30 template<
typename REALTYPE>
66 AField(
const int nin,
const int nvol,
const int nex,
68 init(nin, nvol, nex, cmpl);
73 init(w.nin(), w.nvol(), w.nex(), w.field_element_type());
74 if(m_nsize > 0)
copy(w);
80 if(m_nsize > 0)
copy(w);
85 assert(check_size(w.
nin(), w.
nvol(), w.
nex()));
86 if(m_nsize > 0)
copy(w);
92 assert(check_size(w));
93 if(m_nsize > 0)
copy(w);
103 void init(
const int nin,
const int nvol,
const int nex,
104 const element_type cmpl);
112 void reset(
const int nin,
const int nvol,
const int nex,
116 int nin()
const {
return m_nin; }
119 int nvol()
const {
return m_nvol; }
122 int nex()
const {
return m_nex; }
128 bool check_size(
const int nin,
const int nvol,
const int nex)
const
131 if(m_nin != nin || m_nvol != nvol || m_nex != nex) chk =
false;
139 if(m_nin != w.
nin() || m_nvol != w.
nvol() || m_nex != w.
nex())
145 inline int size(
void)
const {
return m_nsize; }
154 real_t cmp(
const int index)
const;
156 void set(
const int index,
const real_t a);
166 void copy(
const int ex,
228 real_t norm2_host(
void)
const;
238 void set_host(
const real_t a);
241 {
return m_field[index]; }
244 { m_field[index] = a; }
264 #endif // ACCEL_AFIELD_INCLUDED
static const std::string class_name
real_t * ptr(int i)
return the address of data at given index.
AField(const AField< real_t, ACCEL > &w)
copy constructor
void copy(AField< double, ACCEL > &, const AField< float, ACCEL > &)
int m_nvol_pad
after padding.
int nin() const
returning size of inner (on site) d.o.f.
void update_device(AField< REALTYPE, ACCEL > &v)
Element_type::type element_type
element_type field_element_type() const
returning element_type (real or complex).
complex_t * ptr_complex(int i)
int size(void) const
return the array size
void aypx(const double a, Field &y, const Field &x)
aypx(y, a, x): y := a * y + x
void axpy(Field &y, const double a, const Field &x)
axpy(y, a, x): y := a * x + y
double dot(const Field &y, const Field &x)
bool check_size(const AField< REALTYPE, ACCEL > &w) const
checking size parameters
real_t cmp_host(const int index) const
void update_host(AField< REALTYPE, ACCEL > &v)
void set_host(const int index, const real_t a)
int nex() const
returning size of extra d.o.f.
Bridge::VerboseLevel m_vl
void conjg(double *restrict v1, int nin, int nvol)
bool check_size(const int nin, const int nvol, const int nex) const
checking size parameters
int size_pad() const
returning volume size after padding.
int nvol_pad() const
returning volume size after padding.
dcomplex dotc(const Field &y, const Field &x)
Mat_SU_N xI(const Mat_SU_N &u)
element_type m_element_type
double norm2(double *restrict v1, int nin, int nvol)
element_type field_element_type() const
static int m_num_instance
AField(const int nin, const int nvol, const int nex, const element_type cmpl=Element_type::COMPLEX)
constructor
AField & operator=(const Field &w)
operator overload
void scal(Field &x, const double a)
scal(x, a): x = a * x
AField()
constructor without argument
ComplexTraits< REALTYPE >::complex_t complex_t
int nvol() const
returning size of site d.o.f.
ComplexTraits< double >::complex_t complex_t
AField & operator=(const AField &w)
operator overload
Container of Field-type object.
std::size_t m_nsize_pad
after padding.
AField(const Field &w)
copy constructor