QDP++
qdp_outer.h
Go to the documentation of this file.
1// -*- C++ -*-
2
3#ifndef QDP_OUTER_H
4#define QDP_OUTER_H
5
6#include "qdp_config.h"
7#include "qdp_allocator.h"
8
12
13namespace QDP {
14
22
23
32
34
35template<class T>
36class OScalar: public QDPType<T, OScalar<T> >
37{
38public:
41
42 OScalar( T* F_ , float f ) : F(*F_) {}
43
44 //---------------------------------------------------------
46 OScalar(const typename WordType<T>::Type_t& rhs)
47 {
48 typedef typename InternalScalar<T>::Type_t Scalar_t;
49 elem() = Scalar_t(rhs);
50 }
51
52
54 OScalar(const Zero& rhs)
55 {
56 this->assign(rhs);
57 }
58
59
61 template<class T1>
62 OScalar(const OScalar<T1>& rhs)
63 {
64 this->assign(rhs);
65 }
66
67
69 template<class RHS, class T1>
70 OScalar(const QDPExpr<RHS, OScalar<T1> >& rhs)
71 {
72 this->assign(rhs);
73 }
74
75
76 //---------------------------------------------------------
77 // Operators
78 // NOTE: all this->assignment-like operators except operator= are
79 // inherited from QDPType
80
81 inline
83 {
84 return this->assign(rhs);
85 }
86
87 inline
88 OScalar& operator=(const Zero& rhs)
89 {
90 return this->assign(rhs);
91 }
92
93 template<class T1,class C1>
94 inline
96 {
97 return this->assign(rhs);
98 }
99
100 template<class T1,class C1>
101 inline
103 {
104 return this->assign(rhs);
105 }
106
107
109 inline
111 {
112 return this->assign(rhs);
113 }
114
115
116 //---------------------------------------------------------
117 // Subsets
119 {return OSubScalar<T>(*this,const_cast<Subset&>(s));}
120
121 //---------------------------------------------------------
123 OScalar(const OScalar& a): F(a.F) {/*fprintf(stderr,"copy OScalar\n");*/}
124
125 T* getF() { return &F; }
126
127public:
128 inline T& elem() {return F;}
129 inline const T& elem() const {return F;}
130
131 inline T& elem(int i) {return F;} // The indexing is a nop
132 inline const T& elem(int i) const {return F;} // The indexing is a nop
133
134private:
135 T F;
136};
137
138
140
142template<class T>
143std::istream& operator>>(std::istream& s, OScalar<T>& d)
144{
145 return s >> d.elem();
146}
147
149
151template<class T>
152inline
153std::ostream& operator<<(std::ostream& s, const OScalar<T>& d)
154{
155 return s << d.elem();
156}
157
159template<class RHS, class T1>
160std::ostream& operator<<(std::ostream& s, const QDPExpr<RHS, OScalar<T1> >& l)
161{
162 typedef OScalar<T1> C1;
163 return s << C1(l);
164}
165
167template<class T>
169{
170 return txt >> d.elem();
171}
172
174template<class T>
176{
177 return is >> d.elem();
178}
179
181template<class T>
182inline
184{
185 return txt << d.elem();
186}
187
189template<class T>
191{
192 return s << d.elem();
193}
194
196template<class RHS, class T1>
198{
199 typedef OScalar<T1> C1;
200 return s << C1(l);
201}
202
203#ifdef QDP_USE_LIBXML2
205
206template<class T>
207inline
208XMLWriter& operator<<(XMLWriter& xml, const OScalar<T>& d)
209{
210 return xml << d.elem();
211}
212
214
215template<class T>
216inline
217void read(XMLReader& xml, const std::string& path, OScalar<T>& d)
218{
219 read(xml, path, d.elem());
220}
221#endif
222 // end of group oscalar
224
225
227
231template<class T, class T1, class Op, class RHS>
232inline
233void evaluate(OScalar<T>& dest, const Op& op, const QDPExpr<RHS,OScalar<T1> >& rhs,
234 const Subset& s)
235{
236 // Subset is not used at this level. It may be needed, though, within an inner operation
237 op(dest.elem(), forEach(rhs, ElemLeaf(), OpCombine()));
238}
239
240template<class T, class T1, class Op, class RHS>
241inline
242void evaluate_F(T* dest, const Op& op, const QDPExpr<RHS,OScalar<T1> >& rhs,
243 const Subset& s)
244{
245 // Subset is not used at this level. It may be needed, though, within an inner operation
246 op(*dest, forEach(rhs, ElemLeaf(), OpCombine()));
247}
248
249
250//-------------------------------------------------------------------------------------
259
261
262template<class T>
263class OLattice: public QDPType<T, OLattice<T> >
264{
265public:
267 {
268 alloc_mem("create");
269 }
271 {
272 free_mem();
273 }
274
275
276 OLattice( T* F , float f ): mem(false), F(F) {}
277
278
279 //---------------------------------------------------------
281 template<class T1>
283 {
284 alloc_mem("construct from OScalar");
285 this->assign(rhs);
286 }
287
288
290 template<class T1>
292 {
293 alloc_mem("construct from OLattice");
294 this->assign(rhs);
295 }
296
297
299 template<class RHS, class T1>
300 OLattice(const QDPExpr<RHS, OLattice<T1> >& rhs)
301 {
302 alloc_mem("construct from expr");
303 this->assign(rhs);
304 }
305
306
308 OLattice(const typename WordType<T>::Type_t& rhs)
309 {
310 alloc_mem("construct from const");
311
313 this->assign(Scalar_t(rhs));
314 }
315
316
318 OLattice(const Zero& rhs)
319 {
320 alloc_mem("construct from zero");
321 this->assign(rhs);
322 }
323
324 //---------------------------------------------------------
325 // Operators
326 // NOTE: all assignment-like operators except operator= are
327 // inherited from QDPType
328
329 inline
331 {
332 return this->assign(rhs);
333 }
334
335 inline
337 {
338 return this->assign(rhs);
339 }
340
341 template<class T1,class C1>
342 inline
344 {
345 return this->assign(rhs);
346 }
347
348 template<class T1,class C1>
349 inline
351 {
352 return this->assign(rhs);
353 }
354
355 inline
357 {
358 return this->assign(rhs);
359 }
360
361 template<class T1>
362 inline
363 void operator=(const OSubLattice<T1>& rhs)
364 {
365 this->assign(rhs);
366 }
367
368
369 //---------------------------------------------------------
370 // Subsets
372 {return OSubLattice<T>(*this,const_cast<Subset&>(s));}
373
374 //---------------------------------------------------------
376
377 OLattice(const OLattice& rhs)
378 {
379 alloc_mem("copy");
380 this->assign(rhs);
381 }
382
383
384public:
386
390 inline T* getF() const {return F;}
391
392 // Nop if not on QCDOC
393 inline void moveToFastMemoryHint(bool copy=false) {}
394
395 // Nop if not on QCDOC
396 inline void revertFromFastMemoryHint(bool copy=false) {}
397
398
399public:
400 inline T& elem(int i) {return F[i];}
401 inline const T& elem(int i) const {return F[i];}
402
403
404private:
406
412 inline void alloc_mem(const char* const p)
413 {
414 mem=true;
415 // Barfs if allocator fails
416 size_t NSites = static_cast<size_t>(Layout::sitesOnNode());
417 try
418 {
420 }
421 catch(std::bad_alloc) {
422 QDPIO::cerr << "Allocation failed in OLattice alloc_mem" << std::endl;
424
425 QDP_abort(1);
426 }
427
428#if 0
429 // Nuke touch for now
430#pragma omp parallel for
431 for(int j=0; j < NSites; ++j) {
432 *((char *)&F[j])=0;
433 }
434#endif
435
436 }
437
439 inline void free_mem()
440 {
441 if (!mem) return;
442 if( F != nullptr )
443 {
445
446 }
447 mem = false;
448 F = nullptr;
449 }
450
451
452public:
454 void print_info(char *name)
455 {
456 QDP_info("Info: %s = OLattice[%d]=0x%x, this=0x%xn",
457 name,Layout::sitesOnNode(),(void *)F,this);
458 }
459
460
461private:
462 bool mem;
463 T *F; // Alias to current memory space
464};
465
466 // end of group olattice
468
469
470
471
472
473//-----------------------------------------------------------------------------
474// We need to specialize CreateLeaf<T> for our class, so that operators
475// know what to stick in the leaves of the expression tree.
476//-----------------------------------------------------------------------------
477
478template<class T>
480{
481// typedef OScalar<T> Leaf_t;
483 inline static
484 Leaf_t make(const OScalar<T> &a) { return Leaf_t(a); }
485};
486
487template<class T>
489{
490// typedef OLattice<T> Leaf_t;
492 inline static
493 Leaf_t make(const OLattice<T> &a) { return Leaf_t(a); }
494};
495
496//-----------------------------------------------------------------------------
497// Specialization of LeafFunctor class for applying the EvalLeaf1
498// tag to a OScalar and OLattice. The apply method simply returns the array
499// evaluated at the point.
500//-----------------------------------------------------------------------------
501
502template<class T>
504{
505// typedef T Type_t;
507 inline static Type_t apply(const OScalar<T> &a, const ElemLeaf &f)
508 {return Type_t(a.elem());}
509};
510
511template<class T>
513{
514// typedef T Type_t;
516 inline static Type_t apply(const OScalar<T> &a, const EvalLeaf1 &f)
517 {return Type_t(a.elem());}
518};
519
520template<class T>
522{
523// typedef T Type_t;
525 inline static Type_t apply(const OLattice<T> &a, const EvalLeaf1 &f)
526 {return Type_t(a.elem(f.val1()));}
527};
528
529
530//-----------------------------------------------------------------------------
531// Traits classes to support operations of simple scalars (floating constants,
532// etc.) on QDPTypes
533//-----------------------------------------------------------------------------
534
535template<class T>
536struct WordType<OScalar<T> >
537{
538 typedef typename WordType<T>::Type_t Type_t;
539};
540
541template<class T>
542struct WordType<OLattice<T> >
543{
544 typedef typename WordType<T>::Type_t Type_t;
545};
546
547template<class T>
552
553template<class T>
558
559template<class T>
564
565template<class T>
570
571// Internally used scalars
572template<class T>
576
577template<class T>
581
582
583// Trait to make a primitive scalar leaving grid along
584template<class T>
588
589template<class T>
593
594
595// Trait to make a lattice scalar leaving primitive indices alone
596template<class T>
600
601template<class T>
605
606
607// Internally used real scalars
608template<class T>
612
613template<class T>
617
618
619
620//-----------------------------------------------------------------------------
621// Traits classes to support return types
622//-----------------------------------------------------------------------------
623
624// Default unary(OScalar) -> OScalar
625template<class T1, class Op>
629
630// Default unary(OLattice) -> OLattice
631template<class T1, class Op>
635
636// Default binary(OScalar,OScalar) -> OScalar
637template<class T1, class T2, class Op>
641
642// Currently, the only trinary operator is ``where'', so return
643// based on T2 and T3
644// Default trinary(OScalar,OScalar,OScalar) -> OScalar
645template<class T1, class T2, class T3, class Op>
649
650// Default binary(OLattice,OLattice) -> OLattice
651template<class T1, class T2, class Op>
655
656// Default binary(OScalar,OLattice) -> OLattice
657template<class T1, class T2, class Op>
661
662// Default binary(OLattice,OScalar) -> OLattice
663template<class T1, class T2, class Op>
667
668
669// Default trinary(OLattice,OLattice,OLattice) -> OLattice
670template<class T1, class T2, class T3, class Op>
674
675
676// Default trinary(OLattice,OScalar,OLattice) -> OLattice
677template<class T1, class T2, class T3, class Op>
681
682// Default trinary(OLattice,OLattice,OScalar) -> OLattice
683template<class T1, class T2, class T3, class Op>
687
688// Default trinary(OScalar,OLattice,OLattice) -> OLattice
689template<class T1, class T2, class T3, class Op>
693
694
695// Default trinary(OScalar,OScalar,OLattice) -> OLattice
696template<class T1, class T2, class T3, class Op>
700
701// Default trinary(OSscalar,OLattice,OScalar) -> OLattice
702template<class T1, class T2, class T3, class Op>
706
707// Default trinary(OLattice,OScalar,OScalar) -> OLattice
708template<class T1, class T2, class T3, class Op>
712
713
714
715
716// Specific OScalar cases
717// Global operations
718template<class T>
722
723template<class T>
727
728template<class T>
732
733template<class T>
737
738template<class T>
742
743template<class T>
747
748template<class T1, class T2>
752
753template<class T1, class T2>
757
758template<class T>
762
763template<class T1, class T2>
767
768template<class T1, class T2>
772
773template<class T1, class T2>
777
778
779// Gamma algebra
780template<int N, int m, class T2, class OpGammaConstMultiply>
784
785template<class T2, int N, int m, class OpMultiplyGammaConst>
789
790template<class T2, int N, class OpGammaTypeMultiply>
794
795template<class T2, int N, class OpMultiplyGammaType>
799
800// Gamma algebra
801template<int N, int m, class T2, class OpGammaConstDPMultiply>
805
806template<class T2, int N, int m, class OpMultiplyGammaConstDP>
810
811template<class T2, int N, class OpGammaTypeDPMultiply>
815
816template<class T2, int N, class OpMultiplyGammaTypeDP>
820
821
822
823// Local operations
824template<class T>
828
829
830#if 0
831template<class T1, class T2>
832struct UnaryReturn<OScalar<T2>, OpCast<T1> > {
834// typedef T1 Type_t;
835};
836#endif
837
838template<class T1, class T2 >
842
843template<class T1, class T2 >
847
848template<class T1, class T2 >
852
853template<class T1, class T2 >
857
858template<class T1, class T2 >
862
863template<class T1, class T2 >
867
868template<class T1, class T2 >
872
873template<class T1, class T2 >
877
878template<class T1, class T2>
882
883template<class T1, class T2>
887
888
889template<class T1, class T2>
893
894template<class T1, class T2>
898
899template<class T1, class T2>
903
904template<class T1, class T2>
908
909template<class T1, class T2>
913
914template<class T1, class T2>
918
919template<class T1, class T2>
923
924template<class T1, class T2>
928
929template<class T1, class T2>
933
934template<class T1, class T2>
938
939template<class T1, class T2, class T3>
943
944// Specific OLattice cases
945// Global operations
946template<class T>
950
951template<class T>
955
956template<class T>
960
961template<class T>
965
966template<class T>
970
971template<class T>
975
976template<class T>
980
981template<class T1, class T2>
985
986template<class T1, class T2>
990
991template<class T>
995
996template<class T1, class T2>
1000
1001template<class T1, class T2>
1005
1006template<class T1, class T2>
1010
1011
1012// Gamma algebra
1013template<int N, int m, class T2, class OpGammaConstMultiply>
1017
1018template<class T2, int N, int m, class OpMultiplyGammaConst>
1022
1023template<class T2, int N, class OpGammaTypeMultiply>
1027
1028template<class T2, int N, class OpMultiplyGammaType>
1032
1033
1034// Gamma algebra
1035template<int N, int m, class T2, class OpGammaConstDPMultiply>
1039
1040template<class T2, int N, int m, class OpMultiplyGammaConstDP>
1044
1045template<class T2, int N, class OpGammaTypeDPMultiply>
1049
1050template<class T2, int N, class OpMultiplyGammaTypeDP>
1054
1055
1056
1057// Local operations
1058template<class T>
1062
1063
1064#if 0
1065template<class T1, class T2>
1066struct UnaryReturn<OLattice<T2>, OpCast<T1> > {
1068// typedef T1 Type_t;
1069};
1070#endif
1071
1072template<class T1, class T2 >
1076
1077template<class T1, class T2 >
1081
1082template<class T1, class T2 >
1086
1087template<class T1, class T2 >
1091
1092template<class T1, class T2 >
1096
1097template<class T1, class T2 >
1101
1102template<class T1, class T2 >
1106
1107template<class T1, class T2 >
1111
1112template<class T1, class T2>
1116
1117template<class T1, class T2>
1121
1122
1123template<class T1, class T2>
1127
1128template<class T1, class T2>
1132
1133template<class T1, class T2>
1137
1138template<class T1, class T2>
1142
1143template<class T1, class T2>
1147
1148template<class T1, class T2>
1152
1153template<class T1, class T2>
1157
1158template<class T1, class T2>
1162
1163template<class T1, class T2>
1167
1168template<class T1, class T2>
1172
1173template<class T1, class T2, class T3>
1177
1178
1179// Mixed OLattice & OScalar cases
1180// Global operations
1181template<class T1, class T2>
1185
1186template<class T1, class T2>
1190
1191template<class T1, class T2>
1195
1196template<class T1, class T2>
1200
1201
1202template<class T1, class T2>
1206
1207template<class T1, class T2>
1211
1212template<class T1, class T2>
1216
1217template<class T1, class T2>
1221
1222template<class T1, class T2>
1226
1227template<class T1, class T2>
1231
1232
1233// Local operations
1234template<class T1, class T2 >
1238
1239template<class T1, class T2 >
1243
1244template<class T1, class T2 >
1248
1249template<class T1, class T2 >
1253
1254template<class T1, class T2 >
1258
1259template<class T1, class T2 >
1263
1264template<class T1, class T2 >
1268
1269template<class T1, class T2 >
1273
1274template<class T1, class T2>
1278
1279template<class T1, class T2>
1283
1284
1285template<class T1, class T2>
1289
1290template<class T1, class T2>
1294
1295template<class T1, class T2>
1299
1300template<class T1, class T2>
1304
1305template<class T1, class T2>
1309
1310template<class T1, class T2>
1314
1315template<class T1, class T2>
1319
1320template<class T1, class T2>
1324
1325template<class T1, class T2>
1329
1330template<class T1, class T2>
1334
1335
1336template<class T1, class T2 >
1340
1341template<class T1, class T2 >
1345
1346template<class T1, class T2 >
1350
1351template<class T1, class T2 >
1355
1356template<class T1, class T2 >
1360
1361template<class T1, class T2 >
1365
1366template<class T1, class T2 >
1370
1371template<class T1, class T2 >
1375
1376template<class T1, class T2>
1380
1381template<class T1, class T2>
1385
1386
1387
1388
1389
1390//-----------------------------------------------------------------------------
1391// Scalar Operations
1392//-----------------------------------------------------------------------------
1393
1396
1398template<class T>
1399inline typename WordType< OScalar<T> >::Type_t
1401{
1402 return toWordType(s.elem());
1403}
1404
1406
1407template<class T>
1411
1412template<class T>
1414getSite(const OScalar<T>& s1, int innersite)
1415{
1417
1418 d.elem() = getSite(s1.elem(), innersite);
1419 return d;
1420}
1421
1422
1424template<class T>
1426{
1427 zero_rep(dest.elem());
1428}
1429
1431template<class T1, class T2>
1432void copymask(OScalar<T2>& dest, const OScalar<T1>& mask, const OScalar<T2>& s1)
1433{
1434 copymask(dest.elem(), mask.elem(), s1.elem());
1435}
1436
1438template<class T, class T1>
1439void cast_rep(T& d, const OScalar<T1>& s1)
1440{
1441 cast_rep(d, s1.elem());
1442}
1443
1445template<class T, class T1>
1447{
1448 cast_rep(d.elem(), s1.elem());
1449}
1450
1451
1452//-----------------------------------------------------------------------------
1453// Random numbers
1455
1456template<class T>
1457void random(OScalar<T>& d);
1458
1459
1461template<class T>
1463{
1464 OScalar<T> r1, r2;
1465
1466 random(OSubScalar<T>(r1,d.subset()));
1467 random(OSubScalar<T>(r2,d.subset()));
1468
1469 fill_gaussian(d.elem(), r1.elem(), r2.elem());
1470}
1471
1472
1473 // end of group oscalar
1475
1476} // namespace QDP
1477
1478#endif
void free(void *mem)
Free an aligned pointer, which was allocated by us.
Outer grid Lattice type.
Definition qdp_outer.h:264
OLattice & operator=(const OLattice &rhs)
Definition qdp_outer.h:356
OLattice(const typename WordType< T >::Type_t &rhs)
construct OLattice = const
Definition qdp_outer.h:308
OLattice & operator=(const typename WordType< T >::Type_t &rhs)
Definition qdp_outer.h:330
OLattice & operator=(const QDPExpr< T1, C1 > &rhs)
Definition qdp_outer.h:350
const T & elem(int i) const
Definition qdp_outer.h:401
OLattice & operator=(const QDPType< T1, C1 > &rhs)
Definition qdp_outer.h:343
void moveToFastMemoryHint(bool copy=false)
Definition qdp_outer.h:393
OLattice(const OScalar< T1 > &rhs)
conversion by constructor OLattice<T> = OScalar<T1>
Definition qdp_outer.h:282
OLattice & operator=(const Zero &rhs)
Definition qdp_outer.h:336
T & elem(int i)
Definition qdp_outer.h:400
void operator=(const OSubLattice< T1 > &rhs)
Definition qdp_outer.h:363
OLattice(const OLattice &rhs)
Copy constructor.
Definition qdp_outer.h:377
T * getF() const
The backdoor.
Definition qdp_outer.h:390
OSubLattice< T > operator[](const Subset &s)
Definition qdp_outer.h:371
OLattice(const OLattice< T1 > &rhs)
conversion by constructor OLattice<T> = OLattice<T1>
Definition qdp_outer.h:291
void print_info(char *name)
Debugging info.
Definition qdp_outer.h:454
OLattice(const Zero &rhs)
construct OLattice = 0
Definition qdp_outer.h:318
OLattice(T *F, float f)
Definition qdp_outer.h:276
void revertFromFastMemoryHint(bool copy=false)
Definition qdp_outer.h:396
OLattice(const QDPExpr< RHS, OLattice< T1 > > &rhs)
conversion by constructor OLattice = Expr
Definition qdp_outer.h:300
Outer grid Scalar class *‍/.
Definition qdp_outer.h:37
OSubScalar< T > operator[](const Subset &s)
Definition qdp_outer.h:118
OScalar(const typename WordType< T >::Type_t &rhs)
construct dest = const
Definition qdp_outer.h:46
OScalar(const OScalar &a)
Deep copy constructor.
Definition qdp_outer.h:123
OScalar(const Zero &rhs)
construct dest = 0
Definition qdp_outer.h:54
OScalar & operator=(const QDPExpr< T1, C1 > &rhs)
Definition qdp_outer.h:102
OScalar(const QDPExpr< RHS, OScalar< T1 > > &rhs)
conversion by constructor OScalar = Expr
Definition qdp_outer.h:70
const T & elem() const
Definition qdp_outer.h:129
const T & elem(int i) const
Definition qdp_outer.h:132
OScalar(const OScalar< T1 > &rhs)
conversion by constructor OScalar<T> = OScalar<T1>
Definition qdp_outer.h:62
OScalar(T *F_, float f)
Definition qdp_outer.h:42
OScalar & operator=(const Zero &rhs)
Definition qdp_outer.h:88
OScalar & operator=(const typename WordType< T >::Type_t &rhs)
Definition qdp_outer.h:82
T & elem(int i)
Definition qdp_outer.h:131
OScalar & operator=(const OScalar &rhs)
Use this for default operator=.
Definition qdp_outer.h:110
OScalar & operator=(const QDPType< T1, C1 > &rhs)
Definition qdp_outer.h:95
OLattice class narrowed to a subset.
OScalar class narrowed to a subset.
const Subset & subset() const
Expression class for QDP.
Definition qdp_qdpexpr.h:16
OScalar< T > & assign(const typename WordType< OScalar< T > >::Type_t &rhs)
Definition qdp_qdptype.h:51
StandardInputStream class.
Definition qdp_stdio.h:33
StandardOutputStream class.
Definition qdp_stdio.h:106
Subsets - controls how lattices are looped.
Definition qdp_subset.h:39
Text input class.
Definition qdp_io.h:42
Text output base class.
Definition qdp_io.h:203
XML reader class.
Definition qdp_xmlio.h:44
Container for a multi-dimensional 1D array.
Definition qdp_multi.h:25
TextWriter & operator<<(TextWriter &txt, const std::string &output)
Definition qdp_io.cc:283
TextReader & operator>>(TextReader &txt, std::string &input)
Definition qdp_io.cc:121
void read(BinaryReader &bin, std::string &input, size_t maxBytes)
Definition qdp_io.cc:778
void fill_gaussian(IScalar< T > &d, IScalar< T > &r1, IScalar< T > &r2)
dest = gaussian
Definition qdp_inner.h:1861
WordType< IScalar< T > > toWordType(const IScalar< T > &s)
QDP Wordtype to primitive wordtype.
Definition qdp_inner.h:1647
void zero_rep(IScalar< T > &dest)
dest = 0
Definition qdp_inner.h:1841
void copymask(IScalar< T > &d, const IScalar< T1 > &mask, const IScalar< T > &s1)
dest = (mask) ? s1 : dest
Definition qdp_inner.h:1656
void cast_rep(T &d, const IScalar< T1 > &s1)
dest [float type] = source [int type]
Definition qdp_inner.h:1664
void recast_rep(IScalar< T > &d, const IScalar< T1 > &s1)
dest [float type] = source [int type]
Definition qdp_inner.h:1673
UnaryReturn< IScalar< T >, FnGetSite >::Type_t getSite(const IScalar< T > &s1, int innersite)
Definition qdp_inner.h:1605
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)
void gaussian(OSubScalar< T > &d)
dest = gaussian
Definition qdp_outer.h:1462
void random(OScalar< T > &d)
dest = random
int sitesOnNode()
Subgrid lattice volume.
StandardOutputStream cerr
Definition qdp_stdio.cc:22
Yet another random number generator.
ForEach< Expr, FTag, CTag >::Type_t forEach(const Expr &e, const FTag &f, const CTag &c)
Definition qdp.h:88
void evaluate_F(T *dest, const Op &op, const QDPExpr< RHS, OScalar< T1 > > &rhs, const Subset &s)
Definition qdp_outer.h:242
void QDP_abort(int status)
Panic button.
int QDP_info(const char *format,...)
Simple information display routine.
Definition qdp_util.cc:43
Catch-alls for all memory allocators.
OLattice< typename UnaryReturn< T2, OpUnaryPlus >::Type_t > Type_t
Definition qdp_outer.h:1037
OScalar< typename UnaryReturn< T2, OpUnaryPlus >::Type_t > Type_t
Definition qdp_outer.h:803
OLattice< typename UnaryReturn< T2, OpUnaryPlus >::Type_t > Type_t
Definition qdp_outer.h:1015
OScalar< typename UnaryReturn< T2, OpUnaryPlus >::Type_t > Type_t
Definition qdp_outer.h:782
OLattice< typename UnaryReturn< T2, OpUnaryPlus >::Type_t > Type_t
Definition qdp_outer.h:1047
OScalar< typename UnaryReturn< T2, OpUnaryPlus >::Type_t > Type_t
Definition qdp_outer.h:813
OLattice< typename UnaryReturn< T2, OpUnaryPlus >::Type_t > Type_t
Definition qdp_outer.h:1025
OScalar< typename UnaryReturn< T2, OpUnaryPlus >::Type_t > Type_t
Definition qdp_outer.h:792
OScalar< typename BinaryReturn< T1, T2, FnInnerProductReal >::Type_t > Type_t
Definition qdp_outer.h:988
OScalar< typename BinaryReturn< T1, T2, FnInnerProduct >::Type_t > Type_t
Definition qdp_outer.h:983
OLattice< typename BinaryReturn< T1, T2, FnLocalColorInnerProduct >::Type_t > Type_t
Definition qdp_outer.h:1008
OLattice< typename BinaryReturn< T1, T2, FnLocalInnerProductReal >::Type_t > Type_t
Definition qdp_outer.h:1003
OLattice< typename BinaryReturn< T1, T2, FnLocalInnerProduct >::Type_t > Type_t
Definition qdp_outer.h:998
OLattice< typename BinaryReturn< T1, T2, OpAddAssign >::Type_t > & Type_t
Definition qdp_outer.h:1125
OLattice< typename BinaryReturn< T1, T2, OpAnd >::Type_t > Type_t
Definition qdp_outer.h:1104
OLattice< typename BinaryReturn< T1, T2, OpBitwiseAndAssign >::Type_t > & Type_t
Definition qdp_outer.h:1155
OLattice< typename BinaryReturn< T1, T2, OpBitwiseOrAssign >::Type_t > & Type_t
Definition qdp_outer.h:1150
OLattice< typename BinaryReturn< T1, T2, OpBitwiseXorAssign >::Type_t > & Type_t
Definition qdp_outer.h:1160
OLattice< typename BinaryReturn< T1, T2, OpDivideAssign >::Type_t > & Type_t
Definition qdp_outer.h:1140
OLattice< typename BinaryReturn< T1, T2, OpEQ >::Type_t > Type_t
Definition qdp_outer.h:1094
OLattice< typename BinaryReturn< T1, T2, OpGE >::Type_t > Type_t
Definition qdp_outer.h:1089
OLattice< typename BinaryReturn< T1, T2, OpGT >::Type_t > Type_t
Definition qdp_outer.h:1084
OLattice< typename BinaryReturn< T1, T2, OpLE >::Type_t > Type_t
Definition qdp_outer.h:1079
OLattice< typename BinaryReturn< T1, T2, OpLT >::Type_t > Type_t
Definition qdp_outer.h:1074
OLattice< typename BinaryReturn< T1, T2, OpLeftShiftAssign >::Type_t > & Type_t
Definition qdp_outer.h:1165
OLattice< typename BinaryReturn< T1, T2, OpLeftShift >::Type_t > Type_t
Definition qdp_outer.h:1114
OLattice< typename BinaryReturn< T1, T2, OpModAssign >::Type_t > & Type_t
Definition qdp_outer.h:1145
OLattice< typename BinaryReturn< T1, T2, OpMultiplyAssign >::Type_t > & Type_t
Definition qdp_outer.h:1135
OLattice< typename BinaryReturn< T1, T2, OpNE >::Type_t > Type_t
Definition qdp_outer.h:1099
OLattice< typename BinaryReturn< T1, T2, OpOr >::Type_t > Type_t
Definition qdp_outer.h:1109
OLattice< typename BinaryReturn< T1, T2, OpRightShiftAssign >::Type_t > & Type_t
Definition qdp_outer.h:1170
OLattice< typename BinaryReturn< T1, T2, OpRightShift >::Type_t > Type_t
Definition qdp_outer.h:1119
OLattice< typename BinaryReturn< T1, T2, OpSubtractAssign >::Type_t > & Type_t
Definition qdp_outer.h:1130
OLattice< typename BinaryReturn< T1, T2, Op >::Type_t > Type_t
Definition qdp_outer.h:653
OScalar< typename BinaryReturn< T1, T2, FnInnerProductReal >::Type_t > Type_t
Definition qdp_outer.h:1188
OScalar< typename BinaryReturn< T1, T2, FnInnerProduct >::Type_t > Type_t
Definition qdp_outer.h:1183
OLattice< typename BinaryReturn< T1, T2, FnLocalColorInnerProduct >::Type_t > Type_t
Definition qdp_outer.h:1214
OLattice< typename BinaryReturn< T1, T2, FnLocalInnerProductReal >::Type_t > Type_t
Definition qdp_outer.h:1209
OLattice< typename BinaryReturn< T1, T2, FnLocalInnerProduct >::Type_t > Type_t
Definition qdp_outer.h:1204
OLattice< typename BinaryReturn< T1, T2, OpAddAssign >::Type_t > & Type_t
Definition qdp_outer.h:1287
OLattice< typename BinaryReturn< T1, T2, OpAnd >::Type_t > Type_t
Definition qdp_outer.h:1266
OLattice< typename BinaryReturn< T1, T2, OpBitwiseAndAssign >::Type_t > & Type_t
Definition qdp_outer.h:1317
OLattice< typename BinaryReturn< T1, T2, OpBitwiseOrAssign >::Type_t > & Type_t
Definition qdp_outer.h:1312
OLattice< typename BinaryReturn< T1, T2, OpBitwiseXorAssign >::Type_t > & Type_t
Definition qdp_outer.h:1322
OLattice< typename BinaryReturn< T1, T2, OpDivideAssign >::Type_t > & Type_t
Definition qdp_outer.h:1302
OLattice< typename BinaryReturn< T1, T2, OpEQ >::Type_t > Type_t
Definition qdp_outer.h:1256
OLattice< typename BinaryReturn< T1, T2, OpGE >::Type_t > Type_t
Definition qdp_outer.h:1251
OLattice< typename BinaryReturn< T1, T2, OpGT >::Type_t > Type_t
Definition qdp_outer.h:1246
OLattice< typename BinaryReturn< T1, T2, OpLE >::Type_t > Type_t
Definition qdp_outer.h:1241
OLattice< typename BinaryReturn< T1, T2, OpLT >::Type_t > Type_t
Definition qdp_outer.h:1236
OLattice< typename BinaryReturn< T1, T2, OpLeftShiftAssign >::Type_t > & Type_t
Definition qdp_outer.h:1327
OLattice< typename BinaryReturn< T1, T2, OpLeftShift >::Type_t > Type_t
Definition qdp_outer.h:1276
OLattice< typename BinaryReturn< T1, T2, OpModAssign >::Type_t > & Type_t
Definition qdp_outer.h:1307
OLattice< typename BinaryReturn< T1, T2, OpMultiplyAssign >::Type_t > & Type_t
Definition qdp_outer.h:1297
OLattice< typename BinaryReturn< T1, T2, OpNE >::Type_t > Type_t
Definition qdp_outer.h:1261
OLattice< typename BinaryReturn< T1, T2, OpOr >::Type_t > Type_t
Definition qdp_outer.h:1271
OLattice< typename BinaryReturn< T1, T2, OpRightShiftAssign >::Type_t > & Type_t
Definition qdp_outer.h:1332
OLattice< typename BinaryReturn< T1, T2, OpRightShift >::Type_t > Type_t
Definition qdp_outer.h:1281
OLattice< typename BinaryReturn< T1, T2, OpSubtractAssign >::Type_t > & Type_t
Definition qdp_outer.h:1292
OLattice< typename BinaryReturn< T1, T2, Op >::Type_t > Type_t
Definition qdp_outer.h:665
OLattice< typename UnaryReturn< T2, OpUnaryPlus >::Type_t > Type_t
Definition qdp_outer.h:1042
OLattice< typename UnaryReturn< T2, OpUnaryPlus >::Type_t > Type_t
Definition qdp_outer.h:1020
OLattice< typename UnaryReturn< T2, OpUnaryPlus >::Type_t > Type_t
Definition qdp_outer.h:1052
OLattice< typename UnaryReturn< T2, OpUnaryPlus >::Type_t > Type_t
Definition qdp_outer.h:1030
OScalar< typename BinaryReturn< T1, T2, FnInnerProductReal >::Type_t > Type_t
Definition qdp_outer.h:1198
OScalar< typename BinaryReturn< T1, T2, FnInnerProduct >::Type_t > Type_t
Definition qdp_outer.h:1193
OLattice< typename BinaryReturn< T1, T2, FnLocalColorInnerProduct >::Type_t > Type_t
Definition qdp_outer.h:1229
OLattice< typename BinaryReturn< T1, T2, FnLocalInnerProductReal >::Type_t > Type_t
Definition qdp_outer.h:1224
OLattice< typename BinaryReturn< T1, T2, FnLocalInnerProduct >::Type_t > Type_t
Definition qdp_outer.h:1219
OLattice< typename BinaryReturn< T1, T2, OpAnd >::Type_t > Type_t
Definition qdp_outer.h:1368
OLattice< typename BinaryReturn< T1, T2, OpEQ >::Type_t > Type_t
Definition qdp_outer.h:1358
OLattice< typename BinaryReturn< T1, T2, OpGE >::Type_t > Type_t
Definition qdp_outer.h:1353
OLattice< typename BinaryReturn< T1, T2, OpGT >::Type_t > Type_t
Definition qdp_outer.h:1348
OLattice< typename BinaryReturn< T1, T2, OpLE >::Type_t > Type_t
Definition qdp_outer.h:1343
OLattice< typename BinaryReturn< T1, T2, OpLT >::Type_t > Type_t
Definition qdp_outer.h:1338
OLattice< typename BinaryReturn< T1, T2, OpLeftShift >::Type_t > Type_t
Definition qdp_outer.h:1378
OLattice< typename BinaryReturn< T1, T2, OpNE >::Type_t > Type_t
Definition qdp_outer.h:1363
OLattice< typename BinaryReturn< T1, T2, OpOr >::Type_t > Type_t
Definition qdp_outer.h:1373
OLattice< typename BinaryReturn< T1, T2, OpRightShift >::Type_t > Type_t
Definition qdp_outer.h:1383
OLattice< typename BinaryReturn< T1, T2, Op >::Type_t > Type_t
Definition qdp_outer.h:659
OScalar< typename BinaryReturn< T1, T2, FnInnerProductReal >::Type_t > Type_t
Definition qdp_outer.h:755
OScalar< typename BinaryReturn< T1, T2, FnInnerProduct >::Type_t > Type_t
Definition qdp_outer.h:750
OScalar< typename BinaryReturn< T1, T2, FnLocalColorInnerProduct >::Type_t > Type_t
Definition qdp_outer.h:775
OScalar< typename BinaryReturn< T1, T2, FnLocalInnerProductReal >::Type_t > Type_t
Definition qdp_outer.h:770
OScalar< typename BinaryReturn< T1, T2, FnLocalInnerProduct >::Type_t > Type_t
Definition qdp_outer.h:765
OScalar< typename BinaryReturn< T1, T2, OpAddAssign >::Type_t > & Type_t
Definition qdp_outer.h:891
OScalar< typename BinaryReturn< T1, T2, OpAnd >::Type_t > Type_t
Definition qdp_outer.h:870
OScalar< typename BinaryReturn< T1, T2, OpBitwiseAndAssign >::Type_t > & Type_t
Definition qdp_outer.h:921
OScalar< typename BinaryReturn< T1, T2, OpBitwiseOrAssign >::Type_t > & Type_t
Definition qdp_outer.h:916
OScalar< typename BinaryReturn< T1, T2, OpBitwiseXorAssign >::Type_t > & Type_t
Definition qdp_outer.h:926
OScalar< typename BinaryReturn< T1, T2, OpDivideAssign >::Type_t > & Type_t
Definition qdp_outer.h:906
OScalar< typename BinaryReturn< T1, T2, OpEQ >::Type_t > Type_t
Definition qdp_outer.h:860
OScalar< typename BinaryReturn< T1, T2, OpGE >::Type_t > Type_t
Definition qdp_outer.h:855
OScalar< typename BinaryReturn< T1, T2, OpGT >::Type_t > Type_t
Definition qdp_outer.h:850
OScalar< typename BinaryReturn< T1, T2, OpLE >::Type_t > Type_t
Definition qdp_outer.h:845
OScalar< typename BinaryReturn< T1, T2, OpLT >::Type_t > Type_t
Definition qdp_outer.h:840
OScalar< typename BinaryReturn< T1, T2, OpLeftShiftAssign >::Type_t > & Type_t
Definition qdp_outer.h:931
OScalar< typename BinaryReturn< T1, T2, OpLeftShift >::Type_t > Type_t
Definition qdp_outer.h:880
OScalar< typename BinaryReturn< T1, T2, OpModAssign >::Type_t > & Type_t
Definition qdp_outer.h:911
OScalar< typename BinaryReturn< T1, T2, OpMultiplyAssign >::Type_t > & Type_t
Definition qdp_outer.h:901
OScalar< typename BinaryReturn< T1, T2, OpNE >::Type_t > Type_t
Definition qdp_outer.h:865
OScalar< typename BinaryReturn< T1, T2, OpOr >::Type_t > Type_t
Definition qdp_outer.h:875
OScalar< typename BinaryReturn< T1, T2, OpRightShiftAssign >::Type_t > & Type_t
Definition qdp_outer.h:936
OScalar< typename BinaryReturn< T1, T2, OpRightShift >::Type_t > Type_t
Definition qdp_outer.h:885
OScalar< typename BinaryReturn< T1, T2, OpSubtractAssign >::Type_t > & Type_t
Definition qdp_outer.h:896
OScalar< typename BinaryReturn< T1, T2, Op >::Type_t > Type_t
Definition qdp_outer.h:639
OScalar< typename UnaryReturn< T2, OpUnaryPlus >::Type_t > Type_t
Definition qdp_outer.h:808
OScalar< typename UnaryReturn< T2, OpUnaryPlus >::Type_t > Type_t
Definition qdp_outer.h:787
OScalar< typename UnaryReturn< T2, OpUnaryPlus >::Type_t > Type_t
Definition qdp_outer.h:818
OScalar< typename UnaryReturn< T2, OpUnaryPlus >::Type_t > Type_t
Definition qdp_outer.h:797
Reference< OLattice< T > > Leaf_t
Definition qdp_outer.h:491
static Leaf_t make(const OLattice< T > &a)
Definition qdp_outer.h:493
static Leaf_t make(const OScalar< T > &a)
Definition qdp_outer.h:484
Reference< OScalar< T > > Leaf_t
Definition qdp_outer.h:482
Scalar< T > Leaf_t
Definition qdp.h:97
OLattice< typename DoublePrecType< T >::Type_t > Type_t
Definition qdp_outer.h:568
OScalar< typename DoublePrecType< T >::Type_t > Type_t
Definition qdp_outer.h:556
int val1() const
Definition qdp.h:97
OScalar< typename InternalScalar< T >::Type_t > Type_t
Definition qdp_outer.h:579
OScalar< typename InternalScalar< T >::Type_t > Type_t
Definition qdp_outer.h:574
Construct simple word type used at some level within primitives.
Definition qdp_traits.h:98
OScalar< typename LatticeScalar< T >::Type_t > Type_t
Definition qdp_outer.h:603
OScalar< typename LatticeScalar< T >::Type_t > Type_t
Definition qdp_outer.h:598
Makes a lattice scalar leaving primitive indices alone.
Definition qdp_traits.h:108
static Type_t apply(const OLattice< T > &a, const EvalLeaf1 &f)
Definition qdp_outer.h:525
static Type_t apply(const OScalar< T > &a, const ElemLeaf &f)
Definition qdp_outer.h:507
static Type_t apply(const OScalar< T > &a, const EvalLeaf1 &f)
Definition qdp_outer.h:516
OLattice< typename PrimitiveScalar< T >::Type_t > Type_t
Definition qdp_outer.h:591
OScalar< typename PrimitiveScalar< T >::Type_t > Type_t
Definition qdp_outer.h:586
Makes a primitive scalar leaving grid alone.
Definition qdp_traits.h:103
OScalar< typename RealScalar< T >::Type_t > Type_t
Definition qdp_outer.h:615
OScalar< typename RealScalar< T >::Type_t > Type_t
Definition qdp_outer.h:610
Construct simple word type used at some level within primitives.
Definition qdp_traits.h:113
OLattice< typename SinglePrecType< T >::Type_t > Type_t
Definition qdp_outer.h:562
OScalar< typename SinglePrecType< T >::Type_t > Type_t
Definition qdp_outer.h:550
OLattice< typename TrinaryReturn< T1, T2, T3, FnColorContract >::Type_t > Type_t
Definition qdp_outer.h:1175
OLattice< typename TrinaryReturn< T1, T2, T3, Op >::Type_t > Type_t
Definition qdp_outer.h:672
OLattice< typename TrinaryReturn< T1, T2, T3, Op >::Type_t > Type_t
Definition qdp_outer.h:685
OLattice< typename TrinaryReturn< T1, T2, T3, Op >::Type_t > Type_t
Definition qdp_outer.h:679
OLattice< typename TrinaryReturn< T1, T2, T3, Op >::Type_t > Type_t
Definition qdp_outer.h:710
OLattice< typename TrinaryReturn< T1, T2, T3, Op >::Type_t > Type_t
Definition qdp_outer.h:691
OLattice< typename TrinaryReturn< T1, T2, T3, Op >::Type_t > Type_t
Definition qdp_outer.h:704
OLattice< typename TrinaryReturn< T1, T2, T3, Op >::Type_t > Type_t
Definition qdp_outer.h:698
OScalar< typename TrinaryReturn< T1, T2, T3, FnColorContract >::Type_t > Type_t
Definition qdp_outer.h:941
OScalar< typename BinaryReturn< T2, T3, Op >::Type_t > Type_t
Definition qdp_outer.h:647
OLattice< typename UnaryReturn< T1, Op >::Type_t > Type_t
Definition qdp_outer.h:633
OScalar< typename UnaryReturn< T, FnGetSite >::Type_t > Type_t
Definition qdp_outer.h:948
OScalar< typename UnaryReturn< T, FnGlobalMax >::Type_t > Type_t
Definition qdp_outer.h:963
OScalar< typename UnaryReturn< T, FnGlobalMin >::Type_t > Type_t
Definition qdp_outer.h:968
OLattice< typename UnaryReturn< T, FnLocalNorm2 >::Type_t > Type_t
Definition qdp_outer.h:993
OScalar< typename UnaryReturn< T, FnNorm2 >::Type_t > Type_t
Definition qdp_outer.h:978
OScalar< typename UnaryReturn< T, FnPeekSite >::Type_t > Type_t
Definition qdp_outer.h:953
multi1d< OScalar< typename UnaryReturn< T, FnSumMulti >::Type_t > > Type_t
Definition qdp_outer.h:973
OScalar< typename UnaryReturn< T, FnSum >::Type_t > Type_t
Definition qdp_outer.h:958
OLattice< typename UnaryReturn< T, OpNot >::Type_t > Type_t
Definition qdp_outer.h:1060
OScalar< typename UnaryReturn< T1, Op >::Type_t > Type_t
Definition qdp_outer.h:627
OScalar< typename UnaryReturn< T, FnGetSite >::Type_t > Type_t
Definition qdp_outer.h:1409
OScalar< typename UnaryReturn< T, FnGlobalMax >::Type_t > Type_t
Definition qdp_outer.h:740
OScalar< typename UnaryReturn< T, FnGlobalMin >::Type_t > Type_t
Definition qdp_outer.h:745
OScalar< typename UnaryReturn< T, FnLocalNorm2 >::Type_t > Type_t
Definition qdp_outer.h:760
OScalar< typename UnaryReturn< T, FnNorm2 >::Type_t > Type_t
Definition qdp_outer.h:735
OScalar< typename UnaryReturn< T, FnPeekSite >::Type_t > Type_t
Definition qdp_outer.h:720
multi1d< OScalar< typename UnaryReturn< T, FnSumMulti >::Type_t > > Type_t
Definition qdp_outer.h:730
OScalar< typename UnaryReturn< T, FnSum >::Type_t > Type_t
Definition qdp_outer.h:725
OScalar< typename UnaryReturn< T, OpNot >::Type_t > Type_t
Definition qdp_outer.h:826
WordType< T >::Type_t Type_t
Definition qdp_outer.h:544
WordType< T >::Type_t Type_t
Definition qdp_outer.h:538
Find the underlying word type of a field.
Definition qdp_traits.h:29
Simple zero tag.
Definition qdp_traits.h:122