QDP++
qdp_generic_spin_project_evaluates.h
Go to the documentation of this file.
1#ifndef QDP_GENERIC_SPIN_PROJECT_EVALUTATES_H
2#define QDP_GENERIC_SPIN_PROJECT_EVALUTATES_H
4using namespace QDP;
5namespace QDP {
6
7// Typedefs
10
11// Four spinor (Ns * Nc * Ncomplex ) Ncomplex fastest
12typedef REAL SpinColFull[4][3][2];
13
14// Half spinor (Ns/2 * Nc * Ncomplex ) Ncomplex fastest
15typedef REAL SpinColHalf[2][3][2];
16// d = SpinProjectDir0Plus(Vec);
19// Threading evaluates
20//
21// by Xu Guo, EPCC, 28 August, 2008
23
24// the wrappers for the functions to be threaded
26
27
28template<class A, class B>
29inline
31 const OpAssign& op,
32 const QDPExpr<
35 OLattice< HVec > > &rhs,
36 const Subset& s)
37{
38
39 // Get at pointer for 4 vec
40 const OLattice< FVec >& a = static_cast<const OLattice< FVec > &>(rhs.expression().child());
42 if(s.hasOrderedRep()) {
43 REAL *aptr =(REAL *)&(a.elem(s.start()).elem(0).elem(0).real());
44 REAL *bptr =(REAL *)&(b.elem(s.start()).elem(0).elem(0).real());
45
46 int total_n_vec = s.end() - s.start() +1;
47
49
51
53 // Original code
55 //unsigned int n_vec=s.end() - s.start()+1;
56
57 //inlineSpinProjDir0Plus(aptr, bptr, n_vec);
58 }
59 else{
60 const int* tab = s.siteTable().slice();
61
62 int totalSize = s.numSiteTable();
63
65
67
69 // Original code
71 /*
72 for(int j=0; j < s.numSiteTable(); j++) {
73 int i = tab[j];
74
75 REAL *aptr =(REAL *)&(a.elem(i).elem(0).elem(0).real());
76 REAL *bptr =(REAL *)&(b.elem(i).elem(0).elem(0).real());
77 inlineSpinProjDir0Plus(aptr, bptr, 1);
78 }*/
79 }
80
81}
82
83// d = SpinProjectDir1Plus(Vec);
84template<class A, class B>
85inline
87 const OpAssign& op,
88 const QDPExpr<
91 OLattice< HVec > > &rhs,
92 const Subset& s)
93{
94
95
96 const OLattice< FVec >& a = static_cast<const OLattice< FVec > &>(rhs.expression().child());
97
98 if( s.hasOrderedRep() ) {
99 REAL *aptr =(REAL *)&(a.elem(s.start()).elem(0).elem(0).real());
100 REAL *bptr =(REAL *)&(b.elem(s.start()).elem(0).elem(0).real());
101
102
103 int total_n_vec = s.end() - s.start() +1;
104
106
108
110 // Original code
112 //unsigned int n_vec=s.end() - s.start()+1;
113 //inlineSpinProjDir1Plus(aptr, bptr, n_vec);
114 }
115 else{
116 const int* tab = s.siteTable().slice();
117
118 int totalSize = s.numSiteTable();
119
121
123
125 // Original code
127 /*
128 for(int j=0; j < s.numSiteTable(); j++) {
129 int i = tab[j];
130
131 REAL *aptr =(REAL *)&(a.elem(i).elem(0).elem(0).real());
132 REAL *bptr =(REAL *)&(b.elem(i).elem(0).elem(0).real());
133 inlineSpinProjDir1Plus(aptr, bptr, 1);
134 }*/
135 }
136
137}
138
139// d = SpinProjectDir2Plus(Vec);
140template<class A, class B>
141inline
143 const OpAssign& op,
144 const QDPExpr<
147 OLattice< HVec > > &rhs,
148 const Subset& s)
149{
150
151 const OLattice< FVec >& a = static_cast<const OLattice< FVec > &>(rhs.expression().child());
152
153 if( s.hasOrderedRep() ) {
154 REAL *aptr =(REAL *)&(a.elem(s.start()).elem(0).elem(0).real());
155 REAL *bptr =(REAL *)&(b.elem(s.start()).elem(0).elem(0).real());
156
157 int total_n_vec = s.end() - s.start() +1;
158
160
162
164 // Original code
166 //unsigned int n_vec=s.end() - s.start()+1;
167 //inlineSpinProjDir2Plus(aptr, bptr, n_vec);
168 }
169 else {
170 const int* tab = s.siteTable().slice();
171
172 int totalSize = s.numSiteTable();
173
175
177
179 // Original code
181 /*
182 for(int j=0; j < s.numSiteTable(); j++) {
183 int i = tab[j];
184
185 REAL *aptr =(REAL *)&(a.elem(i).elem(0).elem(0).real());
186 REAL *bptr =(REAL *)&(b.elem(i).elem(0).elem(0).real());
187 inlineSpinProjDir2Plus(aptr, bptr, 1);
188 }*
189 }
190
191}
192
193// d = SpinProjectDir3Plus(Vec);
194template<class A, class B>
195inline
196void evaluate(OLattice< HVec >& b,
197 const OpAssign& op,
198 const QDPExpr<
199 UnaryNode< FnSpinProjectDir3Plus,
200 Reference< QDPType<FVec,OLattice< FVec > > > >,
201 OLattice< HVec > > &rhs,
202 const Subset& s)
203{
204 const OLattice< FVec >& a = static_cast<const OLattice< FVec > &>(rhs.expression().child());
205
206 if( s.hasOrderedRep() ) {
207 REAL *aptr =(REAL *)&(a.elem(s.start()).elem(0).elem(0).real());
208 REAL *bptr =(REAL *)&(b.elem(s.start()).elem(0).elem(0).real());
209
210 int total_n_vec = s.end() - s.start() +1;
211
212 ordered_spin_project_user_arg arg = {aptr, bptr, inlineSpinProjDir3Plus};
213
214 dispatch_to_threads(total_n_vec, arg, ordered_spin_project_evaluate_function);
215
217 // Original code
219 //unsigned int n_vec=s.end() - s.start()+1;
220 //inlineSpinProjDir3Plus(aptr, bptr, n_vec);
221 }
222 else {
223 const int* tab = s.siteTable().slice();
224
225 int totalSize = s.numSiteTable();
226
227 unordered_spin_project_user_arg<A, B> arg = {a, b, tab, inlineSpinProjDir3Plus};
228
229 dispatch_to_threads(totalSize, arg, unordered_spin_project_evaluate_function);
230
232 // Original code
234 /*
235 for(int j=0; j < s.numSiteTable(); j++) {
236 int i = tab[j];
237
238 REAL *aptr =(REAL *)&(a.elem(i).elem(0).elem(0).real());
239 REAL *bptr =(REAL *)&(b.elem(i).elem(0).elem(0).real());
240 inlineSpinProjDir3Plus(aptr, bptr, 1);
241 }*
242 }
243
244}
245
246// d = SpinProjectDir0Minus(Vec);
247template<class A, class B>
248inline
249void evaluate(OLattice< HVec >& b,
250 const OpAssign& op,
251 const QDPExpr<
252 UnaryNode< FnSpinProjectDir0Minus,
253 Reference< QDPType<FVec,OLattice< FVec > > > >,
254 OLattice< HVec > > &rhs,
255 const Subset& s)
256{
257
258 // Get at pointer for 4 vec
259 const OLattice< FVec >& a = static_cast<const OLattice< FVec > &>(rhs.expression().child());
260
261 if( s.hasOrderedRep() ) {
262 REAL *aptr =(REAL *)&(a.elem(s.start()).elem(0).elem(0).real());
263 REAL *bptr =(REAL *)&(b.elem(s.start()).elem(0).elem(0).real());
264
265 int total_n_vec = s.end() - s.start() +1;
266
267 ordered_spin_project_user_arg arg = {aptr, bptr, inlineSpinProjDir0Minus};
268
269 dispatch_to_threads(total_n_vec, arg, ordered_spin_project_evaluate_function);
270
272 // Original code
274 //unsigned int n_vec=s.end() - s.start()+1;
275 //inlineSpinProjDir0Minus(aptr, bptr, n_vec);
276 }
277 else {
278 const int* tab = s.siteTable().slice();
279
280 int totalSize = s.numSiteTable();
281
282 unordered_spin_project_user_arg<A, B> arg = {a, b, tab, inlineSpinProjDir0Minus};
283
284 dispatch_to_threads(totalSize, arg, unordered_spin_project_evaluate_function);
285
287 // Original code
289 /*
290 for(int j=0; j < s.numSiteTable(); j++) {
291 int i = tab[j];
292
293 REAL *aptr =(REAL *)&(a.elem(i).elem(0).elem(0).real());
294 REAL *bptr =(REAL *)&(b.elem(i).elem(0).elem(0).real());
295 inlineSpinProjDir0Minus(aptr, bptr, 1);
296 }*/
297 }
298
299}
300
301// d = SpinProjectDir1Minus(Vec);
302template<class A, class B>
303inline
305 const OpAssign& op,
306 const QDPExpr<
309 OLattice< HVec > > &rhs,
310 const Subset& s)
311{
312
313 const OLattice< FVec >& a = static_cast<const OLattice< FVec > &>(rhs.expression().child());
314
315 if( s.hasOrderedRep() ) {
316 REAL *aptr =(REAL *)&(a.elem(s.start()).elem(0).elem(0).real());
317 REAL *bptr =(REAL *)&(b.elem(s.start()).elem(0).elem(0).real());
318
319 int total_n_vec = s.end() - s.start() +1;
320
322
324
326 // Original code
328 //unsigned int n_vec=s.end() - s.start()+1;
329 //inlineSpinProjDir1Minus(aptr, bptr, n_vec);
330 }
331 else {
332 const int* tab = s.siteTable().slice();
333
334
335 int totalSize = s.numSiteTable();
336
338
340
342 // Original code
344 /*
345 for(int j=0; j < s.numSiteTable(); j++) {
346 int i = tab[j];
347
348 REAL *aptr =(REAL *)&(a.elem(i).elem(0).elem(0).real());
349 REAL *bptr =(REAL *)&(b.elem(i).elem(0).elem(0).real());
350 inlineSpinProjDir1Minus(aptr, bptr, 1);
351 }*/
352 }
353
354}
355
356// d = SpinProjectDir2Minus(Vec);
357template<class A, class B>
358inline
360 const OpAssign& op,
361 const QDPExpr<
364 OLattice< HVec > > &rhs,
365 const Subset& s)
366{
367
368
369 const OLattice< FVec >& a = static_cast<const OLattice< FVec > &>(rhs.expression().child());
370
371 if( s.hasOrderedRep() ) {
372 REAL *aptr =(REAL *)&(a.elem(s.start()).elem(0).elem(0).real());
373 REAL *bptr =(REAL *)&(b.elem(s.start()).elem(0).elem(0).real());
374
375 int total_n_vec = s.end() - s.start() +1;
376
378
380
382 // Original code
384 //unsigned int n_vec=s.end() - s.start()+1;
385 //inlineSpinProjDir2Minus(aptr, bptr, n_vec);
386 }
387 else {
388 const int* tab = s.siteTable().slice();
389
390 int totalSize = s.numSiteTable();
391
393
395
397 // Original code
399 /*
400 for(int j=0; j < s.numSiteTable(); j++) {
401 int i = tab[j];
402
403 REAL *aptr =(REAL *)&(a.elem(i).elem(0).elem(0).real());
404 REAL *bptr =(REAL *)&(b.elem(i).elem(0).elem(0).real());
405 inlineSpinProjDir2Minus(aptr, bptr, 1);
406 }*/
407 }
408
409
410}
411
412// d = SpinProjectDir3Minus(Vec);
413template<class A, class B>
414inline
416 const OpAssign& op,
417 const QDPExpr<
420 OLattice< HVec > > &rhs,
421 const Subset& s)
422{
423 const OLattice< FVec >& a = static_cast<const OLattice< FVec > &>(rhs.expression().child());
424
425 if( s.hasOrderedRep() ) {
426
427 REAL *aptr =(REAL *)&(a.elem(s.start()).elem(0).elem(0).real());
428 REAL *bptr =(REAL *)&(b.elem(s.start()).elem(0).elem(0).real());
429
430 int total_n_vec = s.end() - s.start() +1;
431
433
435
437 // Original code
439 //unsigned int n_vec=s.end() - s.start()+1;
440 //inlineSpinProjDir3Minus(aptr, bptr, n_vec);
441 }
442 else {
443 const int* tab = s.siteTable().slice();
444
445 int totalSize = s.numSiteTable();
446
448
450
452 // Original code
454 /*
455 for(int j=0; j < s.numSiteTable(); j++) {
456 int i = tab[j];
457
458 REAL *aptr =(REAL *)&(a.elem(i).elem(0).elem(0).real());
459 REAL *bptr =(REAL *)&(b.elem(i).elem(0).elem(0).real());
460 inlineSpinProjDir3Minus(aptr, bptr, 1);
461 }*/
462 }
463
464}
465
466
467
468
469// d = SpinReconstructDir0Plus(Vec);
470template<class A, class B>
471inline
473 const OpAssign& op,
474 const QDPExpr<
477 OLattice< FVec > > &rhs,
478 const Subset& s)
479{
480
481 const OLattice< HVec >& a = static_cast<const OLattice< HVec > &>(rhs.expression().child());
482
483 if( s.hasOrderedRep() ) {
484
485 REAL *aptr =(REAL *)&(a.elem(s.start()).elem(0).elem(0).real());
486 REAL *bptr =(REAL *)&(b.elem(s.start()).elem(0).elem(0).real());
487
488 int total_n_vec = s.end() - s.start() +1;
489
491
493
495 // Original code
497 //unsigned int n_vec=s.end() - s.start()+1;
498 //inlineSpinReconDir0Plus(aptr, bptr, n_vec);
499 }
500 else {
501 const int* tab = s.siteTable().slice();
502
503 int totalSize = s.numSiteTable();
504
506
508
510 // Original code
512 /*
513 for(int j=0; j < s.numSiteTable(); j++) {
514 int i = tab[j];
515
516 REAL *aptr =(REAL *)&(a.elem(i).elem(0).elem(0).real());
517 REAL *bptr =(REAL *)&(b.elem(i).elem(0).elem(0).real());
518 inlineSpinReconDir0Plus(aptr, bptr, 1);
519 }*/
520 }
521
522
523
524}
525
526// d = SpinReconstructDir1Plus(Vec);
527template<class A, class B>
528inline
530 const OpAssign& op,
531 const QDPExpr<
534 OLattice< FVec > > &rhs,
535 const Subset& s)
536{
537
538 const OLattice< HVec >& a = static_cast<const OLattice< HVec > &>(rhs.expression().child());
539
540 if( s.hasOrderedRep() ) {
541 REAL *aptr =(REAL *)&(a.elem(s.start()).elem(0).elem(0).real());
542 REAL *bptr =(REAL *)&(b.elem(s.start()).elem(0).elem(0).real());
543
544 int total_n_vec = s.end() - s.start() +1;
545
547
549
551 // Original code
553 //unsigned int n_vec=s.end() - s.start()+1;
554 //inlineSpinReconDir1Plus(aptr, bptr, n_vec);
555 }
556 else {
557 const int* tab = s.siteTable().slice();
558
559 int totalSize = s.numSiteTable();
560
562
564
566 // Original code
568 /*
569 for(int j=0; j < s.numSiteTable(); j++) {
570 int i = tab[j];
571
572 REAL *aptr =(REAL *)&(a.elem(i).elem(0).elem(0).real());
573 REAL *bptr =(REAL *)&(b.elem(i).elem(0).elem(0).real());
574 inlineSpinReconDir1Plus(aptr, bptr, 1);
575 }*/
576 }
577
578}
579
580// d = SpinReconstructDir2Plus(Vec);
581template<class A, class B>
582inline
584 const OpAssign& op,
585 const QDPExpr<
588 OLattice< FVec > > &rhs,
589 const Subset& s)
590{
591
592
593 const OLattice< HVec >& a = static_cast<const OLattice< HVec > &>(rhs.expression().child());
594
595 if( s.hasOrderedRep() ) {
596 REAL *aptr =(REAL *)&(a.elem(s.start()).elem(0).elem(0).real());
597 REAL *bptr =(REAL *)&(b.elem(s.start()).elem(0).elem(0).real());
598
599 int total_n_vec = s.end() - s.start() +1;
600
602
604
606 // Original code
608 //unsigned int n_vec=s.end() - s.start()+1;
609 //inlineSpinReconDir2Plus(aptr, bptr, n_vec);
610 }
611 else {
612 const int* tab = s.siteTable().slice();
613
614 int totalSize = s.numSiteTable();
615
617
619
621 // Original code
623 /*
624 for(int j=0; j < s.numSiteTable(); j++) {
625 int i = tab[j];
626
627 REAL *aptr =(REAL *)&(a.elem(i).elem(0).elem(0).real());
628 REAL *bptr =(REAL *)&(b.elem(i).elem(0).elem(0).real());
629 inlineSpinReconDir2Plus(aptr, bptr, 1);
630 }*/
631 }
632
633}
634
635// d = SpinReconstructDir3Plus(Vec);
636template<class A, class B>
637inline
639 const OpAssign& op,
640 const QDPExpr<
643 OLattice< FVec > > &rhs,
644 const Subset& s)
645{
646
647 const OLattice< HVec >& a = static_cast<const OLattice< HVec > &>(rhs.expression().child());
648
649 if( s.hasOrderedRep() ) {
650 REAL *aptr =(REAL *)&(a.elem(s.start()).elem(0).elem(0).real());
651 REAL *bptr =(REAL *)&(b.elem(s.start()).elem(0).elem(0).real());
652
653 int total_n_vec = s.end() - s.start() +1;
654
656
658
660 // Original code
662 //unsigned int n_vec=s.end() - s.start()+1;
663 //inlineSpinReconDir3Plus(aptr, bptr, n_vec);
664 }
665 else {
666 const int* tab = s.siteTable().slice();
667
668 int totalSize = s.numSiteTable();
669
671
673
675 // Original code
677 /*
678 for(int j=0; j < s.numSiteTable(); j++) {
679 int i = tab[j];
680
681 REAL *aptr =(REAL *)&(a.elem(i).elem(0).elem(0).real());
682 REAL *bptr =(REAL *)&(b.elem(i).elem(0).elem(0).real());
683 inlineSpinReconDir3Plus(aptr, bptr, 1);
684 }*/
685 }
686
687
688}
689
690// d = SpinReconstructDir0Minus(Vec);
691template<class A, class B>
692inline
694 const OpAssign& op,
695 const QDPExpr<
698 OLattice< FVec > > &rhs,
699 const Subset& s)
700{
701
702 const OLattice< HVec >& a = static_cast<const OLattice< HVec > &>(rhs.expression().child());
703
704 if( s.hasOrderedRep() ) {
705 REAL *aptr =(REAL *)&(a.elem(s.start()).elem(0).elem(0).real());
706 REAL *bptr =(REAL *)&(b.elem(s.start()).elem(0).elem(0).real());
707
708 int total_n_vec = s.end() - s.start() +1;
709
711
713
715 // Original code
717 //unsigned int n_vec=s.end() - s.start()+1;
718 //inlineSpinReconDir0Minus(aptr, bptr, n_vec);
719 }
720 else {
721
722 const int* tab = s.siteTable().slice();
723
724 int totalSize = s.numSiteTable();
725
727
729
731 // Original code
733 /*
734 for(int j=0; j < s.numSiteTable(); j++) {
735 int i = tab[j];
736
737 REAL *aptr =(REAL *)&(a.elem(i).elem(0).elem(0).real());
738 REAL *bptr =(REAL *)&(b.elem(i).elem(0).elem(0).real());
739 inlineSpinReconDir0Minus(aptr, bptr, 1);
740 }*/
741 }
742
743}
744
745// d = SpinReconstructDir1Minus(Vec);
746template<class A, class B>
747inline
749 const OpAssign& op,
750 const QDPExpr<
753 OLattice< FVec > > &rhs,
754 const Subset& s)
755{
756
757 const OLattice< HVec >& a = static_cast<const OLattice< HVec > &>(rhs.expression().child());
758
759 if( s.hasOrderedRep() ) {
760 REAL *aptr =(REAL *)&(a.elem(s.start()).elem(0).elem(0).real());
761 REAL *bptr =(REAL *)&(b.elem(s.start()).elem(0).elem(0).real());
762
763
764 int total_n_vec = s.end() - s.start() +1;
765
767
769
771 // Original code
773 //unsigned int n_vec=s.end() - s.start()+1;
774 //inlineSpinReconDir1Minus(aptr, bptr, n_vec);
775 }
776 else {
777
778 const int* tab = s.siteTable().slice();
779
780 int totalSize = s.numSiteTable();
781
783
785
787 // Original code
789 /*
790 for(int j=0; j < s.numSiteTable(); j++) {
791 int i = tab[j];
792
793 REAL *aptr =(REAL *)&(a.elem(i).elem(0).elem(0).real());
794 REAL *bptr =(REAL *)&(b.elem(i).elem(0).elem(0).real());
795 inlineSpinReconDir1Minus(aptr, bptr, 1);
796 }*/
797 }
798
799}
800
801// d = SpinReconstructDir2Minus(Vec);
802template<class A, class B>
803inline
805 const OpAssign& op,
806 const QDPExpr<
809 OLattice< FVec > > &rhs,
810 const Subset& s)
811{
812
813
814 const OLattice< HVec >& a = static_cast<const OLattice< HVec > &>(rhs.expression().child());
815
816 if( s.hasOrderedRep() ) {
817 REAL *aptr =(REAL *)&(a.elem(s.start()).elem(0).elem(0).real());
818 REAL *bptr =(REAL *)&(b.elem(s.start()).elem(0).elem(0).real());
819
820 int total_n_vec = s.end() - s.start() +1;
821
823
825
827 // Original code
829 //unsigned int n_vec=s.end() - s.start()+1;
830 //inlineSpinReconDir2Minus(aptr, bptr, n_vec);
831 }
832 else {
833
834 const int* tab = s.siteTable().slice();
835
836 int totalSize = s.numSiteTable();
837
839
841
843 // Original code
845 /*
846 for(int j=0; j < s.numSiteTable(); j++) {
847 int i = tab[j];
848
849 REAL *aptr =(REAL *)&(a.elem(i).elem(0).elem(0).real());
850 REAL *bptr =(REAL *)&(b.elem(i).elem(0).elem(0).real());
851 inlineSpinReconDir2Minus(aptr, bptr, 1);
852 }*/
853 }
854
855}
856
857// d = SpinReconstructDir3Minus(Vec);
858template<class A, class B>
859inline
861 const OpAssign& op,
862 const QDPExpr<
865 OLattice< FVec > > &rhs,
866 const Subset& s)
867{
868
869 const OLattice< HVec >& a = static_cast<const OLattice< HVec > &>(rhs.expression().child());
870
871 if( s.hasOrderedRep()) {
872 REAL *aptr =(REAL *)&(a.elem(s.start()).elem(0).elem(0).real());
873 REAL *bptr =(REAL *)&(b.elem(s.start()).elem(0).elem(0).real());
874
875 int total_n_vec = s.end() - s.start() +1;
876
878
880
882 // Original code
884 //unsigned int n_vec=s.end() - s.start()+1;
885 //inlineSpinReconDir3Minus(aptr, bptr, n_vec);
886 }
887 else {
888
889 const int* tab = s.siteTable().slice();
890
891 int totalSize = s.numSiteTable();
892
894
896
898 // Original code
900 /*
901 for(int j=0; j < s.numSiteTable(); j++) {
902 int i = tab[j];
903
904 REAL *aptr =(REAL *)&(a.elem(i).elem(0).elem(0).real());
905 REAL *bptr =(REAL *)&(b.elem(i).elem(0).elem(0).real());
906 inlineSpinReconDir3Minus(aptr, bptr, 1);
907 }*/
908 }
909
910}
911
912
913
914// d += SpinReconstructDir0Plus(Vec);
915template<class A, class B>
916inline
918 const OpAddAssign& op,
919 const QDPExpr<
922 OLattice< FVec > > &rhs,
923 const Subset& s)
924{
925
926
927 const OLattice< HVec >& a = static_cast<const OLattice< HVec > &>(rhs.expression().child());
928
929 if( s.hasOrderedRep() ) {
930
931 REAL *aptr =(REAL *)&(a.elem(s.start()).elem(0).elem(0).real());
932 REAL *bptr =(REAL *)&(b.elem(s.start()).elem(0).elem(0).real());
933
934 int total_n_vec = s.end() - s.start() +1;
935
937
939
941 // Original code
943 //unsigned int n_vec=s.end() - s.start()+1;
944 //inlineAddSpinReconDir0Plus(aptr, bptr, n_vec);
945 }
946 else {
947
948 const int* tab = s.siteTable().slice();
949
950 int totalSize = s.numSiteTable();
951
953
955
957 // Original code
959 /*
960 for(int j=0; j < s.numSiteTable(); j++) {
961 int i = tab[j];
962
963 REAL *aptr =(REAL *)&(a.elem(i).elem(0).elem(0).real());
964 REAL *bptr =(REAL *)&(b.elem(i).elem(0).elem(0).real());
965 inlineAddSpinReconDir0Plus(aptr, bptr, 1);
966 }*/
967 }
968
969}
970
971// d += SpinReconstructDir1Plus(Vec);
972template<class A, class B>
973inline
975 const OpAddAssign& op,
976 const QDPExpr<
979 OLattice< FVec > > &rhs,
980 const Subset& s)
981{
982
983 const OLattice< HVec >& a = static_cast<const OLattice< HVec > &>(rhs.expression().child());
984
985 if( s.hasOrderedRep() ) {
986 REAL *aptr =(REAL *)&(a.elem(s.start()).elem(0).elem(0).real());
987 REAL *bptr =(REAL *)&(b.elem(s.start()).elem(0).elem(0).real());
988
989 int total_n_vec = s.end() - s.start() +1;
990
992
994
996 // Original code
998 //unsigned int n_vec=s.end() - s.start()+1;
999 //inlineAddSpinReconDir1Plus(aptr, bptr, n_vec);
1000 }
1001 else {
1002
1003 const int* tab = s.siteTable().slice();
1004
1005 int totalSize = s.numSiteTable();
1006
1008
1010
1012 // Original code
1014 /*
1015 for(int j=0; j < s.numSiteTable(); j++) {
1016 int i = tab[j];
1017
1018 REAL *aptr =(REAL *)&(a.elem(i).elem(0).elem(0).real());
1019 REAL *bptr =(REAL *)&(b.elem(i).elem(0).elem(0).real());
1020 inlineAddSpinReconDir1Plus(aptr, bptr, 1);
1021 }*/
1022 }
1023
1024}
1025
1026// d += SpinReconstructDir2Plus(Vec);
1027template<class A, class B>
1028inline
1030 const OpAddAssign& op,
1031 const QDPExpr<
1034 OLattice< FVec > > &rhs,
1035 const Subset& s)
1036{
1037
1038 const OLattice< HVec >& a = static_cast<const OLattice< HVec > &>(rhs.expression().child());
1039
1040 if( s.hasOrderedRep() ) {
1041 REAL *aptr =(REAL *)&(a.elem(s.start()).elem(0).elem(0).real());
1042 REAL *bptr =(REAL *)&(b.elem(s.start()).elem(0).elem(0).real());
1043
1044 int total_n_vec = s.end() - s.start() +1;
1045
1047
1049
1051 // Original code
1053 //unsigned int n_vec=s.end() - s.start()+1;
1054 //inlineAddSpinReconDir2Plus(aptr, bptr, n_vec);
1055 }
1056 else {
1057
1058 const int* tab = s.siteTable().slice();
1059
1060 int totalSize = s.numSiteTable();
1061
1063
1065
1067 // Original code
1069 /*
1070 for(int j=0; j < s.numSiteTable(); j++) {
1071 int i = tab[j];
1072
1073 REAL *aptr =(REAL *)&(a.elem(i).elem(0).elem(0).real());
1074 REAL *bptr =(REAL *)&(b.elem(i).elem(0).elem(0).real());
1075 inlineAddSpinReconDir2Plus(aptr, bptr, 1);
1076 }*/
1077 }
1078
1079}
1080
1081// d += SpinReconstructDir3Plus(Vec);
1082template<class A, class B>
1083inline
1085 const OpAddAssign& op,
1086 const QDPExpr<
1089 OLattice< FVec > > &rhs,
1090 const Subset& s)
1091{
1092
1093 const OLattice< HVec >& a = static_cast<const OLattice< HVec > &>(rhs.expression().child());
1094
1095 if( s.hasOrderedRep() ) {
1096 REAL *aptr =(REAL *)&(a.elem(s.start()).elem(0).elem(0).real());
1097 REAL *bptr =(REAL *)&(b.elem(s.start()).elem(0).elem(0).real());
1098
1099 int total_n_vec = s.end() - s.start() +1;
1100
1102
1104
1106 // Original code
1108 //unsigned int n_vec=s.end() - s.start()+1;
1109 //inlineAddSpinReconDir3Plus(aptr, bptr, n_vec);
1110 }
1111 else {
1112
1113 const int* tab = s.siteTable().slice();
1114
1115 int totalSize = s.numSiteTable();
1116
1118
1120
1122 // Original code
1124 /*
1125 for(int j=0; j < s.numSiteTable(); j++) {
1126 int i = tab[j];
1127
1128 REAL *aptr =(REAL *)&(a.elem(i).elem(0).elem(0).real());
1129 REAL *bptr =(REAL *)&(b.elem(i).elem(0).elem(0).real());
1130 inlineAddSpinReconDir3Plus(aptr, bptr, 1);
1131 }*/
1132 }
1133
1134}
1135
1136// d += SpinReconstructDir0Minus(Vec);
1137template<class A, class B>
1138inline
1140 const OpAddAssign& op,
1141 const QDPExpr<
1144 OLattice< FVec > > &rhs,
1145 const Subset& s)
1146{
1147
1148
1149 const OLattice< HVec >& a = static_cast<const OLattice< HVec > &>(rhs.expression().child());
1150
1151 if( s.hasOrderedRep() ) {
1152 REAL *aptr =(REAL *)&(a.elem(s.start()).elem(0).elem(0).real());
1153 REAL *bptr =(REAL *)&(b.elem(s.start()).elem(0).elem(0).real());
1154
1155 int total_n_vec = s.end() - s.start() +1;
1156
1158
1160
1162 // Original code
1164 //unsigned int n_vec=s.end() - s.start()+1;
1165 //inlineAddSpinReconDir0Minus(aptr, bptr, n_vec);
1166 }
1167 else {
1168
1169 const int* tab = s.siteTable().slice();
1170
1171 int totalSize = s.numSiteTable();
1172
1174
1176
1178 // Original code
1180 /*
1181 for(int j=0; j < s.numSiteTable(); j++) {
1182 int i = tab[j];
1183
1184 REAL *aptr =(REAL *)&(a.elem(i).elem(0).elem(0).real());
1185 REAL *bptr =(REAL *)&(b.elem(i).elem(0).elem(0).real());
1186 inlineAddSpinReconDir0Minus(aptr, bptr, 1);
1187 }*/
1188 }
1189
1190
1191}
1192
1193// d += SpinReconstructDir1Minus(Vec);
1194template<class A, class B>
1195inline
1197 const OpAddAssign& op,
1198 const QDPExpr<
1201 OLattice< FVec > > &rhs,
1202 const Subset& s)
1203{
1204
1205 const OLattice< HVec >& a = static_cast<const OLattice< HVec > &>(rhs.expression().child());
1206
1207 if( s.hasOrderedRep()) {
1208 REAL *aptr =(REAL *)&(a.elem(s.start()).elem(0).elem(0).real());
1209 REAL *bptr =(REAL *)&(b.elem(s.start()).elem(0).elem(0).real());
1210
1211 int total_n_vec = s.end() - s.start() +1;
1212
1214
1216
1218 // Original code
1220 //unsigned int n_vec=s.end() - s.start()+1;
1221 //inlineAddSpinReconDir1Minus(aptr, bptr, n_vec);
1222 }
1223 else {
1224
1225 const int* tab = s.siteTable().slice();
1226
1227 int totalSize = s.numSiteTable();
1228
1230
1232
1234 // Original code
1236 /*
1237 for(int j=0; j < s.numSiteTable(); j++) {
1238 int i = tab[j];
1239
1240 REAL *aptr =(REAL *)&(a.elem(i).elem(0).elem(0).real());
1241 REAL *bptr =(REAL *)&(b.elem(i).elem(0).elem(0).real());
1242 inlineAddSpinReconDir1Minus(aptr, bptr, 1);
1243 }*/
1244 }
1245
1246}
1247
1248// d += SpinReconstructDir2Minus(Vec);
1249template<class A, class B>
1250inline
1252 const OpAddAssign& op,
1253 const QDPExpr<
1256 OLattice< FVec > > &rhs,
1257 const Subset& s)
1258{
1259
1260
1261 const OLattice< HVec >& a = static_cast<const OLattice< HVec > &>(rhs.expression().child());
1262
1263 if( s.hasOrderedRep() ) {
1264 REAL *aptr =(REAL *)&(a.elem(s.start()).elem(0).elem(0).real());
1265 REAL *bptr =(REAL *)&(b.elem(s.start()).elem(0).elem(0).real());
1266
1267
1268 int total_n_vec = s.end() - s.start() +1;
1269
1271
1273
1275 // Original code
1277 //unsigned int n_vec=s.end() - s.start()+1;
1278 //inlineAddSpinReconDir2Minus(aptr, bptr, n_vec);
1279 }
1280 else {
1281
1282 const int* tab = s.siteTable().slice();
1283
1284 int totalSize = s.numSiteTable();
1285
1287
1289
1291 // Original code
1293 /*
1294 for(int j=0; j < s.numSiteTable(); j++) {
1295 int i = tab[j];
1296
1297 REAL *aptr =(REAL *)&(a.elem(i).elem(0).elem(0).real());
1298 REAL *bptr =(REAL *)&(b.elem(i).elem(0).elem(0).real());
1299 inlineAddSpinReconDir2Minus(aptr, bptr, 1);
1300 }*/
1301 }
1302
1303}
1304
1305// d += SpinReconstructDir3Minus(Vec);
1306template<class A, class B>
1307inline
1309 const OpAddAssign& op,
1310 const QDPExpr<
1313 OLattice< FVec > > &rhs,
1314 const Subset& s)
1315{
1316
1317
1318 const OLattice< HVec >& a = static_cast<const OLattice< HVec > &>(rhs.expression().child());
1319
1320 if( s.hasOrderedRep() ) {
1321 REAL *aptr =(REAL *)&(a.elem(s.start()).elem(0).elem(0).real());
1322 REAL *bptr =(REAL *)&(b.elem(s.start()).elem(0).elem(0).real());
1323
1324 int total_n_vec = s.end() - s.start() +1;
1325
1327
1329
1331 // Original code
1333 //unsigned int n_vec=s.end() - s.start()+1;
1334 //inlineAddSpinReconDir3Minus(aptr, bptr, n_vec);
1335 }
1336 else {
1337
1338 const int* tab = s.siteTable().slice();
1339
1340 int totalSize = s.numSiteTable();
1341
1343
1345
1347 // Original code
1349 /*
1350 for(int j=0; j < s.numSiteTable(); j++) {
1351 int i = tab[j];
1352
1353 REAL *aptr =(REAL *)&(a.elem(i).elem(0).elem(0).real());
1354 REAL *bptr =(REAL *)&(b.elem(i).elem(0).elem(0).real());
1355 inlineAddSpinReconDir3Minus(aptr, bptr, 1);
1356 }*/
1357 }
1358
1359}
1360
1361} // namespace QDP;
1362
1363#endif
Outer grid Lattice type.
Definition qdp_outer.h:264
T & elem(int i)
Definition qdp_outer.h:400
Primitive spin Vector class.
Expression class for QDP.
Definition qdp_qdpexpr.h:16
QDPType - major type class/container for all QDP objects.
Definition qdp_qdptype.h:29
Subsets - controls how lattices are looped.
Definition qdp_subset.h:39
int end() const
Definition qdp_subset.h:81
const multi1d< int > & siteTable() const
Definition qdp_subset.h:83
int numSiteTable() const
Definition qdp_subset.h:84
bool hasOrderedRep() const
Definition qdp_subset.h:79
int start() const
Definition qdp_subset.h:80
const T * slice() const
Return ref to a column slice.
Definition qdp_multi.h:225
REAL32 REAL
void evaluate(OLattice< DCol > &d, const OpAssign &op, const QDPExpr< BinaryNode< OpMultiply, Reference< QDPType< DCol, OLattice< DCol > > >, Reference< QDPType< DCol, OLattice< DCol > > > >, OLattice< DCol > > &rhs, const Subset &s)
Yet another random number generator.
void dispatch_to_threads(int numSiteTable, Arg a, void(*func)(int, int, int, Arg *))
void inlineSpinReconDir0Minus(const REAL *src, REAL *dst, unsigned int n_vec)
Spin recon (1/2)(1-\gamma_0).
void inlineAddSpinReconDir1Plus(const REAL *src, REAL *dst, unsigned int n_vec)
Spin recon (1/2)(1+\gamma_1).
PSpinVector< PColorVector< RComplex< REAL >, 3 >, 2 > HVec
void inlineAddSpinReconDir2Minus(const REAL *src, REAL *dst, unsigned int n_vec)
Spin recon (1/2)(1-\gamma_2).
void inlineAddSpinReconDir1Minus(const REAL *src, REAL *dst, unsigned int n_vec)
Spin recon (1/2)(1-\gamma_1).
void inlineSpinReconDir2Plus(const REAL *src, REAL *dst, unsigned int n_vec)
Spin recon (1/2)(1+\gamma_2).
void inlineSpinReconDir1Minus(const REAL *src, REAL *dst, unsigned int n_vec)
Spin recon (1/2)(1-\gamma_1).
void ordered_spin_project_evaluate_function(int lo, int hi, int myId, ordered_spin_project_user_arg *arg)
void inlineSpinProjDir0Plus(const REAL *src, REAL *dst, unsigned int n_vec)
Spin Project (1/2)(1+\gamma_0).
void unordered_spin_project_evaluate_function(int lo, int hi, int myId, unordered_spin_project_user_arg< A, B > *arg)
void inlineAddSpinReconDir3Plus(const REAL *src, REAL *dst, unsigned int n_vec)
Spin recon (1/2)(1+\gamma3).
void inlineSpinProjDir1Minus(const REAL *src, REAL *dst, unsigned int n_vec)
Spin Project (1/2)(1-\gamma_1).
void inlineSpinReconDir2Minus(const REAL *src, REAL *dst, unsigned int n_vec)
Spin recon (1/2)(1-\gamma_2).
void inlineSpinProjDir1Plus(const REAL *src, REAL *dst, unsigned int n_vec)
Spin Project (1/2)(1+\gamma_1).
void inlineAddSpinReconDir3Minus(const REAL *src, REAL *dst, unsigned int n_vec)
Spin recon (1/2)(1-\gamma3).
void inlineSpinProjDir3Minus(const REAL *src, REAL *dst, unsigned int n_vec)
Spin Project (1/2)(1-\gamma_3).
void inlineSpinProjDir2Minus(const REAL *src, REAL *dst, unsigned int n_vec)
Spin Project (1/2)(1-\gamma_2).
void inlineSpinReconDir3Minus(const REAL *src, REAL *dst, unsigned int n_vec)
Spin recon (1/2)(1-\gamma3).
void inlineAddSpinReconDir0Minus(const REAL *src, REAL *dst, unsigned int n_vec)
Spin recon (1/2)(1-\gamma_0).
void inlineAddSpinReconDir2Plus(const REAL *src, REAL *dst, unsigned int n_vec)
Spin recon (1/2)(1+\gamma_2).
void inlineSpinReconDir3Plus(const REAL *src, REAL *dst, unsigned int n_vec)
Spin recon (1/2)(1+\gamma3).
void inlineSpinProjDir2Plus(const REAL *src, REAL *dst, unsigned int n_vec)
Spin Project (1/2)(1+\gamma_2).
void inlineAddSpinReconDir0Plus(const REAL *src, REAL *dst, unsigned int n_vec)
Spin recon (1/2)(1+\gamma_0).
void inlineSpinReconDir1Plus(const REAL *src, REAL *dst, unsigned int n_vec)
Spin recon (1/2)(1+\gamma_1).
PSpinVector< PColorVector< RComplex< REAL >, 3 >, 4 > FVec
void inlineSpinReconDir0Plus(const REAL *src, REAL *dst, unsigned int n_vec)
Spin recon (1/2)(1+\gamma_0).