QDP++
qdp_scalarsite_generic_linalg_wrapper.h
Go to the documentation of this file.
1#ifndef QDP_SCALARSITE_GENERIC_LINALG_WRAPPER_H
2#define QDP_SCALARSITE_GENERIC_LINALG_WRAPPER_H
3
5// Threading evaluates wrappers
6//
7// by Xu Guo, EPCC, 07 August, 2008
9
10// typedef
11typedef OLattice<PScalar<PColorMatrix<RComplexFloat, 3> > > C;
12typedef OLattice<PSpinVector<PColorVector<RComplexFloat, 3>, 2> > H;
13
14
16//
18 OLattice<PSpinVector<PColorVector<RComplexFloat, 3>, 2> >& d;
19 const C& l;
20 const H& r;
21 int base;
23 OLattice<PSpinVector<PColorVector<RComplexFloat, 3>, 2> >& d_,
24 const C& l_,
25 const H& r_,
26 int base_) : d(d_), l(l_),r(r_), base(base_) {}
27
28};
29
31//
32inline
34{
35
36 OLattice<PSpinVector<PColorVector<RComplexFloat, 3>, 2> >& d = a->d;
37 const C& l = a->l;
38 const H& r = a->r;
39 int base = a->base;
40
41 int low = lo + base;
42 int high = hi + base;
43
44 // Ordered Way - loop through sites and save a table lookup
45 for(int i=low; i < high; i++) {
46
47 _inline_generic_mult_su3_mat_vec(l.elem(i).elem(),
48 r.elem(i).elem(0),
49 d.elem(i).elem(0));
50 _inline_generic_mult_su3_mat_vec(l.elem(i).elem(),
51 r.elem(i).elem(1),
52 d.elem(i).elem(1));
53 }
54
55}
56
58//
60 OLattice<PSpinVector<PColorVector<RComplexFloat, 3>, 2> >& d;
61 const C& l;
62 const H& r;
63 const int* tab;
64
66 OLattice<PSpinVector<PColorVector<RComplexFloat, 3>, 2> >& d_,
67 const C& l_,
68 const H& r_,
69 const int* tab_) : d(d_), l(l_), r(r_), tab(tab_) {}
70
71
72};
73
75//
76//template<>
77inline
79{
80
81 OLattice<PSpinVector<PColorVector<RComplexFloat, 3>, 2> >& d = a->d;
82 const C& l = a->l;
83 const H& r = a->r;
84 const int* tab = a->tab;
85
86 // Unordered Way - do a site table lookup
87 for(int j=lo; j < hi; j++) {
88 int i = tab[j];
89
90 _inline_generic_mult_su3_mat_vec(l.elem(i).elem(),
91 r.elem(i).elem(0),
92 d.elem(i).elem(0));
93 _inline_generic_mult_su3_mat_vec(l.elem(i).elem(),
94 r.elem(i).elem(1),
95 d.elem(i).elem(1));
96 }
97}
98
99
100#endif
void unordered_linalg_evaluate_userfunc(int lo, int hi, int myId, unordered_linalg_user_arg *a)
user function for the evaluate function in the unordered situation
OLattice< PScalar< PColorMatrix< RComplexFloat, 3 > > > C
void ordered_linalg_evaluate_userfunc(int lo, int hi, int myId, ordered_linalg_user_arg *a)
user function for the evaluate function in the ordered situation
OLattice< PSpinVector< PColorVector< RComplexFloat, 3 >, 2 > > H
#define _inline_generic_mult_su3_mat_vec(aa, bb, cc)
user argument for the evaluate function in the ordered situation
OLattice< PSpinVector< PColorVector< RComplexFloat, 3 >, 2 > > & d
ordered_linalg_user_arg(OLattice< PSpinVector< PColorVector< RComplexFloat, 3 >, 2 > > &d_, const C &l_, const H &r_, int base_)
user argument for the evaluate function in the unordered situation
OLattice< PSpinVector< PColorVector< RComplexFloat, 3 >, 2 > > & d
unordered_linalg_user_arg(OLattice< PSpinVector< PColorVector< RComplexFloat, 3 >, 2 > > &d_, const C &l_, const H &r_, const int *tab_)