QDP++
qdp_inner.h
Go to the documentation of this file.
1// -*- C++ -*-
2
6
7#ifndef QDP_INNER_H
8#define QDP_INNER_H
9
10namespace QDP {
11
12//-------------------------------------------------------------------------------------
21
23
24template<class T> class IScalar
25{
26public:
29
30 //---------------------------------------------------------
32 IScalar(const typename WordType<T>::Type_t& rhs) : F(rhs) {}
33
35 template<class T1>
36 IScalar(const IScalar<T1>& rhs) : F(rhs.elem()) {}
37
39 template<class T1>
40 IScalar(const T1& rhs) : F(rhs) {}
41
42 //---------------------------------------------------------
43#if 0
45
46 inline
47 IScalar& operator=(const typename WordType<T>::Type_t& rhs)
48 {
49 elem() = rhs;
50 return *this;
51 }
52#endif
53
55
56 template<class T1>
57 inline
59 {
60 elem() = rhs.elem();
61 return *this;
62 }
63
65 template<class T1>
66 inline
68 {
69 elem() += rhs.elem();
70 return *this;
71 }
72
74 template<class T1>
75 inline
77 {
78 elem() -= rhs.elem();
79 return *this;
80 }
81
83 template<class T1>
84 inline
86 {
87 elem() *= rhs.elem();
88 return *this;
89 }
90
92 template<class T1>
93 inline
95 {
96 elem() /= rhs.elem();
97 return *this;
98 }
99
101 template<class T1>
102 inline
104 {
105 elem() %= rhs.elem();
106 return *this;
107 }
108
110 template<class T1>
111 inline
113 {
114 elem() |= rhs.elem();
115 return *this;
116 }
117
119 template<class T1>
120 inline
122 {
123 elem() &= rhs.elem();
124 return *this;
125 }
126
128 template<class T1>
129 inline
131 {
132 elem() ^= rhs.elem();
133 return *this;
134 }
135
137 template<class T1>
138 inline
140 {
141 elem() <<= rhs.elem();
142 return *this;
143 }
144
146 template<class T1>
147 inline
149 {
150 elem() >>= rhs.elem();
151 return *this;
152 }
153
155 IScalar(const IScalar& a): F(a.F) {/* fprintf(stderr,"copy IScalar\n"); */}
156
157public:
158 T& elem() {return F;}
159 const T& elem() const {return F;}
160
161private:
162 T F;
163};
164
165
166
167// Input
169template<class T>
170inline
171std::istream& operator>>(std::istream& s, IScalar<T>& d)
172{
173 s >> d.elem();
174 return s;
175}
176
178template<class T>
180{
181 return is >> d.elem();
182}
183
185template<class T>
186inline
187std::ostream& operator<<(std::ostream& s, const IScalar<T>& d)
188{
189 return s << d.elem();
190}
191
193template<class T>
195{
196 return os << d.elem();
197}
198
199
201template<class T>
202inline
204{
205 return s >> d.elem();
206}
207
209template<class T>
210inline
212{
213 return s << d.elem();
214}
215
216#ifdef QDP_USE_LIBXML2
218template<class T>
219inline
220XMLWriter& operator<<(XMLWriter& xml, const IScalar<T>& d)
221{
222 return xml << d.elem();
223}
224
226template<class T>
227inline
228void read(XMLReader& xml, const std::string& path, IScalar<T>& d)
229{
230 read(xml, path, d.elem());
231}
232#endif
233 // end of group iscalar
235
236
237
238
239//-------------------------------------------------------------------------------------
241
249template<class T, int N> class ILattice
250{
251public:
254
255 //---------------------------------------------------------
257 ILattice(const typename WordType<T>::Type_t& rhs)
258 {
259 for(int i=0; i < N; ++i)
260 elem(i) = rhs;
261 }
262
264 template<class T1>
266 {
267 for(int i=0; i < N; ++i)
268 elem(i) = rhs.elem();
269 }
270
272 template<class T1>
274 {
275 for(int i=0; i < N; ++i)
276 elem(i) = rhs.elem(i);
277 }
278
280 template<class T1>
281 ILattice(const T1& rhs)
282 {
283 for(int i=0; i < N; ++i)
284 elem(i) = rhs;
285 }
286
287 //---------------------------------------------------------
288#if 0
290
291 inline
292 ILattice& operator=(const typename WordType<T>::Type_t& rhs)
293 {
294 for(int i=0; i < N; ++i)
295 elem(i) = rhs;
296
297 return *this;
298 }
299#endif
300
301 //---------------------------------------------------------
303
304 template<class T1>
305 inline
307 {
308 for(int i=0; i < N; ++i)
309 elem(i) = rhs.elem();
310
311 return *this;
312 }
313
315 template<class T1>
316 inline
318 {
319 for(int i=0; i < N; ++i)
320 elem(i) += rhs.elem();
321
322 return *this;
323 }
324
326 template<class T1>
327 inline
329 {
330 for(int i=0; i < N; ++i)
331 elem(i) -= rhs.elem();
332
333 return *this;
334 }
335
337 template<class T1>
338 inline
340 {
341 for(int i=0; i < N; ++i)
342 elem(i) *= rhs.elem();
343
344 return *this;
345 }
346
348 template<class T1>
349 inline
351 {
352 for(int i=0; i < N; ++i)
353 elem(i) /= rhs.elem();
354
355 return *this;
356 }
357
359 template<class T1>
360 inline
362 {
363 for(int i=0; i < N; ++i)
364 elem(i) %= rhs.elem();
365
366 return *this;
367 }
368
370 template<class T1>
371 inline
373 {
374 for(int i=0; i < N; ++i)
375 elem(i) |= rhs.elem();
376
377 return *this;
378 }
379
381 template<class T1>
382 inline
384 {
385 for(int i=0; i < N; ++i)
386 elem(i) &= rhs.elem();
387
388 return *this;
389 }
390
392 template<class T1>
393 inline
395 {
396 for(int i=0; i < N; ++i)
397 elem(i) ^= rhs.elem();
398
399 return *this;
400 }
401
403 template<class T1>
404 inline
406 {
407 for(int i=0; i < N; ++i)
408 elem(i) <<= rhs.elem();
409
410 return *this;
411 }
412
414 template<class T1>
415 inline
417 {
418 for(int i=0; i < N; ++i)
419 elem(i) >>= rhs.elem();
420
421 return *this;
422 }
423
424 //---------------------------------------------------------
426
427 template<class T1>
428 inline
430 {
431 for(int i=0; i < N; ++i)
432 elem(i) = rhs.elem(i);
433
434 return *this;
435 }
436
438 template<class T1>
439 inline
441 {
442 for(int i=0; i < N; ++i)
443 elem(i) += rhs.elem(i);
444
445 return *this;
446 }
447
449 template<class T1>
450 inline
452 {
453 for(int i=0; i < N; ++i)
454 elem(i) -= rhs.elem(i);
455
456 return *this;
457 }
458
460 template<class T1>
461 inline
463 {
464 for(int i=0; i < N; ++i)
465 elem(i) *= rhs.elem(i);
466
467 return *this;
468 }
469
471 template<class T1>
472 inline
474 {
475 for(int i=0; i < N; ++i)
476 elem(i) /= rhs.elem(i);
477
478 return *this;
479 }
480
482 template<class T1>
483 inline
485 {
486 for(int i=0; i < N; ++i)
487 elem(i) %= rhs.elem(i);
488
489 return *this;
490 }
491
493 template<class T1>
494 inline
496 {
497 for(int i=0; i < N; ++i)
498 elem(i) |= rhs.elem(i);
499
500 return *this;
501 }
502
504 template<class T1>
505 inline
507 {
508 for(int i=0; i < N; ++i)
509 elem(i) &= rhs.elem(i);
510
511 return *this;
512 }
513
515 template<class T1>
516 inline
518 {
519 for(int i=0; i < N; ++i)
520 elem(i) ^= rhs.elem(i);
521
522 return *this;
523 }
524
526 template<class T1>
527 inline
529 {
530 for(int i=0; i < N; ++i)
531 elem(i) <<= rhs.elem(i);
532
533 return *this;
534 }
535
537 template<class T1>
538 inline
540 {
541 for(int i=0; i < N; ++i)
542 elem(i) >>= rhs.elem(i);
543
544 return *this;
545 }
546
547#if 0
548 // NOTE: intentially avoid defining a copy constructor - let the compiler
549 // generate one via the bit copy mechanism. This effectively achieves
550 // the first form of the if below (QDP_USE_ARRAY_INITIALIZER) without having
551 // to use that syntax which is not strictly legal in C++.
552#endif
553
555#if defined(QDP_USE_ARRAY_INITIALIZER)
556 ILattice(const ILattice& a) : F(a.F) {}
557#else
560 {
561 // fprintf(stderr,"copy ILattice\n");
562 for(int i=0; i < N; ++i)
563 F[i] = a.F[i];
564 }
565#endif
566
567public:
569
573 inline T* data() {return F;}
574
575
576public:
577 T& elem(int i) {return F[i];}
578 const T& elem(int i) const {return F[i];}
579
580private:
582 T F[N];
583
584};
585
586
587
589template<class T, int N>
590inline
591std::istream& operator>>(std::istream& s, ILattice<T,N>& d)
592{
593 for(int i=0; i < N; ++i)
594 s >> d.elem(i);
595
596 return s;
597}
598
600template<class T, int N>
601inline
602std::ostream& operator<<(std::ostream& s, const ILattice<T,N>& d)
603{
604 for(int i=0; i < N; ++i)
605 s << d.elem(i) << "\n";
606 return s;
607}
608
609
611template<class T, int N>
612inline
614{
615 for(int i=0; i < N; ++i)
616 s >> d.elem(i);
617 return s;
618}
619
621template<class T, int N>
622inline
624{
625 for(int i=0; i < N; ++i)
626 s << d.elem(i) << "\n";
627 return s;
628}
629
630 // end of group ilattice
632
633
634//-----------------------------------------------------------------------------
635// Traits classes to support operations of simple scalars (floating constants,
636// etc.) on QDPTypes
637//-----------------------------------------------------------------------------
638
639template<class T>
640struct WordType<IScalar<T> >
641{
642 typedef typename WordType<T>::Type_t Type_t;
643};
644
645
646template<class T, int N>
647struct WordType<ILattice<T,N> >
648{
649 typedef typename WordType<T>::Type_t Type_t;
650};
651
652// Get the fixed single precision version of this Type (recursively)
653template<class T>
658
659// Get the fixed single precision version of this Type (recursively)
660template<class T, int N>
665
666// Get the fixed double precision version of this Type (recursively)
667template<class T>
672
673// Get the fixed double precision version of this Type (recursively)
674template<class T, int N>
679
680
681// Internally used scalars
682template<class T>
686
687template<class T, int N>
691
692
693// Trait to make a primitive scalar leaving grid along
694template<class T>
698
699template<class T, int N>
703
704
705// Trait to make a lattice scalar leaving other indices alone
706template<class T>
710
711template<class T, int N>
715
716
717// Internally used real scalars
718template<class T>
722
723template<class T, int N>
727
728
729
730//-----------------------------------------------------------------------------
731// Traits classes to support return types
732//-----------------------------------------------------------------------------
733
734// Default unary(IScalar) -> IScalar
735template<class T1, class Op>
739
740// Default unary(ILattice) -> ILattice
741template<class T1, int N, class Op>
745
746// Default binary(IScalar,IScalar) -> IScalar
747template<class T1, class T2, class Op>
751
752// Currently, the only trinary operator is ``where'', so return
753// based on T2 and T3
754// Default trinary(IScalar,IScalar,IScalar) -> IScalar
755template<class T1, class T2, class T3, class Op>
759
760// Default binary(ILattice,ILattice) -> ILattice
761template<class T1, class T2, int N, class Op>
765
766// Default binary(IScalar,ILattice) -> ILattice
767template<class T1, class T2, int N, class Op>
771
772// Default binary(ILattice,IScalar) -> ILattice
773template<class T1, class T2, int N, class Op>
777
778
779// Currently, the only trinary operator is ``where'', so return
780// based on T2 and T3
781
782// Default trinary(ILattice,ILattice,ILattice) -> ILattice
783template<class T1, class T2, class T3, int N, class Op>
787
788
789// Default trinary(ILattice,IScalar,ILattice) -> ILattice
790template<class T1, class T2, class T3, int N, class Op>
794
795// Default trinary(ILattice,ILattice,IScalar) -> ILattice
796template<class T1, class T2, class T3, int N, class Op>
800
801// Default trinary(IScalar,ILattice,ILattice) -> ILattice
802template<class T1, class T2, class T3, int N, class Op>
806
807
808// Default trinary(IScalar,IScalar,ILattice) -> ILattice
809template<class T1, class T2, class T3, int N, class Op>
813
814// Default trinary(OSscalar,ILattice,IScalar) -> ILattice
815template<class T1, class T2, class T3, int N, class Op>
819
820// Default trinary(ILattice,IScalar,IScalar) -> ILattice
821template<class T1, class T2, class T3, int N, class Op>
825
826
827
828
829// Specific IScalar cases
830// Global operations
831template<class T>
835
836
837// Gamma algebra
838template<int N, int m, class T2, class OpGammaConstMultiply>
842
843template<class T2, int N, int m, class OpMultiplyGammaConst>
847
848template<class T2, int N, class OpGammaTypeMultiply>
852
853template<class T2, int N, class OpMultiplyGammaType>
857
858
859// Gamma algebra
860template<int N, int m, class T2, class OpGammaConstDPMultiply>
864
865template<class T2, int N, int m, class OpMultiplyGammaConstDP>
869
870template<class T2, int N, class OpGammaTypeDPMultiply>
874
875template<class T2, int N, class OpMultiplyGammaTypeDP>
879
880
881
882// Local operations
883
884#if 0
885template<class T1, class T2>
886struct UnaryReturn<IScalar<T2>, OpCast<T1> > {
888// typedef T1 Type_t;
889};
890#endif
891
892template<class T1, class T2>
896
897template<class T1, class T2>
901
902template<class T1, class T2>
906
907template<class T1, class T2>
911
912template<class T1, class T2>
916
917template<class T1, class T2>
921
922template<class T1, class T2>
926
927template<class T1, class T2>
931
932template<class T1, class T2>
936
937template<class T1, class T2>
941
942template<class T1, class T2, class T3>
946
947// Specific ILattice cases
948// Global operations
949template<class T, int N>
953
954
955// Gamma algebra
956template<int M, int m, class T2, int N, class OpGammaConstMultiply>
960
961template<class T2, int N, int M, int m, class OpMultiplyGammaConst>
965
966template<int M, class T2, int N, class OpGammaTypeMultiply>
970
971template<class T2, int N, int M, class OpMultiplyGammaType>
975
976
977
978// Local operations
979template<class T, int N>
983
984
985#if 0
986template<class T1, class T2, int N>
987struct UnaryReturn<ILattice<T2,N>, OpCast<T1>> {
989// typedef T1 Type_t;
990};
991#endif
992
993template<class T1, class T2, int N>
997
998template<class T1, class T2, int N>
1002
1003template<class T1, class T2, int N>
1007
1008template<class T1, class T2, int N>
1012
1013template<class T1, class T2, int N>
1017
1018template<class T1, class T2, int N>
1022
1023template<class T1, class T2, int N>
1027
1028template<class T1, class T2, int N>
1032
1033template<class T1, class T2, int N>
1037
1038template<class T1, class T2, int N>
1042
1043template<class T1, class T2, class T3, int N>
1047
1048
1049// Mixed ILattice & IScalar cases
1050// Global operations
1051template<class T, int N>
1055
1056// Local operations
1057template<class T1, class T2, int N>
1061
1062template<class T1, class T2, int N>
1066
1067template<class T1, class T2, int N>
1071
1072template<class T1, class T2, int N>
1076
1077template<class T1, class T2, int N>
1081
1082template<class T1, class T2, int N>
1086
1087template<class T1, class T2, int N>
1091
1092template<class T1, class T2, int N>
1096
1097template<class T1, class T2, int N>
1101
1102template<class T1, class T2, int N>
1106
1107
1108
1109
1110//-----------------------------------------------------------------------------
1111// Inner-grid scalar operations
1112//-----------------------------------------------------------------------------
1113
1116
1117// Inner grid scalar
1118
1119// ! IScalar
1120template<class T>
1124
1125template<class T1>
1126inline typename UnaryReturn<IScalar<T1>, OpNot>::Type_t
1128{
1129 return ! l.elem();
1130}
1131
1132
1133// +IScalar
1134template<class T1>
1137{
1138 return +l.elem();
1139}
1140
1141
1142// -IScalar
1143template<class T1>
1146{
1147 return -l.elem();
1148}
1149
1150
1151// IScalar + IScalar
1152template<class T1, class T2>
1153inline typename BinaryReturn<IScalar<T1>, IScalar<T2>, OpAdd>::Type_t
1155{
1156 return l.elem()+r.elem();
1157}
1158
1159
1160// IScalar - IScalar
1161template<class T1, class T2>
1162inline typename BinaryReturn<IScalar<T1>, IScalar<T2>, OpSubtract>::Type_t
1164{
1165 return l.elem() - r.elem();
1166}
1167
1168
1169// IScalar * IScalar
1170template<class T1, class T2>
1171inline typename BinaryReturn<IScalar<T1>, IScalar<T2>, OpMultiply>::Type_t
1173{
1174 return l.elem() * r.elem();
1175}
1176
1177// Optimized adj(IScalar)*IScalar
1178template<class T1, class T2>
1179inline typename BinaryReturn<IScalar<T1>, IScalar<T2>, OpAdjMultiply>::Type_t
1181{
1182 // Do not pass on the transpose or the conj
1183 return l.elem() * r.elem();
1184}
1185
1186// Optimized IScalar*adj(IScalar)
1187template<class T1, class T2>
1188inline typename BinaryReturn<IScalar<T1>, IScalar<T2>, OpMultiplyAdj>::Type_t
1190{
1191 // Do not pass on the transpose or the conj
1192 return l.elem() * r.elem();
1193}
1194
1195// Optimized adj(IScalar)*adj(IScalar)
1196template<class T1, class T2>
1197inline typename BinaryReturn<IScalar<T1>, IScalar<T2>, OpAdjMultiplyAdj>::Type_t
1199{
1200 // Do not pass on the transpose or the conj
1201 return l.elem() * r.elem();
1202}
1203
1204
1205// IScalar / IScalar
1206template<class T1, class T2>
1207inline typename BinaryReturn<IScalar<T1>, IScalar<T2>, OpDivide>::Type_t
1209{
1210 return l.elem() / r.elem();
1211}
1212
1213
1214// IScalar << IScalar
1215template<class T1, class T2>
1219
1220template<class T1, class T2>
1222operator<<(const IScalar<T1>& l, const IScalar<T2>& r)
1223{
1224 return l.elem() << r.elem();
1225}
1226
1227
1228// IScalar >> IScalar
1229template<class T1, class T2>
1233
1234
1235template<class T1, class T2>
1238{
1239 return l.elem() >> r.elem();
1240}
1241
1242
1243// IScalar % IScalar
1244template<class T1, class T2>
1245inline typename BinaryReturn<IScalar<T1>, IScalar<T2>, OpMod>::Type_t
1247{
1248 return l.elem() % r.elem();
1249}
1250
1251
1252// IScalar ^ IScalar
1253template<class T1, class T2>
1254inline typename BinaryReturn<IScalar<T1>, IScalar<T2>, OpBitwiseXor>::Type_t
1256{
1257 return l.elem() ^ r.elem();
1258}
1259
1260
1261// IScalar & IScalar
1262template<class T1, class T2>
1263inline typename BinaryReturn<IScalar<T1>, IScalar<T2>, OpBitwiseAnd>::Type_t
1265{
1266 return l.elem() & r.elem();
1267}
1268
1269
1270// IScalar | IScalar
1271template<class T1, class T2>
1272inline typename BinaryReturn<IScalar<T1>, IScalar<T2>, OpBitwiseOr>::Type_t
1274{
1275 return l.elem() | r.elem();
1276}
1277
1278
1279
1280// Comparisons
1281
1282// IScalar < IScalar
1283template<class T1, class T2>
1287
1288template<class T1, class T2>
1290operator<(const IScalar<T1>& l, const IScalar<T2>& r)
1291{
1292 return l.elem() < r.elem();
1293}
1294
1295
1296// IScalar <= IScalar
1297template<class T1, class T2>
1301
1302template<class T1, class T2>
1304operator<=(const IScalar<T1>& l, const IScalar<T2>& r)
1305{
1306 return l.elem() <= r.elem();
1307}
1308
1309
1310// IScalar > IScalar
1311template<class T1, class T2>
1315
1316template<class T1, class T2>
1319{
1320 return l.elem() > r.elem();
1321}
1322
1323
1324// IScalar >= IScalar
1325template<class T1, class T2>
1329
1330template<class T1, class T2>
1333{
1334 return l.elem() >= r.elem();
1335}
1336
1337
1338// IScalar == IScalar
1339template<class T1, class T2>
1343
1344template<class T1, class T2>
1347{
1348 return l.elem() == r.elem();
1349}
1350
1351
1352// IScalar != IScalar
1353template<class T1, class T2>
1357
1358template<class T1, class T2>
1361{
1362 return l.elem() != r.elem();
1363}
1364
1365
1366// IScalar && IScalar
1367template<class T1, class T2>
1371
1372template<class T1, class T2>
1375{
1376 return l.elem() && r.elem();
1377}
1378
1379
1380// IScalar || IScalar
1381template<class T1, class T2>
1385
1386template<class T1, class T2>
1389{
1390 return l.elem() || r.elem();
1391}
1392
1393
1394
1395//-----------------------------------------------------------------------------
1396// Functions
1397
1398// IScalar = adj(IScalar)
1399template<class T1>
1402{
1403 return adj(s1.elem());
1404}
1405
1406
1407// IScalar = conj(IScalar)
1408template<class T1>
1411{
1412 return conj(s1.elem());
1413}
1414
1415
1416// IScalar = transpose(IScalar)
1417template<class T1>
1420{
1421 return transpose(s1.elem());
1422}
1423
1424
1425// IScalar = Trace(IScalar)
1426template<class T1>
1429{
1430 return trace(s1.elem());
1431}
1432
1433
1434// IScalar = Re(Trace(IScalar))
1435template<class T1>
1438{
1439 return trace_real(s1.elem());
1440}
1441
1442
1443// IScalar = Im(Trace(IScalar))
1444template<class T1>
1447{
1448 return trace_imag(s1.elem());
1449}
1450
1451
1452// IScalar = Re(IScalar)
1453template<class T1>
1456{
1457 return real(s1.elem());
1458}
1459
1460
1461// IScalar = Im(IScalar)
1462template<class T1>
1465{
1466 return imag(s1.elem());
1467}
1468
1469
1470// ArcCos
1471template<class T1>
1474{
1475 return acos(s1.elem());
1476}
1477
1478
1479// ArcSin
1480template<class T1>
1483{
1484 return asin(s1.elem());
1485}
1486
1487
1488// ArcTan
1489template<class T1>
1492{
1493 return atan(s1.elem());
1494}
1495
1496
1497// Cos
1498template<class T1>
1499inline typename UnaryReturn<IScalar<T1>, FnCos>::Type_t
1501{
1502 return cos(s1.elem());
1503}
1504
1505
1506// Exp
1507template<class T1>
1508inline typename UnaryReturn<IScalar<T1>, FnExp>::Type_t
1510{
1511 return exp(s1.elem());
1512}
1513
1514
1515// Fabs
1516template<class T1>
1519{
1520 return fabs(s1.elem());
1521}
1522
1523
1524// Log
1525template<class T1>
1526inline typename UnaryReturn<IScalar<T1>, FnLog>::Type_t
1528{
1529 return log(s1.elem());
1530}
1531
1532
1533// Sin
1534template<class T1>
1535inline typename UnaryReturn<IScalar<T1>, FnSin>::Type_t
1537{
1538 return sin(s1.elem());
1539}
1540
1541
1542// Sqrt
1543template<class T1>
1546{
1547 return sqrt(s1.elem());
1548}
1549
1550
1551// Tan
1552template<class T1>
1553inline typename UnaryReturn<IScalar<T1>, FnTan>::Type_t
1555{
1556 return tan(s1.elem());
1557}
1558
1559
1561template<class T1, class T2>
1562inline typename BinaryReturn<IScalar<T1>, IScalar<T2>, FnPow>::Type_t
1563pow(const IScalar<T1>& s1, const IScalar<T2>& s2)
1564{
1565 return pow(s1.elem(), s2.elem());
1566}
1567
1568
1570template<class T1, class T2>
1571inline typename BinaryReturn<IScalar<T1>, IScalar<T2>, FnArcTan2>::Type_t
1572atan2(const IScalar<T1>& s1, const IScalar<T2>& s2)
1573{
1574 return atan2(s1.elem(), s2.elem());
1575}
1576
1577
1579template<class T1>
1582{
1583 return seedToFloat(s1.elem());
1584}
1585
1586
1588template<class T1, class T2>
1589inline typename BinaryReturn<IScalar<T1>, IScalar<T2>, FnOuterProduct>::Type_t
1591{
1592 return outerProduct(l.elem(),r.elem());
1593}
1594
1595
1597
1598template<class T>
1602
1603template<class T>
1605getSite(const IScalar<T>& s1, int innersite)
1606{
1607 return s1.elem();
1608}
1609
1610
1611//-----------------------------------------------------------------------------
1613template<class T>
1614inline int
1616{
1617 return toInt(s.elem());
1618}
1619
1621template<class T>
1622inline float
1624{
1625 return toFloat(s.elem());
1626}
1627
1629template<class T>
1630inline double
1632{
1633 return toDouble(s.elem());
1634}
1635
1637template<class T>
1638inline bool
1640{
1641 return toBool(s.elem());
1642}
1643
1645template<class T>
1646inline WordType<IScalar<T> >
1648{
1649 return toWordType(s.elem());
1650}
1651
1652//------------------------------------------
1654template<class T, class T1>
1655inline
1656void copymask(IScalar<T>& d, const IScalar<T1>& mask, const IScalar<T>& s1)
1657{
1658 copymask(d.elem(),mask.elem(),s1.elem());
1659}
1660
1662template<class T, class T1>
1663inline
1664void cast_rep(T& d, const IScalar<T1>& s1)
1665{
1666 cast_rep(d, s1.elem());
1667}
1668
1669
1671template<class T, class T1>
1672inline
1674{
1675 cast_rep(d.elem(), s1.elem());
1676}
1677
1678
1680template<class T, class T1>
1681inline void
1682copy_site(IScalar<T>& d, int isite, const IScalar<T1>& s1)
1683{
1684 d.elem() = s1.elem();
1685}
1686
1687
1688#if 0
1689// This should never be used and is probably an error if needed
1690
1692template<class T, class T1>
1693inline void
1694gather_sites(IScalar<T>& d,
1695 const IScalar<T1>& s0, int i0,
1696 const IScalar<T1>& s1, int i1,
1697 const IScalar<T1>& s2, int i2,
1698 const IScalar<T1>& s3, int i3)
1699{
1700 gather_sites(d.elem(),
1701 s0.elem(), i0,
1702 s1.elem(), i1,
1703 s2.elem(), i2,
1704 s3.elem(), i3);
1705}
1706#endif
1707
1708
1709//------------------------------------------
1710// Global sum over site indices only
1711template<class T>
1715
1716template<class T>
1717inline typename UnaryReturn<IScalar<T>, FnSum>::Type_t
1718sum(const IScalar<T>& s1)
1719{
1720// return sum(s1.elem());
1721 return s1.elem();
1722}
1723
1724
1725//------------------------------------------
1726// Global max
1727template<class T>
1731
1732template<class T>
1735{
1736// return globalMax(s1.elem());
1737 return s1.elem();
1738}
1739
1740
1741//------------------------------------------
1742// Global min
1743template<class T>
1747
1748template<class T>
1751{
1752// return globalMin(s1.elem());
1753 return s1.elem();
1754}
1755
1756
1757// sumMulti
1758template<class T>
1762
1763// InnerProduct (norm-seq) global sum = sum(tr(adj(s1)*s1))
1764template<class T>
1768
1769template<class T>
1773
1774template<class T>
1777{
1778 return localNorm2(s1.elem());
1779}
1780
1781
1782
1784template<class T1, class T2>
1788
1789template<class T1, class T2>
1793
1794template<class T1, class T2>
1797{
1798 return localInnerProduct(s1.elem(), s2.elem());
1799}
1800
1801
1803template<class T1, class T2>
1807
1808template<class T1, class T2>
1811{
1812 return localColorInnerProduct(s1.elem(), s2.elem());
1813}
1814
1815
1816
1818
1822template<class T1, class T2, class T3>
1826
1827template<class T1, class T2, class T3>
1829where(const IScalar<T1>& a, const IScalar<T2>& b, const IScalar<T3>& c)
1830{
1831 return where(a.elem(), b.elem(), c.elem());
1832}
1833
1834
1835
1836//-----------------------------------------------------------------------------
1837// Broadcast operations
1839template<class T>
1840inline
1842{
1843 zero_rep(dest.elem());
1844}
1845
1846
1847//-----------------------------------------------------------------------------
1848// Random numbers
1850template<class T, class T1, class T2>
1851inline void
1852fill_random(IScalar<T>& d, T1& seed, T2& skewed_seed, const T1& seed_mult)
1853{
1854 fill_random(d.elem(), seed, skewed_seed, seed_mult);
1855}
1856
1857
1859template<class T>
1860inline void
1862{
1863 fill_gaussian(d.elem(), r1.elem(), r2.elem());
1864}
1865
1866 // end of group iscalar
1868
1869//-----------------------------------------------------------------------------
1870// Inner-grid lattice operations
1871//-----------------------------------------------------------------------------
1872
1875
1876// Ilattice operations
1877
1879template<class T1, int N>
1882{
1884
1885 for(int i=0; i < N; ++i)
1886 d.elem(i) = ! l.elem(i);
1887 return d;
1888}
1889
1890
1892template<class T1, int N>
1895{
1897
1898 for(int i=0; i < N; ++i)
1899 d.elem(i) = +l.elem(i);
1900 return d;
1901}
1902
1903
1905template<class T1, int N>
1908{
1910
1911 for(int i=0; i < N; ++i)
1912 d.elem(i) = -l.elem(i);
1913 return d;
1914}
1915
1916
1917// ILattice + ILattice
1918template<class T1, class T2, int N>
1919inline typename BinaryReturn<ILattice<T1,N>, ILattice<T2,N>, OpAdd>::Type_t
1921{
1923
1924 for(int i=0; i < N; ++i)
1925 d.elem(i) = l.elem(i) + r.elem(i);
1926 return d;
1927}
1928
1929// ILattice + IScalar
1930template<class T1, class T2, int N>
1931inline typename BinaryReturn<ILattice<T1,N>, IScalar<T2>, OpAdd>::Type_t
1933{
1935
1936 for(int i=0; i < N; ++i)
1937 d.elem(i) = l.elem(i) + r.elem();
1938 return d;
1939}
1940
1941// IScalar + ILattice
1942template<class T1, class T2, int N>
1943inline typename BinaryReturn<IScalar<T1>, ILattice<T2,N>, OpAdd>::Type_t
1945{
1947
1948 for(int i=0; i < N; ++i)
1949 d.elem(i) = l.elem() + r.elem(i);
1950 return d;
1951}
1952
1953
1954// ILattice - ILattice
1955template<class T1, class T2, int N>
1956inline typename BinaryReturn<ILattice<T1,N>, ILattice<T2,N>, OpSubtract>::Type_t
1958{
1960
1961 for(int i=0; i < N; ++i)
1962 d.elem(i) = l.elem(i) - r.elem(i);
1963 return d;
1964}
1965
1966// ILattice - IScalar
1967template<class T1, class T2, int N>
1968inline typename BinaryReturn<ILattice<T1,N>, IScalar<T2>, OpSubtract>::Type_t
1970{
1972
1973 for(int i=0; i < N; ++i)
1974 d.elem(i) = l.elem(i) - r.elem();
1975 return d;
1976}
1977
1978// IScalar - ILattice
1979template<class T1, class T2, int N>
1980inline typename BinaryReturn<IScalar<T1>, ILattice<T2,N>, OpSubtract>::Type_t
1982{
1984
1985 for(int i=0; i < N; ++i)
1986 d.elem(i) = l.elem() - r.elem(i);
1987 return d;
1988}
1989
1990
1991// ILattice * ILattice
1992template<class T1, class T2, int N>
1993inline typename BinaryReturn<ILattice<T1,N>, ILattice<T2,N>, OpMultiply>::Type_t
1995{
1997
1998 for(int i=0; i < N; ++i)
1999 d.elem(i) = l.elem(i) * r.elem(i);
2000 return d;
2001}
2002
2003// ILattice * IScalar
2004template<class T1, class T2, int N>
2005inline typename BinaryReturn<ILattice<T1,N>, IScalar<T2>, OpMultiply>::Type_t
2007{
2009
2010 for(int i=0; i < N; ++i)
2011 d.elem(i) = l.elem(i) * r.elem();
2012 return d;
2013}
2014
2015// IScalar * ILattice
2016template<class T1, class T2, int N>
2017inline typename BinaryReturn<IScalar<T1>, ILattice<T2,N>, OpMultiply>::Type_t
2019{
2021
2022 for(int i=0; i < N; ++i)
2023 d.elem(i) = l.elem() * r.elem(i);
2024 return d;
2025}
2026
2027
2028// Optimized adj(ILattice)*ILattice
2029template<class T1, class T2, int N>
2030inline typename BinaryReturn<ILattice<T1,N>, ILattice<T2,N>, OpAdjMultiply>::Type_t
2032{
2034
2035 // Do not pass on the transpose or the conj
2036 for(int i=0; i < N; ++i)
2037 d.elem(i) = l.elem(i) * r.elem(i);
2038 return d;
2039}
2040
2041// Optimized adj(ILattice)*IScalar
2042template<class T1, class T2, int N>
2043inline typename BinaryReturn<ILattice<T1,N>, IScalar<T2>, OpAdjMultiply>::Type_t
2045{
2047
2048 // Do not pass on the transpose or the conj
2049 for(int i=0; i < N; ++i)
2050 d.elem(i) = l.elem(i) * r.elem();
2051 return d;
2052}
2053
2054// Optimized adj(IScalar)*ILattice
2055template<class T1, class T2, int N>
2056inline typename BinaryReturn<IScalar<T1>, ILattice<T2,N>, OpAdjMultiply>::Type_t
2058{
2060
2061 // Do not pass on the transpose or the conj
2062 for(int i=0; i < N; ++i)
2063 d.elem(i) = l.elem() * r.elem(i);
2064 return d;
2065}
2066
2067
2068// Optimized ILattice*adj(ILattice)
2069template<class T1, class T2, int N>
2070inline typename BinaryReturn<ILattice<T1,N>, ILattice<T2,N>, OpMultiplyAdj>::Type_t
2072{
2074
2075 // Do not pass on the transpose or the conj
2076 for(int i=0; i < N; ++i)
2077 d.elem(i) = l.elem(i) * r.elem(i);
2078 return d;
2079}
2080
2081// Optimized ILattice*adj(IScalar)
2082template<class T1, class T2, int N>
2083inline typename BinaryReturn<ILattice<T1,N>, IScalar<T2>, OpMultiplyAdj>::Type_t
2085{
2087
2088 // Do not pass on the transpose or the conj
2089 for(int i=0; i < N; ++i)
2090 d.elem(i) = l.elem(i) * r.elem();
2091 return d;
2092}
2093
2094// Optimized IScalar*adj(ILattice)
2095template<class T1, class T2, int N>
2096inline typename BinaryReturn<IScalar<T1>, ILattice<T2,N>, OpMultiplyAdj>::Type_t
2098{
2100
2101 // Do not pass on the transpose or the conj
2102 for(int i=0; i < N; ++i)
2103 d.elem(i) = l.elem() * r.elem(i);
2104 return d;
2105}
2106
2107
2108// Optimized adj(ILattice)*adj(ILattice)
2109template<class T1, class T2, int N>
2110inline typename BinaryReturn<ILattice<T1,N>, ILattice<T2,N>, OpAdjMultiplyAdj>::Type_t
2112{
2114
2115 // Do not pass on the transpose or the conj
2116 for(int i=0; i < N; ++i)
2117 d.elem(i) = l.elem(i) * r.elem(i);
2118 return d;
2119}
2120
2121// Optimized adj(ILattice)*adj(IScalar)
2122template<class T1, class T2, int N>
2123inline typename BinaryReturn<ILattice<T1,N>, IScalar<T2>, OpAdjMultiplyAdj>::Type_t
2125{
2127
2128 // Do not pass on the transpose or the conj
2129 for(int i=0; i < N; ++i)
2130 d.elem(i) = l.elem(i) * r.elem(i);
2131 return d;
2132}
2133
2134// Optimized adj(IScalar)*adj(ILattice)
2135template<class T1, class T2, int N>
2136inline typename BinaryReturn<IScalar<T1>, ILattice<T2,N>, OpAdjMultiplyAdj>::Type_t
2138{
2140
2141 // Do not pass on the transpose or the conj
2142 for(int i=0; i < N; ++i)
2143 d.elem(i) = l.elem(i) * r.elem(i);
2144 return d;
2145}
2146
2147
2148// ILattice / ILattice
2149template<class T1, class T2, int N>
2150inline typename BinaryReturn<ILattice<T1,N>, ILattice<T2,N>, OpDivide>::Type_t
2152{
2154
2155 for(int i=0; i < N; ++i)
2156 d.elem(i) = l.elem(i) / r.elem(i);
2157 return d;
2158}
2159
2160// ILattice / IScalar
2161template<class T1, class T2, int N>
2162inline typename BinaryReturn<ILattice<T1,N>, IScalar<T2>, OpDivide>::Type_t
2164{
2166
2167 for(int i=0; i < N; ++i)
2168 d.elem(i) = l.elem(i) / r.elem();
2169 return d;
2170}
2171
2172// IScalar / ILattice
2173template<class T1, class T2, int N>
2174inline typename BinaryReturn<IScalar<T1>, ILattice<T2,N>, OpDivide>::Type_t
2176{
2178
2179 for(int i=0; i < N; ++i)
2180 d.elem(i) = l.elem() / r.elem(i);
2181 return d;
2182}
2183
2184
2186template<class T1, class T2, int N>
2190
2191template<class T1, class T2, int N>
2193operator<<(const ILattice<T1,N>& l, const ILattice<T2,N>& r)
2194{
2196
2197 for(int i=0; i < N; ++i)
2198 d.elem(i) = l.elem(i) << r.elem(i);
2199 return d;
2200}
2201
2203template<class T1, class T2, int N>
2207
2208template<class T1, class T2, int N>
2210operator<<(const ILattice<T1,N>& l, const IScalar<T2>& r)
2211{
2213
2214 for(int i=0; i < N; ++i)
2215 d.elem(i) = l.elem(i) << r.elem();
2216 return d;
2217}
2218
2220template<class T1, class T2, int N>
2224
2225template<class T1, class T2, int N>
2227operator<<(const IScalar<T1>& l, const ILattice<T2,N>& r)
2228{
2230
2231 for(int i=0; i < N; ++i)
2232 d.elem(i) = l.elem() << r.elem(i);
2233 return d;
2234}
2235
2236
2238template<class T1, class T2, int N>
2242
2243template<class T1, class T2, int N>
2246{
2248
2249 for(int i=0; i < N; ++i)
2250 d.elem(i) = l.elem(i) >> r.elem(i);
2251 return d;
2252}
2253
2254// ILattice >> IScalar
2255template<class T1, class T2, int N>
2259
2260template<class T1, class T2, int N>
2263{
2265
2266 for(int i=0; i < N; ++i)
2267 d.elem(i) = l.elem(i) >> r.elem();
2268 return d;
2269}
2270
2271// IScalar >> ILattice
2272template<class T1, class T2, int N>
2276
2277template<class T1, class T2, int N>
2280{
2282
2283 for(int i=0; i < N; ++i)
2284 d.elem(i) = l.elem() >> r.elem(i);
2285 return d;
2286}
2287
2288
2289// ILattice % ILattice
2290template<class T1, class T2, int N>
2294
2295template<class T1, class T2, int N>
2298{
2300
2301 for(int i=0; i < N; ++i)
2302 d.elem(i) = l.elem(i) % r.elem(i);
2303 return d;
2304}
2305
2306// ILattice % IScalar
2307template<class T1, class T2, int N>
2311
2312template<class T1, class T2, int N>
2315{
2317
2318 for(int i=0; i < N; ++i)
2319 d.elem(i) = l.elem(i) % r.elem();
2320 return d;
2321}
2322
2323// IScalar % ILattice
2324template<class T1, class T2, int N>
2328
2329template<class T1, class T2, int N>
2332{
2334
2335 for(int i=0; i < N; ++i)
2336 d.elem(i) = l.elem() % r.elem(i);
2337 return d;
2338}
2339
2340
2341// ILattice ^ ILattice
2342template<class T1, class T2, int N>
2346
2347template<class T1, class T2, int N>
2350{
2352
2353 for(int i=0; i < N; ++i)
2354 d.elem(i) = l.elem(i) ^ r.elem(i);
2355 return d;
2356}
2357
2358// ILattice ^ IScalar
2359template<class T1, class T2, int N>
2363
2364template<class T1, class T2, int N>
2367{
2369
2370 for(int i=0; i < N; ++i)
2371 d.elem(i) = l.elem(i) ^ r.elem();
2372 return d;
2373}
2374
2375// IScalar ^ ILattice
2376template<class T1, class T2, int N>
2380
2381template<class T1, class T2, int N>
2384{
2386
2387 for(int i=0; i < N; ++i)
2388 d.elem(i) = l.elem() ^ r.elem(i);
2389 return d;
2390}
2391
2392
2393// ILattice & IScalar
2394template<class T1, class T2, int N>
2398
2399template<class T1, class T2, int N>
2402{
2404
2405 for(int i=0; i < N; ++i)
2406 d.elem(i) = l.elem(i) & r.elem(i);
2407 return d;
2408}
2409
2410// ILattice & IScalar
2411template<class T1, class T2, int N>
2415
2416template<class T1, class T2, int N>
2419{
2421
2422 for(int i=0; i < N; ++i)
2423 d.elem(i) = l.elem(i) & r.elem();
2424 return d;
2425}
2426
2427// IScalar & ILattice
2428template<class T1, class T2, int N>
2432
2433template<class T1, class T2, int N>
2436{
2438
2439 for(int i=0; i < N; ++i)
2440 d.elem(i) = l.elem() & r.elem(i);
2441 return d;
2442}
2443
2444
2445// ILattice | IScalar
2446template<class T1, class T2, int N>
2450
2451template<class T1, class T2, int N>
2454{
2456
2457 for(int i=0; i < N; ++i)
2458 d.elem(i) = l.elem(i) | r.elem(i);
2459 return d;
2460}
2461
2462// ILattice | IScalar
2463template<class T1, class T2, int N>
2467
2468template<class T1, class T2, int N>
2471{
2473
2474 for(int i=0; i < N; ++i)
2475 d.elem(i) = l.elem(i) | r.elem();
2476 return d;
2477}
2478
2479// IScalar | ILattice
2480template<class T1, class T2, int N>
2484
2485template<class T1, class T2, int N>
2488{
2490
2491 for(int i=0; i < N; ++i)
2492 d.elem(i) = l.elem() | r.elem(i);
2493 return d;
2494}
2495
2496
2497// Comparisons
2498
2499// ILattice < ILattice
2500template<class T1, class T2, int N>
2504
2505template<class T1, class T2, int N>
2507operator<(const ILattice<T1,N>& l, const ILattice<T2,N>& r)
2508{
2510
2511 for(int i=0; i < N; ++i)
2512 d.elem(i) = l.elem(i) < r.elem(i);
2513 return d;
2514}
2515
2516// ILattice < IScalar
2517template<class T1, class T2, int N>
2521
2522template<class T1, class T2, int N>
2524operator<(const ILattice<T1,N>& l, const IScalar<T2>& r)
2525{
2527
2528 for(int i=0; i < N; ++i)
2529 d.elem(i) = l.elem(i) < r.elem();
2530 return d;
2531}
2532
2533// IScalar < ILattice
2534template<class T1, class T2, int N>
2538
2539template<class T1, class T2, int N>
2541operator<(const IScalar<T1>& l, const ILattice<T2,N>& r)
2542{
2544
2545 for(int i=0; i < N; ++i)
2546 d.elem(i) = l.elem() < r.elem(i);
2547 return d;
2548}
2549
2550
2551// ILattice <= ILattice
2552template<class T1, class T2, int N>
2556
2557template<class T1, class T2, int N>
2559operator<=(const ILattice<T1,N>& l, const ILattice<T2,N>& r)
2560{
2562
2563 for(int i=0; i < N; ++i)
2564 d.elem(i) = l.elem(i) <= r.elem(i);
2565 return d;
2566}
2567
2568// ILattice <= IScalar
2569template<class T1, class T2, int N>
2573
2574template<class T1, class T2, int N>
2576operator<=(const ILattice<T1,N>& l, const IScalar<T2>& r)
2577{
2579
2580 for(int i=0; i < N; ++i)
2581 d.elem(i) = l.elem(i) <= r.elem();
2582 return d;
2583}
2584
2585// IScalar <= ILattice
2586template<class T1, class T2, int N>
2590
2591template<class T1, class T2, int N>
2593operator<=(const IScalar<T1>& l, const ILattice<T2,N>& r)
2594{
2596
2597 for(int i=0; i < N; ++i)
2598 d.elem(i) = l.elem() <= r.elem(i);
2599 return d;
2600}
2601
2602
2603// ILattice > ILattice
2604template<class T1, class T2, int N>
2608
2609template<class T1, class T2, int N>
2612{
2614
2615 for(int i=0; i < N; ++i)
2616 d.elem(i) = l.elem(i) > r.elem(i);
2617 return d;
2618}
2619
2620// ILattice > IScalar
2621template<class T1, class T2, int N>
2625
2626template<class T1, class T2, int N>
2629{
2631
2632 for(int i=0; i < N; ++i)
2633 d.elem(i) = l.elem(i) > r.elem();
2634 return d;
2635}
2636
2637// ILattice > ILattice
2638template<class T1, class T2, int N>
2642
2643template<class T1, class T2, int N>
2646{
2648
2649 for(int i=0; i < N; ++i)
2650 d.elem(i) = l.elem() > r.elem(i);
2651 return d;
2652}
2653
2654
2655
2656// ILattice >= ILattice
2657template<class T1, class T2, int N>
2661
2662template<class T1, class T2, int N>
2665{
2667
2668 for(int i=0; i < N; ++i)
2669 d.elem(i) = l.elem(i) >= r.elem(i);
2670 return d;
2671}
2672
2673// ILattice >= IScalar
2674template<class T1, class T2, int N>
2678
2679template<class T1, class T2, int N>
2682{
2684
2685 for(int i=0; i < N; ++i)
2686 d.elem(i) = l.elem(i) >= r.elem();
2687 return d;
2688}
2689
2690// IScalar >= ILattice
2691template<class T1, class T2, int N>
2695
2696template<class T1, class T2, int N>
2699{
2701
2702 for(int i=0; i < N; ++i)
2703 d.elem(i) = l.elem() >= r.elem(i);
2704 return d;
2705}
2706
2707
2708// ILattice == ILattice
2709template<class T1, class T2, int N>
2713
2714template<class T1, class T2, int N>
2717{
2719
2720 for(int i=0; i < N; ++i)
2721 d.elem(i) = l.elem(i) == r.elem(i);
2722 return d;
2723}
2724
2725// ILattice == IScalar
2726template<class T1, class T2, int N>
2730
2731template<class T1, class T2, int N>
2734{
2736
2737 for(int i=0; i < N; ++i)
2738 d.elem(i) = l.elem(i) == r.elem();
2739 return d;
2740}
2741
2742// IScalar == ILattice
2743template<class T1, class T2, int N>
2747
2748template<class T1, class T2, int N>
2751{
2753
2754 for(int i=0; i < N; ++i)
2755 d.elem(i) = l.elem() == r.elem(i);
2756 return d;
2757}
2758
2759
2760// ILattice != ILattice
2761template<class T1, class T2, int N>
2765
2766template<class T1, class T2, int N>
2769{
2771
2772 for(int i=0; i < N; ++i)
2773 d.elem(i) = l.elem(i) != r.elem(i);
2774 return d;
2775}
2776
2777// ILattice != IScalar
2778template<class T1, class T2, int N>
2782
2783template<class T1, class T2, int N>
2786{
2788
2789 for(int i=0; i < N; ++i)
2790 d.elem(i) = l.elem(i) != r.elem();
2791 return d;
2792}
2793
2794// ILattice != ILattice
2795template<class T1, class T2, int N>
2799
2800template<class T1, class T2, int N>
2803{
2805
2806 for(int i=0; i < N; ++i)
2807 d.elem(i) = l.elem() != r.elem(i);
2808 return d;
2809}
2810
2811
2812// ILattice && ILattice
2813template<class T1, class T2, int N>
2817
2818template<class T1, class T2, int N>
2821{
2823
2824 for(int i=0; i < N; ++i)
2825 d.elem(i) = l.elem(i) && r.elem(i);
2826 return d;
2827}
2828
2829// ILattice && IScalar
2830template<class T1, class T2, int N>
2834
2835template<class T1, class T2, int N>
2838{
2840
2841 for(int i=0; i < N; ++i)
2842 d.elem(i) = l.elem(i) && r.elem();
2843 return d;
2844}
2845
2846// IScalar && ILattice
2847template<class T1, class T2, int N>
2851
2852template<class T1, class T2, int N>
2855{
2857
2858 for(int i=0; i < N; ++i)
2859 d.elem(i) = l.elem() && r.elem(i);
2860 return d;
2861}
2862
2863
2864// ILattice || ILattice
2865template<class T1, class T2, int N>
2869
2870template<class T1, class T2, int N>
2873{
2875
2876 for(int i=0; i < N; ++i)
2877 d.elem(i) = l.elem(i) || r.elem(i);
2878 return d;
2879}
2880
2881// ILattice || IScalar
2882template<class T1, class T2, int N>
2886
2887template<class T1, class T2, int N>
2890{
2892
2893 for(int i=0; i < N; ++i)
2894 d.elem(i) = l.elem(i) || r.elem();
2895 return d;
2896}
2897
2898// IScalar || ILattice
2899template<class T1, class T2, int N>
2903
2904template<class T1, class T2, int N>
2907{
2909
2910 for(int i=0; i < N; ++i)
2911 d.elem(i) = l.elem() || r.elem(i);
2912 return d;
2913}
2914
2915
2916//-----------------------------------------------------------------------------
2917// Functions
2918
2919// ILattice = adj(ILattice)
2920template<class T1, int N>
2923{
2925
2926 for(int i=0; i < N; ++i)
2927 d.elem(i) = adj(s1.elem(i));
2928 return d;
2929}
2930
2931
2932// ILattice = conj(ILattice)
2933template<class T1, int N>
2936{
2938
2939 for(int i=0; i < N; ++i)
2940 d.elem(i) = conj(s1.elem(i));
2941 return d;
2942}
2943
2944
2945// ILattice = transpose(ILattice)
2946template<class T1, int N>
2949{
2951
2952 for(int i=0; i < N; ++i)
2953 d.elem(i) = transpose(s1.elem(i));
2954 return d;
2955}
2956
2957
2958// ILattice = Trace(ILattice)
2959template<class T1, int N>
2962{
2964
2965 for(int i=0; i < N; ++i)
2966 d.elem(i) = trace(s1.elem(i));
2967 return d;
2968}
2969
2970
2971// ILattice = Re(Trace(ILattice))
2972template<class T1, int N>
2975{
2977
2978 for(int i=0; i < N; ++i)
2979 d.elem(i) = trace_real(s1.elem(i));
2980 return d;
2981}
2982
2983
2984// ILattice = Im(Trace(ILattice))
2985template<class T1, int N>
2988{
2990
2991 for(int i=0; i < N; ++i)
2992 d.elem(i) = trace_imag(s1.elem(i));
2993 return d;
2994}
2995
2996
2997// ILattice = Re(ILattice)
2998template<class T1, int N>
3001{
3003
3004 for(int i=0; i < N; ++i)
3005 d.elem(i) = real(s1.elem(i));
3006 return d;
3007}
3008
3009
3010// ILattice = Im(ILattice)
3011template<class T1, int N>
3014{
3016
3017 for(int i=0; i < N; ++i)
3018 d.elem(i) = imag(s1.elem(i));
3019 return d;
3020}
3021
3022
3023// ArcCos
3024template<class T1, int N>
3027{
3029
3030 for(int i=0; i < N; ++i)
3031 d.elem(i) = acos(s1.elem(i));
3032 return d;
3033}
3034
3035// ArcSin
3036template<class T1, int N>
3039{
3041
3042 for(int i=0; i < N; ++i)
3043 d.elem(i) = asin(s1.elem(i));
3044 return d;
3045}
3046
3047// ArcTan
3048template<class T1, int N>
3051{
3053
3054 for(int i=0; i < N; ++i)
3055 d.elem(i) = atan(s1.elem(i));
3056 return d;
3057}
3058
3059// Cos
3060template<class T1, int N>
3063{
3065
3066 for(int i=0; i < N; ++i)
3067 d.elem(i) = cos(s1.elem(i));
3068 return d;
3069}
3070
3071// Exp
3072template<class T1, int N>
3075{
3077
3078 for(int i=0; i < N; ++i)
3079 d.elem(i) = exp(s1.elem(i));
3080 return d;
3081}
3082
3083// Fabs
3084template<class T1, int N>
3087{
3089
3090 for(int i=0; i < N; ++i)
3091 d.elem(i) = fabs(s1.elem(i));
3092 return d;
3093}
3094
3095// Log
3096template<class T1, int N>
3099{
3101
3102 for(int i=0; i < N; ++i)
3103 d.elem(i) = log(s1.elem(i));
3104 return d;
3105}
3106
3107// Sin
3108template<class T1, int N>
3111{
3113
3114 for(int i=0; i < N; ++i)
3115 d.elem(i) = sin(s1.elem(i));
3116 return d;
3117}
3118
3119// Sqrt
3120template<class T1, int N>
3123{
3125
3126 for(int i=0; i < N; ++i)
3127 d.elem(i) = sqrt(s1.elem(i));
3128 return d;
3129}
3130
3131// Tan
3132template<class T1, int N>
3135{
3137
3138 for(int i=0; i < N; ++i)
3139 d.elem(i) = tan(s1.elem(i));
3140 return d;
3141}
3142
3143
3145template<class T1, class T2, int N>
3146inline typename BinaryReturn<ILattice<T1,N>, ILattice<T2,N>, FnPow>::Type_t
3147pow(const ILattice<T1,N>& s1, const ILattice<T2,N>& s2)
3148{
3150
3151 for(int i=0; i < N; ++i)
3152 d.elem(i) = pow(s1.elem(i), s2.elem(i));
3153 return d;
3154}
3155
3157template<class T1, class T2, int N>
3158inline typename BinaryReturn<ILattice<T1,N>, IScalar<T2>, FnPow>::Type_t
3159pow(const ILattice<T1,N>& s1, const IScalar<T2>& s2)
3160{
3162
3163 for(int i=0; i < N; ++i)
3164 d.elem(i) = pow(s1.elem(i), s2.elem());
3165 return d;
3166}
3167
3169template<class T1, class T2, int N>
3170inline typename BinaryReturn<IScalar<T1>, ILattice<T2,N>, FnPow>::Type_t
3171pow(const IScalar<T1>& s1, const ILattice<T2,N>& s2)
3172{
3174
3175 for(int i=0; i < N; ++i)
3176 d.elem(i) = pow(s1.elem(i), s2.elem(i));
3177 return d;
3178}
3179
3180
3182template<class T1, class T2, int N>
3183inline typename BinaryReturn<ILattice<T1,N>, ILattice<T2,N>, FnArcTan2>::Type_t
3185{
3187
3188 for(int i=0; i < N; ++i)
3189 d.elem(i) = atan2(s1.elem(i), s2.elem(i));
3190 return d;
3191}
3192
3194template<class T1, class T2, int N>
3195inline typename BinaryReturn<ILattice<T1,N>, IScalar<T2>, FnArcTan2>::Type_t
3196atan2(const ILattice<T1,N>& s1, const IScalar<T2>& s2)
3197{
3199
3200 for(int i=0; i < N; ++i)
3201 d.elem(i) = atan2(s1.elem(i), s2.elem());
3202 return d;
3203}
3204
3206template<class T1, class T2, int N>
3207inline typename BinaryReturn<IScalar<T1>, ILattice<T2,N>, FnArcTan2>::Type_t
3208atan2(const IScalar<T1>& s1, const ILattice<T2,N>& s2)
3209{
3211
3212 for(int i=0; i < N; ++i)
3213 d.elem(i) = atan2(s1.elem(), s2.elem(i));
3214 return d;
3215}
3216
3217
3219template<class T1, int N>
3222{
3224
3225 for(int i=0; i < N; ++i)
3226 d.elem(i) = seedToFloat(s1.elem(i));
3227 return d;
3228}
3229
3230
3232template<class T1, class T2, int N>
3233inline typename BinaryReturn<ILattice<T1,N>, ILattice<T2,N>, FnOuterProduct>::Type_t
3235{
3237
3238 for(int i=0; i < N; ++i)
3239 d.elem(i) = outerProduct(l.elem(i), r.elem(i));
3240 return d;
3241}
3242
3244template<class T1, class T2, int N>
3245inline typename BinaryReturn<ILattice<T1,N>, IScalar<T2>, FnOuterProduct>::Type_t
3247{
3249
3250 for(int i=0; i < N; ++i)
3251 d.elem(i) = outerProduct(l.elem(i), r.elem());
3252 return d;
3253}
3254
3256template<class T1, class T2, int N>
3257inline typename BinaryReturn<IScalar<T1>, ILattice<T2,N>, FnOuterProduct>::Type_t
3259{
3261
3262 for(int i=0; i < N; ++i)
3263 d.elem(i) = outerProduct(l.elem(), r.elem(i));
3264 return d;
3265}
3266
3267
3269
3270// Global operations
3271template<class T, int N>
3275
3276template<class T, int N>
3278getSite(const ILattice<T,N>& s1, int innersite)
3279{
3280 return s1.elem(innersite);
3281}
3282
3283
3285template<class T, int N>
3286inline void
3288{
3289 for(int i=0; i < N; ++i)
3290 zero_rep(dest.elem(i));
3291}
3292
3293
3295template<class T, class T1, int N>
3296inline void
3297copy_site(ILattice<T,N>& d, int isite, const IScalar<T1>& s1)
3298{
3299 d.elem(isite) = s1.elem();
3300}
3301
3302
3304
3305template<class T, class T1>
3306inline void
3308 const ILattice<T1,2>& s0, int i0,
3309 const ILattice<T1,2>& s1, int i1)
3310{
3311 d.elem(0) = s0.elem(i0);
3312 d.elem(1) = s0.elem(i1);
3313}
3314
3315
3317
3318template<class T, class T1>
3319inline void
3321 const ILattice<T1,4>& s0, int i0,
3322 const ILattice<T1,4>& s1, int i1,
3323 const ILattice<T1,4>& s2, int i2,
3324 const ILattice<T1,4>& s3, int i3)
3325{
3326 d.elem(0) = s0.elem(i0);
3327 d.elem(1) = s1.elem(i1);
3328 d.elem(2) = s2.elem(i2);
3329 d.elem(3) = s3.elem(i3);
3330}
3331
3332
3334template<class T, class T1, int N>
3335inline void
3337{
3338 for(int i=0; i < N; ++i)
3339 copymask(d.elem(i),mask.elem(i),s1.elem(i));
3340}
3341
3342
3344template<class T, int N, class T1, class T2>
3345inline void
3346fill_random(ILattice<T,N>& d, T1& seed, T2& skewed_seed, const T1& seed_mult)
3347{
3348 fill_random<T1,T2,N>(d.data(), seed, skewed_seed, seed_mult);
3349}
3350
3351
3352#if 1
3353// Global sum over site indices only
3354template<class T, int N>
3358
3359template<class T, int N>
3362{
3364
3365 d.elem() = s1.elem(0);
3366 for(int i=1; i < N; ++i)
3367 d.elem() += s1.elem(i);
3368
3369 return d;
3370}
3371#endif
3372
3373
3374//--------------------------------------------
3375// Global max
3376template<class T, int N>
3380
3381template<class T, int N>
3384{
3386
3387 d.elem() = s1.elem(0);
3388 for(int i=1; i < N; ++i)
3389 {
3390 if (toBool(s1.elem() > d.elem()))
3391 d.elem() = s1.elem(i);
3392 }
3393
3394 return d;
3395}
3396
3397
3398//--------------------------------------------
3399// Global min
3400template<class T, int N>
3404
3405template<class T, int N>
3408{
3410
3411 d.elem() = s1.elem(0);
3412 for(int i=1; i < N; ++i)
3413 {
3414 if (toBool(s1.elem() > d.elem()))
3415 d.elem() = s1.elem(i);
3416 }
3417
3418 return d;
3419}
3420
3421
3422//--------------------------------------------
3423// InnerProduct (norm-seq) global sum = sum(tr(adj(s1)*s1))
3424template<class T, int N>
3428
3429template<class T, int N>
3433
3434template<class T, int N>
3437{
3439
3440 for(int i=0; i < N; ++i)
3441 d.elem(i) = localNorm2(s1.elem(i));
3442
3443 return d;
3444}
3445
3446
3448template<class T1, class T2, int N>
3452
3453template<class T1, class T2, int N>
3457
3458template<class T1, class T2, int N>
3461{
3463
3464 for(int i=0; i < N; ++i)
3465 d.elem(i) = localInnerProduct(s1.elem(i), s2.elem(i));
3466
3467 return d;
3468}
3469
3471template<class T1, class T2, int N>
3475
3476template<class T1, class T2, int N>
3480
3481template<class T1, class T2, int N>
3484{
3486
3487 for(int i=0; i < N; ++i)
3488 d.elem(i) = localInnerProduct(s1.elem(i), s2.elem());
3489
3490 return d;
3491}
3492
3494template<class T1, class T2, int N>
3498
3499template<class T1, class T2, int N>
3503
3504template<class T1, class T2, int N>
3507{
3509
3510 for(int i=0; i < N; ++i)
3511 d.elem(i) = localInnerProduct(s1.elem(), s2.elem(i));
3512
3513 return d;
3514}
3515
3516
3518
3522template<class T1, class T2, class T3, int N>
3526
3527template<class T1, class T2, class T3, int N>
3530{
3532
3533 for(int i=0; i < N; ++i)
3534 d.elem(i) = where(a.elem(i), b.elem(i), c.elem(i));
3535
3536 return d;
3537}
3538
3540
3544template<class T1, class T2, class T3, int N>
3548
3549template<class T1, class T2, class T3, int N>
3551where(const ILattice<T1,N>& a, const ILattice<T2,N>& b, const IScalar<T3>& c)
3552{
3554
3555 for(int i=0; i < N; ++i)
3556 d.elem(i) = where(a.elem(i), b.elem(i), c.elem());
3557
3558 return d;
3559}
3560
3562
3566template<class T1, class T2, class T3, int N>
3570
3571template<class T1, class T2, class T3, int N>
3573where(const ILattice<T1,N>& a, const IScalar<T2>& b, const ILattice<T3,N>& c)
3574{
3576
3577 for(int i=0; i < N; ++i)
3578 d.elem(i) = where(a.elem(i), b.elem(), c.elem(i));
3579
3580 return d;
3581}
3582
3584
3588template<class T1, class T2, class T3, int N>
3592
3593template<class T1, class T2, class T3, int N>
3595where(const ILattice<T1,N>& a, const IScalar<T2>& b, const IScalar<T3>& c)
3596{
3598
3599 for(int i=0; i < N; ++i)
3600 d.elem(i) = where(a.elem(i), b.elem(), c.elem());
3601
3602 return d;
3603}
3604
3606
3610template<class T1, class T2, class T3, int N>
3614
3615template<class T1, class T2, class T3, int N>
3617where(const IScalar<T1>& a, const ILattice<T2,N>& b, const ILattice<T3,N>& c)
3618{
3620
3621 for(int i=0; i < N; ++i)
3622 d.elem(i) = where(a.elem(), b.elem(i), c.elem(i));
3623
3624 return d;
3625}
3626
3628
3632template<class T1, class T2, class T3, int N>
3636
3637template<class T1, class T2, class T3, int N>
3639where(const IScalar<T1>& a, const ILattice<T2,N>& b, const IScalar<T3>& c)
3640{
3642
3643 for(int i=0; i < N; ++i)
3644 d.elem(i) = where(a.elem(), b.elem(i), c.elem());
3645
3646 return d;
3647}
3648
3650
3654template<class T1, class T2, class T3, int N>
3658
3659template<class T1, class T2, class T3, int N>
3661where(const IScalar<T1>& a, const IScalar<T2>& b, const ILattice<T3,N>& c)
3662{
3664
3665 for(int i=0; i < N; ++i)
3666 d.elem(i) = where(a.elem(), b.elem(), c.elem(i));
3667
3668 return d;
3669}
3670
3671 // end of group ilattice
3673
3674} // namespace QDP
3675
3676#endif
ILattice & operator-=(const ILattice< T1, N > &rhs)
ILattice -= ILattice.
Definition qdp_inner.h:451
ILattice & operator*=(const IScalar< T1 > &rhs)
ILattice *= IScalar.
Definition qdp_inner.h:339
ILattice & operator*=(const ILattice< T1, N > &rhs)
ILattice *= ILattice.
Definition qdp_inner.h:462
ILattice(const ILattice &a)
Deep copy constructor.
Definition qdp_inner.h:559
ILattice & operator/=(const ILattice< T1, N > &rhs)
ILattice /= ILattice.
Definition qdp_inner.h:473
ILattice & operator=(const IScalar< T1 > &rhs)
ILattice = IScalar.
Definition qdp_inner.h:306
ILattice & operator<<=(const IScalar< T1 > &rhs)
ILattice <<= IScalar.
Definition qdp_inner.h:405
ILattice & operator-=(const IScalar< T1 > &rhs)
ILattice -= IScalar.
Definition qdp_inner.h:328
ILattice & operator&=(const ILattice< T1, N > &rhs)
ILattice &= ILattice.
Definition qdp_inner.h:506
ILattice & operator=(const ILattice< T1, N > &rhs)
ILattice = ILattice.
Definition qdp_inner.h:429
ILattice & operator>>=(const ILattice< T1, N > &rhs)
ILattice >>= ILattice.
Definition qdp_inner.h:539
ILattice & operator%=(const IScalar< T1 > &rhs)
ILattice %= IScalar.
Definition qdp_inner.h:361
ILattice & operator|=(const IScalar< T1 > &rhs)
ILattice |= IScalar.
Definition qdp_inner.h:372
ILattice(const typename WordType< T >::Type_t &rhs)
construct dest = const
Definition qdp_inner.h:257
ILattice(const IScalar< T1 > &rhs)
construct dest = rhs
Definition qdp_inner.h:265
ILattice & operator^=(const IScalar< T1 > &rhs)
ILattice ^= IScalar.
Definition qdp_inner.h:394
ILattice & operator&=(const IScalar< T1 > &rhs)
ILattice &= IScalar.
Definition qdp_inner.h:383
T & elem(int i)
Definition qdp_inner.h:577
const T & elem(int i) const
Definition qdp_inner.h:578
ILattice & operator/=(const IScalar< T1 > &rhs)
ILattice /= IScalar.
Definition qdp_inner.h:350
ILattice & operator+=(const IScalar< T1 > &rhs)
ILattice += IScalar.
Definition qdp_inner.h:317
ILattice(const ILattice< T1, N > &rhs)
construct dest = rhs
Definition qdp_inner.h:273
ILattice & operator%=(const ILattice< T1, N > &rhs)
ILattice %= ILattice.
Definition qdp_inner.h:484
T * data()
The backdoor.
Definition qdp_inner.h:573
ILattice & operator+=(const ILattice< T1, N > &rhs)
ILattice += ILattice.
Definition qdp_inner.h:440
ILattice & operator<<=(const ILattice< T1, N > &rhs)
ILattice <<= ILattice.
Definition qdp_inner.h:528
ILattice & operator|=(const ILattice< T1, N > &rhs)
ILattice |= ILattice.
Definition qdp_inner.h:495
ILattice & operator^=(const ILattice< T1, N > &rhs)
ILattice ^= ILattice.
Definition qdp_inner.h:517
ILattice & operator>>=(const IScalar< T1 > &rhs)
ILattice >>= IScalar.
Definition qdp_inner.h:416
ILattice(const T1 &rhs)
construct dest = rhs
Definition qdp_inner.h:281
Scalar inner lattice.
Definition qdp_inner.h:25
IScalar(const IScalar< T1 > &rhs)
construct dest = rhs
Definition qdp_inner.h:36
IScalar & operator%=(const IScalar< T1 > &rhs)
IScalar %= IScalar.
Definition qdp_inner.h:103
IScalar & operator<<=(const IScalar< T1 > &rhs)
IScalar <<= IScalar.
Definition qdp_inner.h:139
IScalar & operator*=(const IScalar< T1 > &rhs)
IScalar *= IScalar.
Definition qdp_inner.h:85
IScalar(const T1 &rhs)
construct dest = rhs
Definition qdp_inner.h:40
IScalar & operator=(const IScalar< T1 > &rhs)
IScalar = IScalar.
Definition qdp_inner.h:58
IScalar & operator/=(const IScalar< T1 > &rhs)
IScalar /= IScalar.
Definition qdp_inner.h:94
IScalar(const IScalar &a)
Deep copies here.
Definition qdp_inner.h:155
IScalar & operator>>=(const IScalar< T1 > &rhs)
IScalar >>= IScalar.
Definition qdp_inner.h:148
IScalar & operator&=(const IScalar< T1 > &rhs)
IScalar &= IScalar.
Definition qdp_inner.h:121
IScalar(const typename WordType< T >::Type_t &rhs)
construct dest = const
Definition qdp_inner.h:32
IScalar & operator^=(const IScalar< T1 > &rhs)
IScalar ^= IScalar.
Definition qdp_inner.h:130
IScalar & operator+=(const IScalar< T1 > &rhs)
IScalar += IScalar.
Definition qdp_inner.h:67
IScalar & operator-=(const IScalar< T1 > &rhs)
IScalar -= IScalar.
Definition qdp_inner.h:76
IScalar & operator|=(const IScalar< T1 > &rhs)
IScalar |= IScalar.
Definition qdp_inner.h:112
const T & elem() const
Definition qdp_inner.h:159
StandardInputStream class.
Definition qdp_stdio.h:33
StandardOutputStream class.
Definition qdp_stdio.h:106
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
UnaryReturn< C, FnGlobalMin >::Type_t globalMin(const QDPType< T, C > &s1)
OScalar = globalMin(source).
UnaryReturn< C, FnGlobalMax >::Type_t globalMax(const QDPType< T, C > &s1)
OScalar = globalMax(source).
UnaryReturn< C, FnSum >::Type_t sum(const QDPType< T, C > &s1)
OScalar = sum(source).
void gather_sites(ILattice< T, 2 > &d, const ILattice< T1, 2 > &s0, int i0, const ILattice< T1, 2 > &s1, int i1)
gather several inner sites together
Definition qdp_inner.h:3307
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
void copy_site(IScalar< T > &d, int isite, const IScalar< T1 > &s1)
dest [some type] = source [some type]
Definition qdp_inner.h:1682
int toInt(const IScalar< T > &s)
QDP Int to int primitive in conversion routine.
Definition qdp_inner.h:1615
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
double toDouble(const IScalar< T > &s)
QDP Double to double primitive in conversion routine.
Definition qdp_inner.h:1631
BinaryReturn< IScalar< T1 >, IScalar< T2 >, OpAdjMultiplyAdj >::Type_t adjMultiplyAdj(const IScalar< T1 > &l, const IScalar< T2 > &r)
Definition qdp_inner.h:1198
bool toBool(const IScalar< T > &s)
QDP Boolean to bool primitive in conversion routine.
Definition qdp_inner.h:1639
BinaryReturn< IScalar< T1 >, IScalar< T2 >, OpMultiplyAdj >::Type_t multiplyAdj(const IScalar< T1 > &l, const IScalar< T2 > &r)
Definition qdp_inner.h:1189
void cast_rep(T &d, const IScalar< T1 > &s1)
dest [float type] = source [int type]
Definition qdp_inner.h:1664
BinaryReturn< IScalar< T1 >, IScalar< T2 >, OpAdjMultiply >::Type_t adjMultiply(const IScalar< T1 > &l, const IScalar< T2 > &r)
Definition qdp_inner.h:1180
UnaryReturn< IScalar< T1 >, FnRealTrace >::Type_t trace_real(const IScalar< T1 > &s1)
Definition qdp_inner.h:1437
UnaryReturn< IScalar< T1 >, FnImagTrace >::Type_t trace_imag(const IScalar< T1 > &s1)
Definition qdp_inner.h:1446
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
float toFloat(const IScalar< T > &s)
QDP Real to float primitive in conversion routine.
Definition qdp_inner.h:1623
Yet another random number generator.
MakeReturn< UnaryNode< FnAdjoint, typenameCreateLeaf< QDPExpr< T1, C1 > >::Leaf_t >, typenameUnaryReturn< C1, FnAdjoint >::Type_t >::Expression_t adj(const QDPExpr< T1, C1 > &l)
Definition qdp.h:4842
MakeReturn< BinaryNode< FnPow, typenameCreateLeaf< QDPType< T1, C1 > >::Leaf_t, typenameCreateLeaf< QDPExpr< T2, C2 > >::Leaf_t >, typenameBinaryReturn< C1, C2, FnPow >::Type_t >::Expression_t pow(const QDPType< T1, C1 > &l, const QDPExpr< T2, C2 > &r)
Definition qdp.h:2700
MakeReturn< UnaryNode< FnReal, typenameCreateLeaf< QDPExpr< T1, C1 > >::Leaf_t >, typenameUnaryReturn< C1, FnReal >::Type_t >::Expression_t real(const QDPExpr< T1, C1 > &l)
Definition qdp.h:4972
MakeReturn< TrinaryNode< FnWhere, typenameCreateLeaf< QDPType< T1, C1 > >::Leaf_t, typenameCreateLeaf< QDPType< T2, C2 > >::Leaf_t, typenameCreateLeaf< typenameSimpleScalar< typenameWordType< C1 >::Type_t >::Type_t >::Leaf_t >, typenameTrinaryReturn< C1, C2, typenameSimpleScalar< typenameWordType< C1 >::Type_t >::Type_t, FnWhere >::Type_t >::Expression_t where(const QDPType< T1, C1 > &a, const QDPType< T2, C2 > &b, const typename WordType< C1 >::Type_t &c)
Definition qdp.h:4576
MakeReturn< UnaryNode< FnSeedToFloat, typenameCreateLeaf< QDPExpr< T1, C1 > >::Leaf_t >, typenameUnaryReturn< C1, FnSeedToFloat >::Type_t >::Expression_t seedToFloat(const QDPExpr< T1, C1 > &l)
Definition qdp.h:5037
MakeReturn< BinaryNode< OpEQ, typenameCreateLeaf< QDPType< T1, C1 > >::Leaf_t, typenameCreateLeaf< QDPExpr< T2, C2 > >::Leaf_t >, typenameBinaryReturn< C1, C2, OpEQ >::Type_t >::Expression_t operator==(const QDPType< T1, C1 > &l, const QDPExpr< T2, C2 > &r)
Definition qdp.h:2812
MakeReturn< BinaryNode< OpGT, typenameCreateLeaf< QDPType< T1, C1 > >::Leaf_t, typenameCreateLeaf< QDPExpr< T2, C2 > >::Leaf_t >, typenameBinaryReturn< C1, C2, OpGT >::Type_t >::Expression_t operator>(const QDPType< T1, C1 > &l, const QDPExpr< T2, C2 > &r)
Definition qdp.h:2780
MakeReturn< UnaryNode< FnFabs, typenameCreateLeaf< QDPExpr< T1, C1 > >::Leaf_t >, typenameUnaryReturn< C1, FnFabs >::Type_t >::Expression_t fabs(const QDPExpr< T1, C1 > &l)
Definition qdp.h:5375
MakeReturn< UnaryNode< FnTrace, typenameCreateLeaf< QDPExpr< T1, C1 > >::Leaf_t >, typenameUnaryReturn< C1, FnTrace >::Type_t >::Expression_t trace(const QDPExpr< T1, C1 > &l)
Definition qdp.h:4907
MakeReturn< BinaryNode< OpMultiply, typenameCreateLeaf< QDPType< T1, C1 > >::Leaf_t, typenameCreateLeaf< QDPExpr< T2, C2 > >::Leaf_t >, typenameBinaryReturn< C1, C2, OpMultiply >::Type_t >::Expression_t operator*(const QDPType< T1, C1 > &l, const QDPExpr< T2, C2 > &r)
Definition qdp.h:2588
MakeReturn< BinaryNode< OpAdd, typenameCreateLeaf< QDPType< T1, C1 > >::Leaf_t, typenameCreateLeaf< QDPExpr< T2, C2 > >::Leaf_t >, typenameBinaryReturn< C1, C2, OpAdd >::Type_t >::Expression_t operator+(const QDPType< T1, C1 > &l, const QDPExpr< T2, C2 > &r)
Definition qdp.h:2556
MakeReturn< UnaryNode< FnCos, typenameCreateLeaf< QDPExpr< T1, C1 > >::Leaf_t >, typenameUnaryReturn< C1, FnCos >::Type_t >::Expression_t cos(const QDPExpr< T1, C1 > &l)
Definition qdp.h:5336
MakeReturn< BinaryNode< OpSubtract, typenameCreateLeaf< QDPType< T1, C1 > >::Leaf_t, typenameCreateLeaf< QDPExpr< T2, C2 > >::Leaf_t >, typenameBinaryReturn< C1, C2, OpSubtract >::Type_t >::Expression_t operator-(const QDPType< T1, C1 > &l, const QDPExpr< T2, C2 > &r)
Definition qdp.h:2572
MakeReturn< BinaryNode< OpMod, typenameCreateLeaf< QDPType< T1, C1 > >::Leaf_t, typenameCreateLeaf< QDPExpr< T2, C2 > >::Leaf_t >, typenameBinaryReturn< C1, C2, OpMod >::Type_t >::Expression_t operator%(const QDPType< T1, C1 > &l, const QDPExpr< T2, C2 > &r)
Definition qdp.h:2620
MakeReturn< UnaryNode< FnArcTan, typenameCreateLeaf< QDPExpr< T1, C1 > >::Leaf_t >, typenameUnaryReturn< C1, FnArcTan >::Type_t >::Expression_t atan(const QDPExpr< T1, C1 > &l)
Definition qdp.h:5310
MakeReturn< BinaryNode< FnArcTan2, typenameCreateLeaf< QDPType< T1, C1 > >::Leaf_t, typenameCreateLeaf< QDPExpr< T2, C2 > >::Leaf_t >, typenameBinaryReturn< C1, C2, FnArcTan2 >::Type_t >::Expression_t atan2(const QDPType< T1, C1 > &l, const QDPExpr< T2, C2 > &r)
Definition qdp.h:2732
MakeReturn< UnaryNode< FnConjugate, typenameCreateLeaf< QDPExpr< T1, C1 > >::Leaf_t >, typenameUnaryReturn< C1, FnConjugate >::Type_t >::Expression_t conj(const QDPExpr< T1, C1 > &l)
Definition qdp.h:4855
MakeReturn< UnaryNode< OpNot, typenameCreateLeaf< QDPExpr< T1, C1 > >::Leaf_t >, typenameUnaryReturn< C1, OpNot >::Type_t >::Expression_t operator!(const QDPExpr< T1, C1 > &l)
Definition qdp.h:5544
MakeReturn< BinaryNode< FnOuterProduct, typenameCreateLeaf< QDPType< T1, C1 > >::Leaf_t, typenameCreateLeaf< QDPExpr< T2, C2 > >::Leaf_t >, typenameBinaryReturn< C1, C2, FnOuterProduct >::Type_t >::Expression_t outerProduct(const QDPType< T1, C1 > &l, const QDPExpr< T2, C2 > &r)
Definition qdp.h:2364
MakeReturn< BinaryNode< FnLocalColorInnerProduct, typenameCreateLeaf< QDPType< T1, C1 > >::Leaf_t, typenameCreateLeaf< QDPExpr< T2, C2 > >::Leaf_t >, typenameBinaryReturn< C1, C2, FnLocalColorInnerProduct >::Type_t >::Expression_t localColorInnerProduct(const QDPType< T1, C1 > &l, const QDPExpr< T2, C2 > &r)
Definition qdp.h:2444
MakeReturn< BinaryNode< OpBitwiseAnd, typenameCreateLeaf< QDPType< T1, C1 > >::Leaf_t, typenameCreateLeaf< QDPExpr< T2, C2 > >::Leaf_t >, typenameBinaryReturn< C1, C2, OpBitwiseAnd >::Type_t >::Expression_t operator&(const QDPType< T1, C1 > &l, const QDPExpr< T2, C2 > &r)
Definition qdp.h:2636
MakeReturn< BinaryNode< FnLocalInnerProduct, typenameCreateLeaf< QDPType< T1, C1 > >::Leaf_t, typenameCreateLeaf< QDPExpr< T2, C2 > >::Leaf_t >, typenameBinaryReturn< C1, C2, FnLocalInnerProduct >::Type_t >::Expression_t localInnerProduct(const QDPType< T1, C1 > &l, const QDPExpr< T2, C2 > &r)
Definition qdp.h:2412
MakeReturn< UnaryNode< FnArcSin, typenameCreateLeaf< QDPExpr< T1, C1 > >::Leaf_t >, typenameUnaryReturn< C1, FnArcSin >::Type_t >::Expression_t asin(const QDPExpr< T1, C1 > &l)
Definition qdp.h:5297
MakeReturn< UnaryNode< FnExp, typenameCreateLeaf< QDPExpr< T1, C1 > >::Leaf_t >, typenameUnaryReturn< C1, FnExp >::Type_t >::Expression_t exp(const QDPExpr< T1, C1 > &l)
Definition qdp.h:5362
MakeReturn< BinaryNode< OpAnd, typenameCreateLeaf< QDPType< T1, C1 > >::Leaf_t, typenameCreateLeaf< QDPExpr< T2, C2 > >::Leaf_t >, typenameBinaryReturn< C1, C2, OpAnd >::Type_t >::Expression_t operator&&(const QDPType< T1, C1 > &l, const QDPExpr< T2, C2 > &r)
Definition qdp.h:2844
MakeReturn< BinaryNode< OpGE, typenameCreateLeaf< QDPType< T1, C1 > >::Leaf_t, typenameCreateLeaf< QDPExpr< T2, C2 > >::Leaf_t >, typenameBinaryReturn< C1, C2, OpGE >::Type_t >::Expression_t operator>=(const QDPType< T1, C1 > &l, const QDPExpr< T2, C2 > &r)
Definition qdp.h:2796
MakeReturn< BinaryNode< OpBitwiseOr, typenameCreateLeaf< QDPType< T1, C1 > >::Leaf_t, typenameCreateLeaf< QDPExpr< T2, C2 > >::Leaf_t >, typenameBinaryReturn< C1, C2, OpBitwiseOr >::Type_t >::Expression_t operator|(const QDPType< T1, C1 > &l, const QDPExpr< T2, C2 > &r)
Definition qdp.h:2652
MakeReturn< BinaryNode< OpDivide, typenameCreateLeaf< QDPType< T1, C1 > >::Leaf_t, typenameCreateLeaf< QDPExpr< T2, C2 > >::Leaf_t >, typenameBinaryReturn< C1, C2, OpDivide >::Type_t >::Expression_t operator/(const QDPType< T1, C1 > &l, const QDPExpr< T2, C2 > &r)
Definition qdp.h:2604
MakeReturn< UnaryNode< FnSin, typenameCreateLeaf< QDPExpr< T1, C1 > >::Leaf_t >, typenameUnaryReturn< C1, FnSin >::Type_t >::Expression_t sin(const QDPExpr< T1, C1 > &l)
Definition qdp.h:5427
MakeReturn< UnaryNode< FnArcCos, typenameCreateLeaf< QDPExpr< T1, C1 > >::Leaf_t >, typenameUnaryReturn< C1, FnArcCos >::Type_t >::Expression_t acos(const QDPExpr< T1, C1 > &l)
Definition qdp.h:5284
MakeReturn< UnaryNode< FnTranspose, typenameCreateLeaf< QDPExpr< T1, C1 > >::Leaf_t >, typenameUnaryReturn< C1, FnTranspose >::Type_t >::Expression_t transpose(const QDPExpr< T1, C1 > &l)
Definition qdp.h:4868
MakeReturn< UnaryNode< FnImag, typenameCreateLeaf< QDPExpr< T1, C1 > >::Leaf_t >, typenameUnaryReturn< C1, FnImag >::Type_t >::Expression_t imag(const QDPExpr< T1, C1 > &l)
Definition qdp.h:4985
MakeReturn< BinaryNode< OpLT, typenameCreateLeaf< QDPType< T1, C1 > >::Leaf_t, typenameCreateLeaf< QDPExpr< T2, C2 > >::Leaf_t >, typenameBinaryReturn< C1, C2, OpLT >::Type_t >::Expression_t operator<(const QDPType< T1, C1 > &l, const QDPExpr< T2, C2 > &r)
Definition qdp.h:2748
MakeReturn< BinaryNode< OpNE, typenameCreateLeaf< QDPType< T1, C1 > >::Leaf_t, typenameCreateLeaf< QDPExpr< T2, C2 > >::Leaf_t >, typenameBinaryReturn< C1, C2, OpNE >::Type_t >::Expression_t operator!=(const QDPType< T1, C1 > &l, const QDPExpr< T2, C2 > &r)
Definition qdp.h:2828
MakeReturn< BinaryNode< OpOr, typenameCreateLeaf< QDPType< T1, C1 > >::Leaf_t, typenameCreateLeaf< QDPExpr< T2, C2 > >::Leaf_t >, typenameBinaryReturn< C1, C2, OpOr >::Type_t >::Expression_t operator||(const QDPType< T1, C1 > &l, const QDPExpr< T2, C2 > &r)
Definition qdp.h:2860
MakeReturn< UnaryNode< FnSqrt, typenameCreateLeaf< QDPExpr< T1, C1 > >::Leaf_t >, typenameUnaryReturn< C1, FnSqrt >::Type_t >::Expression_t sqrt(const QDPExpr< T1, C1 > &l)
Definition qdp.h:5453
MakeReturn< UnaryNode< FnTan, typenameCreateLeaf< QDPExpr< T1, C1 > >::Leaf_t >, typenameUnaryReturn< C1, FnTan >::Type_t >::Expression_t tan(const QDPExpr< T1, C1 > &l)
Definition qdp.h:5466
MakeReturn< BinaryNode< OpLE, typenameCreateLeaf< QDPType< T1, C1 > >::Leaf_t, typenameCreateLeaf< QDPExpr< T2, C2 > >::Leaf_t >, typenameBinaryReturn< C1, C2, OpLE >::Type_t >::Expression_t operator<=(const QDPType< T1, C1 > &l, const QDPExpr< T2, C2 > &r)
Definition qdp.h:2764
MakeReturn< BinaryNode< OpBitwiseXor, typenameCreateLeaf< QDPType< T1, C1 > >::Leaf_t, typenameCreateLeaf< QDPExpr< T2, C2 > >::Leaf_t >, typenameBinaryReturn< C1, C2, OpBitwiseXor >::Type_t >::Expression_t operator^(const QDPType< T1, C1 > &l, const QDPExpr< T2, C2 > &r)
Definition qdp.h:2668
void fill_random(float &d, T1 &seed, T2 &skewed_seed, const T1 &seed_mult)
dest = random
Definition qdp_random.h:54
MakeReturn< UnaryNode< FnLocalNorm2, typenameCreateLeaf< QDPExpr< T1, C1 > >::Leaf_t >, typenameUnaryReturn< C1, FnLocalNorm2 >::Type_t >::Expression_t localNorm2(const QDPExpr< T1, C1 > &l)
Definition qdp.h:4998
MakeReturn< UnaryNode< FnLog, typenameCreateLeaf< QDPExpr< T1, C1 > >::Leaf_t >, typenameUnaryReturn< C1, FnLog >::Type_t >::Expression_t log(const QDPExpr< T1, C1 > &l)
Definition qdp.h:5401
IScalar< typename UnaryReturn< T2, OpUnaryPlus >::Type_t > Type_t
Definition qdp_inner.h:862
ILattice< typename UnaryReturn< T2, OpUnaryPlus >::Type_t, N > Type_t
Definition qdp_inner.h:958
IScalar< typename UnaryReturn< T2, OpUnaryPlus >::Type_t > Type_t
Definition qdp_inner.h:840
IScalar< typename UnaryReturn< T2, OpUnaryPlus >::Type_t > Type_t
Definition qdp_inner.h:872
ILattice< typename UnaryReturn< T2, OpUnaryPlus >::Type_t, N > Type_t
Definition qdp_inner.h:968
IScalar< typename UnaryReturn< T2, OpUnaryPlus >::Type_t > Type_t
Definition qdp_inner.h:850
IScalar< typename BinaryReturn< T1, T2, FnInnerProduct >::Type_t > Type_t
Definition qdp_inner.h:3450
ILattice< typename BinaryReturn< T1, T2, FnLocalInnerProduct >::Type_t, N > Type_t
Definition qdp_inner.h:3455
ILattice< typename BinaryReturn< T1, T2, OpAddAssign >::Type_t, N > & Type_t
Definition qdp_inner.h:995
ILattice< typename BinaryReturn< T1, T2, OpAnd >::Type_t, N > Type_t
Definition qdp_inner.h:2815
ILattice< typename BinaryReturn< T1, T2, OpBitwiseAndAssign >::Type_t, N > & Type_t
Definition qdp_inner.h:1025
ILattice< typename BinaryReturn< T1, T2, OpBitwiseAnd >::Type_t, N > Type_t
Definition qdp_inner.h:2396
ILattice< typename BinaryReturn< T1, T2, OpBitwiseOrAssign >::Type_t, N > & Type_t
Definition qdp_inner.h:1020
ILattice< typename BinaryReturn< T1, T2, OpBitwiseOr >::Type_t, N > Type_t
Definition qdp_inner.h:2448
ILattice< typename BinaryReturn< T1, T2, OpBitwiseXorAssign >::Type_t, N > & Type_t
Definition qdp_inner.h:1030
ILattice< typename BinaryReturn< T1, T2, OpBitwiseXor >::Type_t, N > Type_t
Definition qdp_inner.h:2344
ILattice< typename BinaryReturn< T1, T2, OpDivideAssign >::Type_t, N > & Type_t
Definition qdp_inner.h:1010
ILattice< typename BinaryReturn< T1, T2, OpEQ >::Type_t, N > Type_t
Definition qdp_inner.h:2711
ILattice< typename BinaryReturn< T1, T2, OpGE >::Type_t, N > Type_t
Definition qdp_inner.h:2659
ILattice< typename BinaryReturn< T1, T2, OpGT >::Type_t, N > Type_t
Definition qdp_inner.h:2606
ILattice< typename BinaryReturn< T1, T2, OpLE >::Type_t, N > Type_t
Definition qdp_inner.h:2554
ILattice< typename BinaryReturn< T1, T2, OpLT >::Type_t, N > Type_t
Definition qdp_inner.h:2502
ILattice< typename BinaryReturn< T1, T2, OpLeftShiftAssign >::Type_t, N > & Type_t
Definition qdp_inner.h:1035
ILattice< typename BinaryReturn< T1, T2, OpLeftShift >::Type_t, N > Type_t
Definition qdp_inner.h:2188
ILattice< typename BinaryReturn< T1, T2, OpModAssign >::Type_t, N > & Type_t
Definition qdp_inner.h:1015
ILattice< typename BinaryReturn< T1, T2, OpMod >::Type_t, N > Type_t
Definition qdp_inner.h:2292
ILattice< typename BinaryReturn< T1, T2, OpMultiplyAssign >::Type_t, N > & Type_t
Definition qdp_inner.h:1005
ILattice< typename BinaryReturn< T1, T2, OpNE >::Type_t, N > Type_t
Definition qdp_inner.h:2763
ILattice< typename BinaryReturn< T1, T2, OpOr >::Type_t, N > Type_t
Definition qdp_inner.h:2867
ILattice< typename BinaryReturn< T1, T2, OpRightShiftAssign >::Type_t, N > & Type_t
Definition qdp_inner.h:1040
ILattice< typename BinaryReturn< T1, T2, OpRightShift >::Type_t, N > Type_t
Definition qdp_inner.h:2240
ILattice< typename BinaryReturn< T1, T2, OpSubtractAssign >::Type_t, N > & Type_t
Definition qdp_inner.h:1000
ILattice< typename BinaryReturn< T1, T2, Op >::Type_t, N > Type_t
Definition qdp_inner.h:763
IScalar< typename BinaryReturn< T1, T2, FnInnerProduct >::Type_t > Type_t
Definition qdp_inner.h:3473
ILattice< typename BinaryReturn< T1, T2, FnLocalInnerProduct >::Type_t, N > Type_t
Definition qdp_inner.h:3478
ILattice< typename BinaryReturn< T1, T2, OpAddAssign >::Type_t, N > & Type_t
Definition qdp_inner.h:1059
ILattice< typename BinaryReturn< T1, T2, OpAnd >::Type_t, N > Type_t
Definition qdp_inner.h:2832
ILattice< typename BinaryReturn< T1, T2, OpBitwiseAndAssign >::Type_t, N > & Type_t
Definition qdp_inner.h:1089
ILattice< typename BinaryReturn< T1, T2, OpBitwiseAnd >::Type_t, N > Type_t
Definition qdp_inner.h:2413
ILattice< typename BinaryReturn< T1, T2, OpBitwiseOrAssign >::Type_t, N > & Type_t
Definition qdp_inner.h:1084
ILattice< typename BinaryReturn< T1, T2, OpBitwiseOr >::Type_t, N > Type_t
Definition qdp_inner.h:2465
ILattice< typename BinaryReturn< T1, T2, OpBitwiseXorAssign >::Type_t, N > & Type_t
Definition qdp_inner.h:1094
ILattice< typename BinaryReturn< T1, T2, OpBitwiseXor >::Type_t, N > Type_t
Definition qdp_inner.h:2361
ILattice< typename BinaryReturn< T1, T2, OpDivideAssign >::Type_t, N > & Type_t
Definition qdp_inner.h:1074
ILattice< typename BinaryReturn< T1, T2, OpEQ >::Type_t, N > Type_t
Definition qdp_inner.h:2728
ILattice< typename BinaryReturn< T1, T2, OpGE >::Type_t, N > Type_t
Definition qdp_inner.h:2676
ILattice< typename BinaryReturn< T1, T2, OpGT >::Type_t, N > Type_t
Definition qdp_inner.h:2623
ILattice< typename BinaryReturn< T1, T2, OpLE >::Type_t, N > Type_t
Definition qdp_inner.h:2571
ILattice< typename BinaryReturn< T1, T2, OpLT >::Type_t, N > Type_t
Definition qdp_inner.h:2519
ILattice< typename BinaryReturn< T1, T2, OpLeftShiftAssign >::Type_t, N > & Type_t
Definition qdp_inner.h:1099
ILattice< typename BinaryReturn< T1, T2, OpLeftShift >::Type_t, N > Type_t
Definition qdp_inner.h:2205
ILattice< typename BinaryReturn< T1, T2, OpModAssign >::Type_t, N > & Type_t
Definition qdp_inner.h:1079
ILattice< typename BinaryReturn< T1, T2, OpMod >::Type_t, N > Type_t
Definition qdp_inner.h:2309
ILattice< typename BinaryReturn< T1, T2, OpMultiplyAssign >::Type_t, N > & Type_t
Definition qdp_inner.h:1069
ILattice< typename BinaryReturn< T1, T2, OpNE >::Type_t, N > Type_t
Definition qdp_inner.h:2780
ILattice< typename BinaryReturn< T1, T2, OpOr >::Type_t, N > Type_t
Definition qdp_inner.h:2884
ILattice< typename BinaryReturn< T1, T2, OpRightShiftAssign >::Type_t, N > & Type_t
Definition qdp_inner.h:1104
ILattice< typename BinaryReturn< T1, T2, OpRightShift >::Type_t, N > Type_t
Definition qdp_inner.h:2257
ILattice< typename BinaryReturn< T1, T2, OpSubtractAssign >::Type_t, N > & Type_t
Definition qdp_inner.h:1064
ILattice< typename BinaryReturn< T1, T2, Op >::Type_t, N > Type_t
Definition qdp_inner.h:775
ILattice< typename UnaryReturn< T2, OpUnaryPlus >::Type_t, N > Type_t
Definition qdp_inner.h:963
ILattice< typename UnaryReturn< T2, OpUnaryPlus >::Type_t, N > Type_t
Definition qdp_inner.h:973
IScalar< typename BinaryReturn< T1, T2, FnInnerProduct >::Type_t > Type_t
Definition qdp_inner.h:3496
ILattice< typename BinaryReturn< T1, T2, FnLocalInnerProduct >::Type_t, N > Type_t
Definition qdp_inner.h:3501
ILattice< typename BinaryReturn< T1, T2, OpAnd >::Type_t, N > Type_t
Definition qdp_inner.h:2849
ILattice< typename BinaryReturn< T1, T2, OpBitwiseAnd >::Type_t, N > Type_t
Definition qdp_inner.h:2430
ILattice< typename BinaryReturn< T1, T2, OpBitwiseOr >::Type_t, N > Type_t
Definition qdp_inner.h:2482
ILattice< typename BinaryReturn< T1, T2, OpBitwiseXor >::Type_t, N > Type_t
Definition qdp_inner.h:2378
ILattice< typename BinaryReturn< T1, T2, OpEQ >::Type_t, N > Type_t
Definition qdp_inner.h:2745
ILattice< typename BinaryReturn< T1, T2, OpGE >::Type_t, N > Type_t
Definition qdp_inner.h:2693
ILattice< typename BinaryReturn< T1, T2, OpGT >::Type_t, N > Type_t
Definition qdp_inner.h:2640
ILattice< typename BinaryReturn< T1, T2, OpLE >::Type_t, N > Type_t
Definition qdp_inner.h:2588
ILattice< typename BinaryReturn< T1, T2, OpLT >::Type_t, N > Type_t
Definition qdp_inner.h:2536
ILattice< typename BinaryReturn< T1, T2, OpLeftShift >::Type_t, N > Type_t
Definition qdp_inner.h:2222
ILattice< typename BinaryReturn< T1, T2, OpMod >::Type_t, N > Type_t
Definition qdp_inner.h:2326
ILattice< typename BinaryReturn< T1, T2, OpNE >::Type_t, N > Type_t
Definition qdp_inner.h:2797
ILattice< typename BinaryReturn< T1, T2, OpOr >::Type_t, N > Type_t
Definition qdp_inner.h:2901
ILattice< typename BinaryReturn< T1, T2, OpRightShift >::Type_t, N > Type_t
Definition qdp_inner.h:2274
ILattice< typename BinaryReturn< T1, T2, Op >::Type_t, N > Type_t
Definition qdp_inner.h:769
IScalar< typename BinaryReturn< T1, T2, FnInnerProduct >::Type_t > Type_t
Definition qdp_inner.h:1786
IScalar< typename BinaryReturn< T1, T2, FnLocalColorInnerProduct >::Type_t > Type_t
Definition qdp_inner.h:1805
IScalar< typename BinaryReturn< T1, T2, FnLocalInnerProduct >::Type_t > Type_t
Definition qdp_inner.h:1791
IScalar< typename BinaryReturn< T1, T2, OpAddAssign >::Type_t > & Type_t
Definition qdp_inner.h:894
IScalar< typename BinaryReturn< T1, T2, OpAnd >::Type_t > Type_t
Definition qdp_inner.h:1369
IScalar< typename BinaryReturn< T1, T2, OpBitwiseAndAssign >::Type_t > & Type_t
Definition qdp_inner.h:924
IScalar< typename BinaryReturn< T1, T2, OpBitwiseOrAssign >::Type_t > & Type_t
Definition qdp_inner.h:919
IScalar< typename BinaryReturn< T1, T2, OpBitwiseXorAssign >::Type_t > & Type_t
Definition qdp_inner.h:929
IScalar< typename BinaryReturn< T1, T2, OpDivideAssign >::Type_t > & Type_t
Definition qdp_inner.h:909
IScalar< typename BinaryReturn< T1, T2, OpEQ >::Type_t > Type_t
Definition qdp_inner.h:1341
IScalar< typename BinaryReturn< T1, T2, OpGE >::Type_t > Type_t
Definition qdp_inner.h:1327
IScalar< typename BinaryReturn< T1, T2, OpGT >::Type_t > Type_t
Definition qdp_inner.h:1313
IScalar< typename BinaryReturn< T1, T2, OpLE >::Type_t > Type_t
Definition qdp_inner.h:1299
IScalar< typename BinaryReturn< T1, T2, OpLT >::Type_t > Type_t
Definition qdp_inner.h:1285
IScalar< typename BinaryReturn< T1, T2, OpLeftShiftAssign >::Type_t > & Type_t
Definition qdp_inner.h:934
IScalar< typename BinaryReturn< T1, T2, OpLeftShift >::Type_t > Type_t
Definition qdp_inner.h:1217
IScalar< typename BinaryReturn< T1, T2, OpModAssign >::Type_t > & Type_t
Definition qdp_inner.h:914
IScalar< typename BinaryReturn< T1, T2, OpMultiplyAssign >::Type_t > & Type_t
Definition qdp_inner.h:904
IScalar< typename BinaryReturn< T1, T2, OpNE >::Type_t > Type_t
Definition qdp_inner.h:1355
IScalar< typename BinaryReturn< T1, T2, OpOr >::Type_t > Type_t
Definition qdp_inner.h:1383
IScalar< typename BinaryReturn< T1, T2, OpRightShiftAssign >::Type_t > & Type_t
Definition qdp_inner.h:939
IScalar< typename BinaryReturn< T1, T2, OpRightShift >::Type_t > Type_t
Definition qdp_inner.h:1231
IScalar< typename BinaryReturn< T1, T2, OpSubtractAssign >::Type_t > & Type_t
Definition qdp_inner.h:899
IScalar< typename BinaryReturn< T1, T2, Op >::Type_t > Type_t
Definition qdp_inner.h:749
IScalar< typename UnaryReturn< T2, OpUnaryPlus >::Type_t > Type_t
Definition qdp_inner.h:867
IScalar< typename UnaryReturn< T2, OpUnaryPlus >::Type_t > Type_t
Definition qdp_inner.h:845
IScalar< typename UnaryReturn< T2, OpUnaryPlus >::Type_t > Type_t
Definition qdp_inner.h:877
IScalar< typename UnaryReturn< T2, OpUnaryPlus >::Type_t > Type_t
Definition qdp_inner.h:855
ILattice< typename DoublePrecType< T >::Type_t, N > Type_t
Definition qdp_inner.h:677
IScalar< typename DoublePrecType< T >::Type_t > Type_t
Definition qdp_inner.h:670
IScalar< typename InternalScalar< T >::Type_t > Type_t
Definition qdp_inner.h:689
IScalar< typename InternalScalar< T >::Type_t > Type_t
Definition qdp_inner.h:684
Construct simple word type used at some level within primitives.
Definition qdp_traits.h:98
IScalar< typename LatticeScalar< T >::Type_t > Type_t
Definition qdp_inner.h:713
IScalar< typename LatticeScalar< T >::Type_t > Type_t
Definition qdp_inner.h:708
Makes a lattice scalar leaving primitive indices alone.
Definition qdp_traits.h:108
ILattice< typename PrimitiveScalar< T >::Type_t, N > Type_t
Definition qdp_inner.h:701
IScalar< typename PrimitiveScalar< T >::Type_t > Type_t
Definition qdp_inner.h:696
Makes a primitive scalar leaving grid alone.
Definition qdp_traits.h:103
ILattice< typename RealScalar< T >::Type_t, N > Type_t
Definition qdp_inner.h:725
IScalar< typename RealScalar< T >::Type_t > Type_t
Definition qdp_inner.h:720
Construct simple word type used at some level within primitives.
Definition qdp_traits.h:113
ILattice< typename SinglePrecType< T >::Type_t, N > Type_t
Definition qdp_inner.h:663
IScalar< typename SinglePrecType< T >::Type_t > Type_t
Definition qdp_inner.h:656
ILattice< typename BinaryReturn< T2, T3, Op >::Type_t, N > Type_t
Definition qdp_inner.h:785
ILattice< typename TrinaryReturn< T1, T2, T3, FnWhere >::Type_t, N > Type_t
Definition qdp_inner.h:3546
ILattice< typename TrinaryReturn< T1, T2, T3, FnWhere >::Type_t, N > Type_t
Definition qdp_inner.h:3524
ILattice< typename TrinaryReturn< T1, T2, T3, FnColorContract >::Type_t, N > Type_t
Definition qdp_inner.h:1045
ILattice< typename BinaryReturn< T2, T3, Op >::Type_t, N > Type_t
Definition qdp_inner.h:798
ILattice< typename BinaryReturn< T2, T3, Op >::Type_t, N > Type_t
Definition qdp_inner.h:792
ILattice< typename TrinaryReturn< T1, T2, T3, FnWhere >::Type_t, N > Type_t
Definition qdp_inner.h:3568
ILattice< typename TrinaryReturn< T1, T2, T3, FnWhere >::Type_t, N > Type_t
Definition qdp_inner.h:3590
ILattice< typename BinaryReturn< T2, T3, Op >::Type_t, N > Type_t
Definition qdp_inner.h:823
ILattice< typename BinaryReturn< T2, T3, Op >::Type_t, N > Type_t
Definition qdp_inner.h:804
ILattice< typename TrinaryReturn< T1, T2, T3, FnWhere >::Type_t, N > Type_t
Definition qdp_inner.h:3612
ILattice< typename TrinaryReturn< T1, T2, T3, FnWhere >::Type_t, N > Type_t
Definition qdp_inner.h:3634
ILattice< typename BinaryReturn< T2, T3, Op >::Type_t, N > Type_t
Definition qdp_inner.h:817
ILattice< typename TrinaryReturn< T1, T2, T3, FnWhere >::Type_t, N > Type_t
Definition qdp_inner.h:3656
ILattice< typename BinaryReturn< T2, T3, Op >::Type_t, N > Type_t
Definition qdp_inner.h:811
IScalar< typename TrinaryReturn< T1, T2, T3, FnColorContract >::Type_t > Type_t
Definition qdp_inner.h:944
IScalar< typename TrinaryReturn< T1, T2, T3, FnWhere >::Type_t > Type_t
Definition qdp_inner.h:1824
IScalar< typename BinaryReturn< T2, T3, Op >::Type_t > Type_t
Definition qdp_inner.h:757
ILattice< typename UnaryReturn< T1, Op >::Type_t, N > Type_t
Definition qdp_inner.h:743
IScalar< typename UnaryReturn< T, FnGetSite >::Type_t > Type_t
Definition qdp_inner.h:3273
IScalar< typename UnaryReturn< T, FnGlobalMax >::Type_t > Type_t
Definition qdp_inner.h:3378
IScalar< typename UnaryReturn< T, FnGlobalMin >::Type_t > Type_t
Definition qdp_inner.h:3402
ILattice< typename UnaryReturn< T, FnLocalNorm2 >::Type_t, N > Type_t
Definition qdp_inner.h:3431
IScalar< typename UnaryReturn< T, FnNorm2 >::Type_t > Type_t
Definition qdp_inner.h:3426
IScalar< typename UnaryReturn< T, FnPeekSite >::Type_t > Type_t
Definition qdp_inner.h:1053
IScalar< typename UnaryReturn< T, FnSumMulti >::Type_t > Type_t
Definition qdp_inner.h:951
IScalar< typename UnaryReturn< T, FnSum >::Type_t > Type_t
Definition qdp_inner.h:3356
ILattice< typename UnaryReturn< T, OpNot >::Type_t, N > Type_t
Definition qdp_inner.h:981
IScalar< typename UnaryReturn< T1, Op >::Type_t > Type_t
Definition qdp_inner.h:737
IScalar< typename UnaryReturn< T, FnGetSite >::Type_t > Type_t
Definition qdp_inner.h:1600
IScalar< typename UnaryReturn< T, FnGlobalMax >::Type_t > Type_t
Definition qdp_inner.h:1729
IScalar< typename UnaryReturn< T, FnGlobalMin >::Type_t > Type_t
Definition qdp_inner.h:1745
IScalar< typename UnaryReturn< T, FnLocalNorm2 >::Type_t > Type_t
Definition qdp_inner.h:1771
IScalar< typename UnaryReturn< T, FnNorm2 >::Type_t > Type_t
Definition qdp_inner.h:1766
IScalar< typename UnaryReturn< T, FnPeekSite >::Type_t > Type_t
Definition qdp_inner.h:833
IScalar< typename UnaryReturn< T, FnSumMulti >::Type_t > Type_t
Definition qdp_inner.h:1760
IScalar< typename UnaryReturn< T, FnSum >::Type_t > Type_t
Definition qdp_inner.h:1713
IScalar< typename UnaryReturn< T, OpNot >::Type_t > Type_t
Definition qdp_inner.h:1122
WordType< T >::Type_t Type_t
Definition qdp_inner.h:649
WordType< T >::Type_t Type_t
Definition qdp_inner.h:642
Find the underlying word type of a field.
Definition qdp_traits.h:29