QDP++
qdp_reality.h
Go to the documentation of this file.
1// -*- C++ -*-
2
6
7
8#ifndef QDP_REALITY_H
9#define QDP_REALITY_H
10
11#include <sstream>
12#include <cmath>
13
14namespace QDP {
15
16
17//-------------------------------------------------------------------------------------
25
27template<class T> class RScalar
28{
29public:
32
33 //---------------------------------------------------------
35 RScalar(const typename WordType<T>::Type_t& rhs) : F(rhs) {}
36
38 template<class T1>
39 RScalar(const RScalar<T1>& rhs) : F(rhs.elem()) {}
40
42 template<class T1>
43 RScalar(const T1& rhs) : F(rhs) {}
44
45 //---------------------------------------------------------
46#if 0
48
49 inline
50 RScalar& operator=(const typename WordType<T>::Type_t& rhs)
51 {
52 elem() = rhs;
53 return *this;
54 }
55#endif
56
58
59 template<class T1>
60 inline
62 {
63 elem() = rhs.elem();
64 return *this;
65 }
66
68 template<class T1>
69 inline
71 {
72 elem() += rhs.elem();
73 return *this;
74 }
75
77 template<class T1>
78 inline
80 {
81 elem() -= rhs.elem();
82 return *this;
83 }
84
86 template<class T1>
87 inline
89 {
90 elem() *= rhs.elem();
91 return *this;
92 }
93
95 template<class T1>
96 inline
98 {
99 elem() /= rhs.elem();
100 return *this;
101 }
102
104 template<class T1>
105 inline
107 {
108 elem() %= rhs.elem();
109 return *this;
110 }
111
113 template<class T1>
114 inline
116 {
117 elem() |= rhs.elem();
118 return *this;
119 }
120
122 template<class T1>
123 inline
125 {
126 elem() &= rhs.elem();
127 return *this;
128 }
129
131 template<class T1>
132 inline
134 {
135 elem() ^= rhs.elem();
136 return *this;
137 }
138
140 template<class T1>
141 inline
143 {
144 elem() <<= rhs.elem();
145 return *this;
146 }
147
149 template<class T1>
150 inline
152 {
153 elem() >>= rhs.elem();
154 return *this;
155 }
156
157
159 RScalar(const RScalar& a): F(a.F) {}
160
161public:
162 T& elem() {return F;}
163 const T& elem() const {return F;}
164
165private:
166 T F;
167};
168
169
170// Input
172template<class T>
173inline
174std::istream& operator>>(std::istream& s, RScalar<T>& d)
175{
176 return s >> d.elem();
177}
178
180template<class T>
181inline
183{
184 return s >> d.elem();
185}
186
188template<class T>
189inline
190std::ostream& operator<<(std::ostream& s, const RScalar<T>& d)
191{
192 return s << d.elem();
193}
194
196template<class T>
197inline
199{
200 return s << d.elem();
201}
202
203
205template<class T>
206inline
208{
209 return s >> d.elem();
210}
211
213template<class T>
214inline
216{
217 return s << d.elem();
218}
219
220#ifdef QDP_USE_LIBXML2
222template<class T>
223inline
224XMLWriter& operator<<(XMLWriter& xml, const RScalar<T>& d)
225{
226 return xml << d.elem();
227}
228
230template<class T>
231inline
232void read(XMLReader& xml, const std::string& path, RScalar<T>& d)
233{
234 read(xml, path, d.elem());
235}
236#endif
237 // end of group rscalar
239
240
241//-------------------------------------------------------------------------------------
249
251
252template<class T> class RComplex
253{
254public:
257
259 template<class T1, class T2>
260 RComplex(const RScalar<T1>& _re, const RScalar<T2>& _im): re(_re.elem()), im(_im.elem()) {}
261
263 template<class T1, class T2>
264 RComplex(const T1& _re, const T2& _im): re(_re), im(_im) {}
265
266 //---------------------------------------------------------
268
269 template<class T1>
270 inline
272 {
273 real() = rhs.elem();
274 zero_rep(imag());
275 return *this;
276 }
277
279 template<class T1>
280 inline
282 {
283 real() += rhs.elem();
284 return *this;
285 }
286
288 template<class T1>
289 inline
291 {
292 real() -= rhs.elem();
293 return *this;
294 }
295
297 template<class T1>
298 inline
300 {
301 real() *= rhs.elem();
302 imag() *= rhs.elem();
303 return *this;
304 }
305
307 template<class T1>
308 inline
310 {
311 real() /= rhs.elem();
312 imag() /= rhs.elem();
313 return *this;
314 }
315
316
317
319
320 template<class T1>
321 inline
323 {
324 real() = rhs.real();
325 imag() = rhs.imag();
326 return *this;
327 }
328
330 template<class T1>
331 inline
333 {
334 real() += rhs.real();
335 imag() += rhs.imag();
336 return *this;
337 }
338
340 template<class T1>
341 inline
343 {
344 real() -= rhs.real();
345 imag() -= rhs.imag();
346 return *this;
347 }
348
350 template<class T1>
351 inline
353 {
354 RComplex<T> d;
355 d = *this * rhs;
356
357 real() = d.real();
358 imag() = d.imag();
359 return *this;
360 }
361
363 template<class T1>
364 inline
366 {
367 RComplex<T> d;
368 d = *this / rhs;
369
370 real() = d.real();
371 imag() = d.imag();
372 return *this;
373 }
374
375
377 RComplex(const RComplex& a): re(a.re), im(a.im) {}
378
379public:
380 T& real() {return re;}
381 const T& real() const {return re;}
382
383 T& imag() {return im;}
384 const T& imag() const {return im;}
385
386private:
387 T re;
388 T im;
389} QDP_ALIGN8; // possibly force alignment
390
391
393template<class T>
394inline
395std::ostream& operator<<(std::ostream& s, const RComplex<T>& d)
396{
397 s << "( " << d.real() << " , " << d.imag() << " )";
398 return s;
399}
400
402template<class T>
403inline
405{
406 s << "( " << d.real() << " , " << d.imag() << " )";
407 return s;
408}
409
411template<class T>
412inline
414{
415 return s >> d.real() >> d.imag();
416}
417
419template<class T>
420inline
422{
423 return s << d.real() << d.imag();
424}
425
426#ifdef QDP_USE_LIBXML2
428template<class T>
429inline
430XMLWriter& operator<<(XMLWriter& xml, const RComplex<T>& d)
431{
432 xml.openTag("re");
433 xml << d.real();
434 xml.closeTag();
435 xml.openTag("im");
436 xml << d.imag();
437 xml.closeTag();
438
439 return xml;
440}
441
443template<class T>
444inline
445void read(XMLReader& xml, const std::string& xpath, RComplex<T>& d)
446{
447 std::ostringstream error_message;
448
449 // XPath for the real part
450 std::string path_real = xpath + "/re";
451
452 // XPath for the imaginary part.
453 std::string path_imag = xpath + "/im";
454
455 // Try and recursively get the real part
456 try {
457 read(xml, path_real, d.real());
458 }
459 catch(const std::string &e) {
460 error_message << "XPath Query: " << xpath << " Error: "
461 << "Failed to match real part of RComplex Object with self constructed path: " << path_real;
462
463 throw error_message.str();
464 }
465
466 // Try and recursively get the imaginary part
467 try {
468 read(xml, path_imag, d.imag());
469 }
470 catch(const std::string &e) {
471 error_message << "XPath Query: " << xpath <<" Error:"
472 <<"Failed to match imaginary part of RComplex Object with self constructed path: " << path_imag;
473
474 throw error_message.str();
475 }
476}
477#endif
478 // end of group rcomplex
480
481//-----------------------------------------------------------------------------
482// Traits classes
483//-----------------------------------------------------------------------------
484
485// Underlying word type
486template<class T>
487struct WordType<RScalar<T> >
488{
489 typedef typename WordType<T>::Type_t Type_t;
490};
491
492template<class T>
493struct WordType<RComplex<T> >
494{
495 typedef typename WordType<T>::Type_t Type_t;
496};
497
498// Fixed types
499template<class T>
504
505template<class T>
510
511template<class T>
516
517template<class T>
522
523
524// Internally used scalars
525template<class T>
529
530template<class T>
534
535
536// Makes a primitive scalar leaving grid alone
537template<class T>
541
542template<class T>
546
547// Makes a lattice scalar leaving primitive indices alone
548template<class T>
552
553template<class T>
557
558
559// Internally used real scalars
560template<class T>
564
565template<class T>
569
570
571//-----------------------------------------------------------------------------
572// Traits classes to support return types
573//-----------------------------------------------------------------------------
574
575// Default unary(RScalar) -> RScalar
576template<class T1, class Op>
580
581// Default unary(RComplex) -> RComplex
582template<class T1, class Op>
586
587// Default binary(RScalar,RScalar) -> RScalar
588template<class T1, class T2, class Op>
592
593// Default binary(RComplex,RComplex) -> RComplex
594template<class T1, class T2, class Op>
598
599// Default binary(RScalar,RComplex) -> RComplex
600template<class T1, class T2, class Op>
604
605// Default binary(RComplex,RScalar) -> RComplex
606template<class T1, class T2, class Op>
610
611
612
613
614// RScalar
615#if 0
616template<class T1, class T2>
617struct UnaryReturn<RScalar<T2>, OpCast<T1> > {
619// typedef T1 Type_t;
620};
621#endif
622
623
624template<class T1, class T2>
628
629template<class T1, class T2>
633
634template<class T1, class T2>
638
639template<class T1, class T2>
643
644template<class T1, class T2>
648
649template<class T1, class T2>
653
654template<class T1, class T2>
658
659template<class T1, class T2>
663
664template<class T1, class T2>
668
669template<class T1, class T2>
673
674template<class T1, class T2, class T3>
678
679// RScalar
680// Gamma algebra
681template<int N, int m, class T2, class OpGammaConstMultiply>
685
686template<class T2, int N, int m, class OpMultiplyGammaConst>
690
691template<class T2, int N, class OpGammaTypeMultiply>
695
696template<class T2, int N, class OpMultiplyGammaType>
700
701
702// RScalar
703// Gamma algebra
704template<int N, int m, class T2, class OpGammaConstDPMultiply>
708
709template<class T2, int N, int m, class OpMultiplyGammaConstDP>
713
714template<class T2, int N, class OpGammaTypeDPMultiply>
718
719template<class T2, int N, class OpMultiplyGammaTypeDP>
723
724
725
726// RComplex
727// Gamma algebra
728template<int N, int m, class T2, class OpGammaConstMultiply>
732
733template<class T2, int N, int m, class OpMultiplyGammaConst>
737
738template<class T2, int N, class OpGammaTypeMultiply>
742
743template<class T2, int N, class OpMultiplyGammaType>
747
748
749// Gamma algebra
750template<int N, int m, class T2, class OpGammaConstDPMultiply>
754
755template<class T2, int N, int m, class OpMultiplyGammaConstDP>
759
760template<class T2, int N, class OpGammaTypeDPMultiply>
764
765template<class T2, int N, class OpMultiplyGammaTypeDP>
769
770
771// Assignment is different
772template<class T1, class T2 >
774// typedef RComplex<T1> &Type_t;
776};
777
778template<class T1, class T2>
782
783template<class T1, class T2>
787
788template<class T1, class T2>
792
793template<class T1, class T2>
797
798template<class T1, class T2>
802
803template<class T1, class T2>
807
808template<class T1, class T2>
812
813template<class T1, class T2>
817
818template<class T1, class T2>
822
823template<class T1, class T2>
827
828template<class T1, class T2, class T3>
832
833
834
835
836
837
838//-----------------------------------------------------------------------------
839// Operators
840//-----------------------------------------------------------------------------
841
845
846// Scalar Reality
847template<class T>
851
852template<class T1>
855{
856 return ! l.elem();
857}
858
859
860template<class T1>
863{
864 return +l.elem();
865}
866
867
868template<class T1>
871{
872 return -l.elem();
873}
874
875
876template<class T1, class T2>
877inline typename BinaryReturn<RScalar<T1>, RScalar<T2>, OpAdd>::Type_t
879{
880 return l.elem()+r.elem();
881}
882
883
884template<class T1, class T2>
885inline typename BinaryReturn<RScalar<T1>, RScalar<T2>, OpSubtract>::Type_t
887{
888 return l.elem() - r.elem();
889}
890
891
892template<class T1, class T2>
893inline typename BinaryReturn<RScalar<T1>, RScalar<T2>, OpMultiply>::Type_t
895{
896 return l.elem() * r.elem();
897}
898
899// Optimized adj(RScalar)*RScalar
900template<class T1, class T2>
901inline typename BinaryReturn<RScalar<T1>, RScalar<T2>, OpAdjMultiply>::Type_t
903{
905
906// return transpose(l.elem()) * r.elem();
907 return l.elem() * r.elem();
908}
909
910// Optimized RScalar*adj(RScalar)
911template<class T1, class T2>
912inline typename BinaryReturn<RScalar<T1>, RScalar<T2>, OpMultiplyAdj>::Type_t
914{
916
917// return l.elem() * transpose(r.elem());
918 return l.elem() * r.elem();
919}
920
921// Optimized adj(RScalar)*adj(RScalar)
922template<class T1, class T2>
923inline typename BinaryReturn<RScalar<T1>, RScalar<T2>, OpAdjMultiplyAdj>::Type_t
925{
927
928// return transpose(l.elem()) * transpose(r.elem());
929 return l.elem() * r.elem();
930}
931
932
933template<class T1, class T2>
934inline typename BinaryReturn<RScalar<T1>, RScalar<T2>, OpDivide>::Type_t
936{
937 return l.elem() / r.elem();
938}
939
940
941
942template<class T1, class T2 >
946
947
948template<class T1, class T2>
950operator<<(const RScalar<T1>& l, const RScalar<T2>& r)
951{
952 return l.elem() << r.elem();
953}
954
955
956template<class T1, class T2 >
960
961
962template<class T1, class T2>
965{
966 return l.elem() >> r.elem();
967}
968
969
970template<class T1, class T2 >
971inline typename BinaryReturn<RScalar<T1>, RScalar<T2>, OpMod>::Type_t
973{
974 return l.elem() % r.elem();
975}
976
977template<class T1, class T2 >
978inline typename BinaryReturn<RScalar<T1>, RScalar<T2>, OpBitwiseXor>::Type_t
980{
981 return l.elem() ^ r.elem();
982}
983
984template<class T1, class T2 >
985inline typename BinaryReturn<RScalar<T1>, RScalar<T2>, OpBitwiseAnd>::Type_t
987{
988 return l.elem() & r.elem();
989}
990
991template<class T1, class T2>
992inline typename BinaryReturn<RScalar<T1>, RScalar<T2>, OpBitwiseOr>::Type_t
994{
995 return l.elem() | r.elem();
996}
997
998
999
1000// Comparisons
1001template<class T1, class T2 >
1005
1006template<class T1, class T2>
1008operator<(const RScalar<T1>& l, const RScalar<T2>& r)
1009{
1010 return l.elem() < r.elem();
1011}
1012
1013
1014template<class T1, class T2 >
1018
1019template<class T1, class T2>
1021operator<=(const RScalar<T1>& l, const RScalar<T2>& r)
1022{
1023 return l.elem() <= r.elem();
1024}
1025
1026
1027template<class T1, class T2 >
1031
1032template<class T1, class T2>
1035{
1036 return l.elem() > r.elem();
1037}
1038
1039
1040template<class T1, class T2 >
1044
1045template<class T1, class T2>
1048{
1049 return l.elem() >= r.elem();
1050}
1051
1052
1053template<class T1, class T2 >
1057
1058template<class T1, class T2>
1061{
1062 return l.elem() == r.elem();
1063}
1064
1065
1066template<class T1, class T2 >
1070
1071template<class T1, class T2>
1074{
1075 return l.elem() != r.elem();
1076}
1077
1078
1079template<class T1, class T2>
1083
1084template<class T1, class T2>
1087{
1088 return l.elem() && r.elem();
1089}
1090
1091
1092template<class T1, class T2>
1096
1097template<class T1, class T2>
1100{
1101 return l.elem() || r.elem();
1102}
1103
1104
1105
1106//-----------------------------------------------------------------------------
1107// Functions
1108
1109// Adjoint
1110template<class T1>
1113{
1115
1116// return transpose(s1.elem()); // The complex nature has been eaten here
1117 return s1.elem(); // The complex nature has been eaten here
1118}
1119
1120
1121// Conjugate
1122template<class T1>
1125{
1126 return s1.elem(); // The complex nature has been eaten here
1127}
1128
1129
1130// Transpose
1131template<class T1>
1134{
1136
1137// return transpose(s1.elem());
1138 return s1.elem();
1139}
1140
1141
1142
1143// TRACE
1144// trace = Trace(source1)
1145template<class T>
1149
1150template<class T1>
1153{
1154// return trace(s1.elem());
1155
1157 return s1.elem();
1158}
1159
1160
1161// trace = Re(Trace(source1))
1162template<class T>
1166
1167template<class T1>
1170{
1171// return trace_real(s1.elem());
1172
1174 return s1.elem();
1175}
1176
1177
1178// trace = Im(Trace(source1))
1179template<class T>
1183
1184template<class T1>
1187{
1188// return trace_imag(s1.elem());
1189
1191 return s1.elem();
1192}
1193
1195template<class T1, class T2>
1196inline typename BinaryReturn<RScalar<T1>, RScalar<T2>, FnTraceMultiply>::Type_t
1198{
1199// return traceMultiply(l.elem(), r.elem());
1200
1202 return l.elem() * r.elem();
1203}
1204
1205
1206// RScalar = Re(RScalar) [identity]
1207template<class T>
1208inline typename UnaryReturn<RScalar<T>, FnReal>::Type_t
1210{
1211 return s1.elem();
1212}
1213
1214
1215// RScalar = Im(RScalar) [this is zero]
1216template<class T>
1217inline typename UnaryReturn<RScalar<T>, FnImag>::Type_t
1219{
1220 typedef typename InternalScalar<T>::Type_t S;
1221 return S(0);
1222}
1223
1224
1225// ArcCos
1226template<class T1>
1229{
1230 return acos(s1.elem());
1231}
1232
1233// ArcSin
1234template<class T1>
1237{
1238 return asin(s1.elem());
1239}
1240
1241// ArcTan
1242template<class T1>
1245{
1246 return atan(s1.elem());
1247}
1248
1249// Ceil(ing)
1250template<class T1>
1253{
1254 return ceil(s1.elem());
1255}
1256
1257// Cos
1258template<class T1>
1259inline typename UnaryReturn<RScalar<T1>, FnCos>::Type_t
1261{
1262 return cos(s1.elem());
1263}
1264
1265// Cosh
1266template<class T1>
1269{
1270 return cosh(s1.elem());
1271}
1272
1273// Exp
1274template<class T1>
1275inline typename UnaryReturn<RScalar<T1>, FnExp>::Type_t
1277{
1278 return exp(s1.elem());
1279}
1280
1281// Fabs
1282template<class T1>
1285{
1286 return fabs(s1.elem());
1287}
1288
1289// Floor
1290template<class T1>
1293{
1294 return floor(s1.elem());
1295}
1296
1297// Log
1298template<class T1>
1299inline typename UnaryReturn<RScalar<T1>, FnLog>::Type_t
1301{
1302 return log(s1.elem());
1303}
1304
1305// Log10
1306template<class T1>
1309{
1310 return log10(s1.elem());
1311}
1312
1313// Sin
1314template<class T1>
1315inline typename UnaryReturn<RScalar<T1>, FnSin>::Type_t
1317{
1318 return sin(s1.elem());
1319}
1320
1321// Sinh
1322template<class T1>
1325{
1326 return sinh(s1.elem());
1327}
1328
1329// Sqrt
1330template<class T1>
1333{
1334 return sqrt(s1.elem());
1335}
1336
1337// Tan
1338template<class T1>
1339inline typename UnaryReturn<RScalar<T1>, FnTan>::Type_t
1341{
1342 return tan(s1.elem());
1343}
1344
1345// Tanh
1346template<class T1>
1349{
1350 return tanh(s1.elem());
1351}
1352
1353
1354//-----------------------------------------------------------------------------
1355// These functions always return bool
1357//
1358
1359template<class T1>
1360inline bool
1362{
1363 return isnan(s1.elem());
1364}
1365
1367//
1368//
1369
1370template<class T1>
1371inline bool
1373{
1374 return isinf(s1.elem());
1375}
1376
1377
1378template<class T1>
1379inline bool
1381{
1382 return isnormal(s1.elem());
1383}
1384
1386
1387template<class T1>
1388inline bool
1390{
1391 return isfinite(s1.elem());
1392}
1393
1394
1395//-----------------------------------------------------------------------------
1397template<class T1, class T2>
1398inline typename BinaryReturn<RScalar<T1>, RScalar<T2>, FnPow>::Type_t
1399pow(const RScalar<T1>& s1, const RScalar<T2>& s2)
1400{
1401 return pow(s1.elem(), s2.elem());
1402}
1403
1405template<class T1, class T2>
1406inline typename BinaryReturn<RScalar<T1>, RScalar<T2>, FnArcTan2>::Type_t
1407atan2(const RScalar<T1>& s1, const RScalar<T2>& s2)
1408{
1409 return atan2(s1.elem(), s2.elem());
1410}
1411
1412
1414template<class T1, class T2>
1415inline typename BinaryReturn<RScalar<T1>, RScalar<T2>, FnOuterProduct>::Type_t
1417{
1418 return l.elem() * r.elem();
1419}
1420
1421
1423template<class T1>
1426{
1427 return seedToFloat(s1.elem());
1428}
1429
1431
1432template<class T>
1433inline typename UnaryReturn<RScalar<T>, FnGetSite>::Type_t
1434getSite(const RScalar<T>& s1, int innersite)
1435{
1436 return getSite(s1.elem(), innersite);
1437}
1438
1440
1441template<class T>
1442inline typename UnaryReturn<RScalar<T>, FnPeekColorVector>::Type_t
1443peekColor(const RScalar<T>& l, int row)
1444{
1445 return peekColor(l.elem(),row);
1446}
1447
1449
1450template<class T>
1451inline typename UnaryReturn<RScalar<T>, FnPeekColorMatrix>::Type_t
1452peekColor(const RScalar<T>& l, int row, int col)
1453{
1454 return peekColor(l.elem(),row,col);
1455}
1456
1458
1459template<class T>
1460inline typename UnaryReturn<RScalar<T>, FnPeekSpinVector>::Type_t
1461peekSpin(const RScalar<T>& l, int row)
1462{
1463 return peekSpin(l.elem(),row);
1464}
1465
1467
1468template<class T>
1469inline typename UnaryReturn<RScalar<T>, FnPeekSpinMatrix>::Type_t
1470peekSpin(const RScalar<T>& l, int row, int col)
1471{
1472 return peekSpin(l.elem(),row,col);
1473}
1474
1475//-----------------------------------------------------------------------------
1477template<class T>
1478inline int
1480{
1481 return toInt(s.elem());
1482}
1483
1485template<class T>
1486inline float
1488{
1489 return toFloat(s.elem());
1490}
1491
1493template<class T>
1494inline double
1496{
1497 return toDouble(s.elem());
1498}
1499
1501template<class T>
1502inline bool
1504{
1505 return toBool(s.elem());
1506}
1507
1509template<class T>
1510inline typename WordType< RScalar<T> >::Type_t
1512{
1513 return toWordType(s.elem());
1514}
1515
1516
1517
1518//------------------------------------------
1520template<class T, class T1>
1521inline
1522void copymask(RScalar<T>& d, const RScalar<T1>& mask, const RScalar<T>& s1)
1523{
1524 copymask(d.elem(),mask.elem(),s1.elem());
1525}
1526
1528template<class T, class T1>
1529inline
1530void cast_rep(T& d, const RScalar<T1>& s1)
1531{
1532 cast_rep(d, s1.elem());
1533}
1534
1535
1537template<class T, class T1>
1538inline
1540{
1541 cast_rep(d.elem(), s1.elem());
1542}
1543
1544
1546template<class T, class T1>
1547inline void
1548copy_site(RScalar<T>& d, int isite, const RScalar<T1>& s1)
1549{
1550 copy_site(d.elem(), isite, s1.elem());
1551}
1552
1553
1555template<class T, class T1>
1556inline void
1558 const RScalar<T1>& s0, int i0,
1559 const RScalar<T1>& s1, int i1,
1560 const RScalar<T1>& s2, int i2,
1561 const RScalar<T1>& s3, int i3)
1562{
1563 gather_sites(d.elem(),
1564 s0.elem(), i0,
1565 s1.elem(), i1,
1566 s2.elem(), i2,
1567 s3.elem(), i3);
1568}
1569
1570
1571#if 1
1572// Global sum over site indices only
1573template<class T>
1577
1578template<class T>
1579inline typename UnaryReturn<RScalar<T>, FnSum>::Type_t
1580sum(const RScalar<T>& s1)
1581{
1582 return sum(s1.elem());
1583}
1584#endif
1585
1586
1587// Global max
1588template<class T>
1592
1593template<class T>
1596{
1597 return globalMax(s1.elem());
1598}
1599
1600
1601// Global min
1602template<class T>
1606
1607template<class T>
1610{
1611 return globalMin(s1.elem());
1612}
1613
1614
1615
1616//------------------------------------------
1617template<class T>
1621
1622// InnerProduct (norm-seq) global sum = sum(tr(adj(s1)*s1))
1623template<class T>
1627
1628template<class T>
1632
1633template<class T>
1636{
1637 return localNorm2(s1.elem());
1638}
1639
1640
1641
1643template<class T1, class T2>
1647
1648template<class T1, class T2>
1652
1653template<class T1, class T2>
1656{
1657 return localInnerProduct(s1.elem(), s2.elem());
1658}
1659
1660
1662// Real-ness is eaten at this level
1663template<class T1, class T2>
1667
1668template<class T1, class T2>
1672
1673template<class T1, class T2>
1676{
1677 return localInnerProduct(s1.elem(), s2.elem());
1678}
1679
1680
1682template<class T1, class T2>
1686
1687template<class T1, class T2>
1690{
1691 return localColorInnerProduct(s1.elem(), s2.elem());
1692}
1693
1694
1696
1700template<class T1, class T2, class T3>
1704
1705template<class T1, class T2, class T3>
1707where(const RScalar<T1>& a, const RScalar<T2>& b, const RScalar<T3>& c)
1708{
1709 return where(a.elem(), b.elem(), c.elem());
1710}
1711
1712
1713
1714//-----------------------------------------------------------------------------
1715// Broadcast operations
1717template<class T>
1718inline
1720{
1721 zero_rep(dest.elem());
1722}
1723
1724
1726template<class T, class T1>
1727inline void
1728copy_site(RComplex<T>& d, int isite, const RComplex<T1>& s1)
1729{
1730 copy_site(d.real(), isite, s1.real());
1731 copy_site(d.imag(), isite, s1.imag());
1732}
1733
1734#if 0
1736template<class T, class T1>
1737inline void
1738copy_site(RComplex<T>& d, int isite, const RScalar<T1>& s1)
1739{
1740 copy_site(d.real(), isite, s1.elem());
1741 zero_rep(d.imag()); // this is wrong - want zero only at a site. Fix when needed.
1742}
1743#endif
1744
1745
1747template<class T, class T1>
1748inline void
1750 const RComplex<T1>& s0, int i0,
1751 const RComplex<T1>& s1, int i1,
1752 const RComplex<T1>& s2, int i2,
1753 const RComplex<T1>& s3, int i3)
1754{
1755 gather_sites(d.real(),
1756 s0.real(), i0,
1757 s1.real(), i1,
1758 s2.real(), i2,
1759 s3.real(), i3);
1760
1761 gather_sites(d.imag(),
1762 s0.imag(), i0,
1763 s1.imag(), i1,
1764 s2.imag(), i2,
1765 s3.imag(), i3);
1766}
1767
1768
1770template<class T, class T1, class T2>
1771inline void
1772fill_random(RScalar<T>& d, T1& seed, T2& skewed_seed, const T1& seed_mult)
1773{
1774 fill_random(d.elem(), seed, skewed_seed, seed_mult);
1775}
1776
1777
1778
1780
1781template<class T>
1782inline void
1784{
1785 typedef typename InternalScalar<T>::Type_t S;
1786
1787 // r1 and r2 are the input random numbers needed
1788
1789 /* Stage 2: get the cos of the second number */
1790 T g_r;
1791
1792 r2.elem() *= S(6.283185307);
1793 g_r = cos(r2.elem());
1794
1795 /* Stage 4: get sqrt(-2.0 * log(u1)) */
1796 r1.elem() = sqrt(-S(2.0) * log(r1.elem()));
1797
1798 /* Stage 5: g_r = sqrt(-2*log(u1))*cos(2*pi*u2) */
1799 /* Stage 5: g_i = sqrt(-2*log(u1))*sin(2*pi*u2) */
1800 d.elem() = r1.elem() * g_r;
1801}
1802 // end of group rscalar
1804
1805
1806
1807//-----------------------------------------------------------------------------
1808// Complex Reality
1809//-----------------------------------------------------------------------------
1810
1814
1816template<class T1>
1819{
1820 typedef typename UnaryReturn<RComplex<T1>, OpUnaryPlus>::Type_t Ret_t;
1821
1822 return Ret_t(+l.real(),
1823 +l.imag());
1824}
1825
1826
1828template<class T1>
1831{
1832 typedef typename UnaryReturn<RComplex<T1>, OpUnaryMinus>::Type_t Ret_t;
1833
1834 return Ret_t(-l.real(),
1835 -l.imag());
1836}
1837
1838
1840template<class T1, class T2>
1841inline typename BinaryReturn<RComplex<T1>, RComplex<T2>, OpAdd>::Type_t
1843{
1844 typedef typename BinaryReturn<RComplex<T1>, RComplex<T2>, OpAdd>::Type_t Ret_t;
1845
1846 return Ret_t(l.real()+r.real(),
1847 l.imag()+r.imag());
1848}
1849
1851template<class T1, class T2>
1852inline typename BinaryReturn<RComplex<T1>, RScalar<T2>, OpAdd>::Type_t
1854{
1855 typedef typename BinaryReturn<RComplex<T1>, RScalar<T2>, OpAdd>::Type_t Ret_t;
1856
1857 return Ret_t(l.real()+r.elem(),
1858 l.imag());
1859}
1860
1862template<class T1, class T2>
1863inline typename BinaryReturn<RScalar<T1>, RComplex<T2>, OpAdd>::Type_t
1865{
1866 typedef typename BinaryReturn<RScalar<T1>, RComplex<T2>, OpAdd>::Type_t Ret_t;
1867
1868 return Ret_t(l.elem()+r.real(),
1869 r.imag());
1870}
1871
1872
1874template<class T1, class T2>
1875inline typename BinaryReturn<RComplex<T1>, RComplex<T2>, OpSubtract>::Type_t
1877{
1879
1880 return Ret_t(l.real() - r.real(),
1881 l.imag() - r.imag());
1882}
1883
1885template<class T1, class T2>
1886inline typename BinaryReturn<RComplex<T1>, RScalar<T2>, OpSubtract>::Type_t
1888{
1890
1891 return Ret_t(l.real() - r.elem(),
1892 l.imag());
1893}
1894
1896template<class T1, class T2>
1897inline typename BinaryReturn<RScalar<T1>, RComplex<T2>, OpSubtract>::Type_t
1899{
1901
1902 return Ret_t(l.elem() - r.real(),
1903 - r.imag());
1904}
1905
1906
1908template<class T1, class T2>
1909inline typename BinaryReturn<RComplex<T1>, RComplex<T2>, OpMultiply>::Type_t
1910operator*(const RComplex<T1>& __restrict__ l, const RComplex<T2>& __restrict__ r)
1911{
1913
1914 return Ret_t(l.real()*r.real() - l.imag()*r.imag(),
1915 l.real()*r.imag() + l.imag()*r.real());
1916}
1917
1919template<class T1, class T2>
1920inline typename BinaryReturn<RScalar<T1>, RComplex<T2>, OpMultiply>::Type_t
1922{
1924
1925 return Ret_t(l.elem()*r.real(),
1926 l.elem()*r.imag());
1927}
1928
1930template<class T1, class T2>
1931inline typename BinaryReturn<RComplex<T1>, RScalar<T2>, OpMultiply>::Type_t
1933{
1935
1936 return Ret_t(l.real()*r.elem(),
1937 l.imag()*r.elem());
1938}
1939
1940
1941// Optimized adj(RComplex)*RComplex
1942template<class T1, class T2>
1943inline typename BinaryReturn<RComplex<T1>, RComplex<T2>, OpAdjMultiply>::Type_t
1945{
1947
1948 // The complex conjugate nature has been eaten here leaving simple multiples
1949 // involving transposes - which are probably null
1950
1951// d.real() = transpose(l.real())*r.real() + transpose(l.imag())*r.imag();
1952// d.imag() = transpose(l.real())*r.imag() - transpose(l.imag())*r.real();
1953// return d;
1954
1956 return Ret_t(l.real()*r.real() + l.imag()*r.imag(),
1957 l.real()*r.imag() - l.imag()*r.real());
1958}
1959
1960// Optimized RComplex*adj(RComplex)
1961template<class T1, class T2>
1962inline typename BinaryReturn<RComplex<T1>, RComplex<T2>, OpMultiplyAdj>::Type_t
1964{
1966
1967 // The complex conjugate nature has been eaten here leaving simple multiples
1968 // involving transposes - which are probably null
1969// d.real() = l.real()*transpose(r.real()) + l.imag()*transpose(r.imag());
1970// d.imag() = l.imag()*transpose(r.real()) - l.real()*transpose(r.imag());
1971// return d;
1972
1974 return Ret_t(l.real()*r.real() + l.imag()*r.imag(),
1975 l.imag()*r.real() - l.real()*r.imag());
1976}
1977
1978// Optimized adj(RComplex)*adj(RComplex)
1979template<class T1, class T2>
1980inline typename BinaryReturn<RComplex<T1>, RComplex<T2>, OpAdjMultiplyAdj>::Type_t
1982{
1984
1985 // The complex conjugate nature has been eaten here leaving simple multiples
1986 // involving transposes - which are probably null
1987// d.real() = transpose(l.real())*transpose(r.real()) - transpose(l.imag())*transpose(r.imag());
1988// d.imag() = -(transpose(l.real())*transpose(r.imag()) + transpose(l.imag())*transpose(r.real()));
1989// return d;
1990
1992 return Ret_t(l.real()*r.real() - l.imag()*r.imag(),
1993 -(l.real()*r.imag() + l.imag()*r.real()));
1994}
1995
1996
1998template<class T1, class T2>
1999inline typename BinaryReturn<RComplex<T1>, RComplex<T2>, OpDivide>::Type_t
2001{
2003
2004 T2 tmp = T2(1.0) / (r.real()*r.real() + r.imag()*r.imag());
2005
2006 return Ret_t((l.real()*r.real() + l.imag()*r.imag()) * tmp,
2007 (l.imag()*r.real() - l.real()*r.imag()) * tmp);
2008}
2009
2011template<class T1, class T2>
2012inline typename BinaryReturn<RComplex<T1>, RScalar<T2>, OpDivide>::Type_t
2014{
2015 typedef typename BinaryReturn<RComplex<T1>, RScalar<T2>, OpDivide>::Type_t Ret_t;
2016
2017 T2 tmp = T2(1.0) / r.elem();
2018
2019 return Ret_t(l.real() * tmp,
2020 l.imag() * tmp);
2021}
2022
2024template<class T1, class T2>
2025inline typename BinaryReturn<RScalar<T1>, RComplex<T2>, OpDivide>::Type_t
2027{
2028 typedef typename BinaryReturn<RScalar<T1>, RComplex<T2>, OpDivide>::Type_t Ret_t;
2029
2030 T2 tmp = T2(1.0) / (r.real()*r.real() + r.imag()*r.imag());
2031
2032 return Ret_t(l.elem() * r.real() * tmp,
2033 -l.elem() * r.imag() * tmp);
2034}
2035
2036
2037
2038//-----------------------------------------------------------------------------
2039// These functions always return bool
2041template<class T1>
2042inline bool
2044{
2045 return isnan(s1.real()) | isnan(s1.imag());
2046}
2047
2049template<class T1>
2050inline bool
2052{
2053 return isinf(s1.real()) | isinf(s1.imag());
2054}
2055
2057template<class T1>
2058inline bool
2060{
2061 return isnormal(s1.real()) & isnormal(s1.imag());
2062}
2063
2065template<class T1>
2066inline bool
2068{
2069 return isfinite(s1.real()) & isfinite(s1.imag());
2070}
2071
2072
2073//-----------------------------------------------------------------------------
2074// Functions
2075
2076// Adjoint
2077template<class T1>
2080{
2081 typedef typename UnaryReturn<RComplex<T1>, FnAdjoint>::Type_t Ret_t;
2082
2083 // The complex conjugate nature has been eaten here leaving transpose
2084// d.real() = transpose(l.real());
2085// d.imag() = -transpose(l.imag());
2086// return d;
2087
2089 return Ret_t(l.real(),
2090 -l.imag());
2091}
2092
2093// Conjugate
2094template<class T1>
2097{
2098 typedef typename UnaryReturn<RComplex<T1>, FnConjugate>::Type_t Ret_t;
2099
2100 return Ret_t(l.real(),
2101 -l.imag());
2102}
2103
2104// Transpose
2105template<class T1>
2108{
2109 typedef typename UnaryReturn<RComplex<T1>, FnTranspose>::Type_t Ret_t;
2110
2111// d.real() = transpose(l.real());
2112// d.imag() = transpose(l.imag());
2113// return d;
2114
2116 return Ret_t(l.real(),
2117 l.imag());
2118}
2119
2120// TRACE
2121// trace = Trace(source1)
2122template<class T>
2126
2127template<class T1>
2130{
2131 typedef typename UnaryReturn<RComplex<T1>, FnTrace>::Type_t Ret_t;
2132
2134 return Ret_t(s1.real(),
2135 s1.imag());
2136}
2137
2138
2139// trace = Re(Trace(source1))
2140template<class T>
2144
2145template<class T1>
2148{
2150 return s1.real();
2151}
2152
2153
2154// trace = Im(Trace(source1))
2155template<class T>
2159
2160template<class T1>
2163{
2165 return s1.imag();
2166}
2167
2169template<class T1, class T2>
2170inline typename BinaryReturn<RComplex<T1>, RComplex<T2>, OpMultiply>::Type_t
2172{
2173// return traceMultiply(l.elem(), r.elem());
2174
2177
2178 return Ret_t(l.real()*r.real() - l.imag()*r.imag(),
2179 l.real()*r.imag() + l.imag()*r.real());
2180}
2181
2182
2183// RScalar = Re(RComplex)
2184template<class T>
2188
2189template<class T1>
2192{
2193 return s1.real();
2194}
2195
2196// RScalar = Im(RComplex)
2197template<class T>
2201
2202template<class T1>
2205{
2206 return s1.imag();
2207}
2208
2209
2211template<class T1, class T2>
2215
2216template<class T1, class T2>
2218cmplx(const RScalar<T1>& s1, const RScalar<T2>& s2)
2219{
2220 typedef typename BinaryReturn<RScalar<T1>, RScalar<T2>, FnCmplx>::Type_t Ret_t;
2221
2222 return Ret_t(s1.elem(),
2223 s2.elem());
2224}
2225
2226
2227
2228// RComplex = i * RScalar
2229template<class T>
2233
2234template<class T>
2237{
2239
2240 zero_rep(d.real());
2241 d.imag() = s1.elem();
2242 return d;
2243}
2244
2245// RComplex = i * RComplex
2246template<class T>
2249{
2250 typedef typename UnaryReturn<RComplex<T>, FnTimesI>::Type_t Ret_t;
2251
2252 return Ret_t(-s1.imag(),
2253 s1.real());
2254}
2255
2256
2257// RComplex = -i * RScalar
2258template<class T>
2262
2263template<class T>
2266{
2268
2269 zero_rep(d.real());
2270 d.imag() = -s1.elem();
2271 return d;
2272}
2273
2274
2275// RComplex = -i * RComplex
2276template<class T>
2279{
2280 typedef typename UnaryReturn<RComplex<T>, FnTimesMinusI>::Type_t Ret_t;
2281
2282 return Ret_t(s1.imag(),
2283 -s1.real());
2284}
2285
2286
2288template<class T1, class T2>
2289inline typename BinaryReturn<RComplex<T1>, RComplex<T2>, FnOuterProduct>::Type_t
2291{
2293
2294 // Return l*conj(r)
2295 return Ret_t(l.real()*r.real() + l.imag()*r.imag(),
2296 l.imag()*r.real() - l.real()*r.imag());
2297}
2298
2300template<class T1, class T2>
2301inline typename BinaryReturn<RComplex<T1>, RScalar<T2>, FnOuterProduct>::Type_t
2303{
2305
2306 // Return l*conj(r)
2307 return Ret_t(l.real()*r.elem(),
2308 l.imag()*r.elem());
2309}
2310
2312template<class T1, class T2>
2313inline typename BinaryReturn<RScalar<T1>, RComplex<T2>, FnOuterProduct>::Type_t
2315{
2317
2318 // Return l*conj(r)
2319 return Ret_t( l.elem()*r.real(),
2320 -l.elem()*r.imag());
2321}
2322
2323
2325
2326template<class T>
2327inline typename UnaryReturn<RComplex<T>, FnGetSite>::Type_t
2328getSite(const RComplex<T>& s1, int innersite)
2329{
2330 typedef typename UnaryReturn<RComplex<T>, FnGetSite>::Type_t Ret_t;
2331
2332 return Ret_t(getSite(s1.real(), innersite),
2333 getSite(s1.imag(), innersite));
2334}
2335
2336
2338template<class T, class T1>
2339inline
2340void copymask(RComplex<T>& d, const RScalar<T1>& mask, const RComplex<T>& s1)
2341{
2342 copymask(d.real(),mask.elem(),s1.real());
2343 copymask(d.imag(),mask.elem(),s1.imag());
2344}
2345
2346
2347#if 1
2348// Global sum over site indices only
2349template<class T>
2353
2354template<class T>
2355inline typename UnaryReturn<RComplex<T>, FnSum>::Type_t
2357{
2358 typedef typename UnaryReturn<RComplex<T>, FnSum>::Type_t Ret_t;
2359
2360 return Ret_t(sum(s1.real()),
2361 sum(s1.imag()));
2362}
2363#endif
2364
2365
2366// Sum
2367template<class T>
2371
2372// InnerProduct (norm-seq) global sum = sum(tr(adj(s1)*s1))
2373template<class T>
2377
2378template<class T>
2382
2383template<class T>
2386{
2387 return localNorm2(s1.real()) + localNorm2(s1.imag());
2388}
2389
2390
2391
2393template<class T1, class T2>
2397
2398template<class T1, class T2>
2402
2403template<class T1, class T2>
2406{
2408
2409 return Ret_t(localInnerProduct(l.real(),r.real()) + localInnerProduct(l.imag(),r.imag()),
2411}
2412
2413
2415// Real-ness is eaten at this level
2416template<class T1, class T2>
2420
2421template<class T1, class T2>
2425
2426template<class T1, class T2>
2429{
2430 return localInnerProduct(l.real(),r.real()) + localInnerProduct(l.imag(),r.imag());
2431}
2432
2433
2435template<class T1, class T2>
2439
2440template<class T1, class T2>
2449
2450
2451
2453
2457template<class T1, class T2, class T3>
2461
2462template<class T1, class T2, class T3>
2464where(const RScalar<T1>& a, const RComplex<T2>& b, const RComplex<T3>& c)
2465{
2467
2468 // Not optimal - want to have where outside assignment
2469 return Ret_t(where(a.elem(), b.real(), c.real()),
2470 where(a.elem(), b.imag(), c.imag()));
2471}
2472
2474
2478template<class T1, class T2, class T3>
2482
2483template<class T1, class T2, class T3>
2485where(const RScalar<T1>& a, const RComplex<T2>& b, const RScalar<T3>& c)
2486{
2488 typedef typename InternalScalar<T3>::Type_t S;
2489
2490 // Not optimal - want to have where outside assignment
2491 return Ret_t(where(a.elem(), b.real(), c.real()),
2492 where(a.elem(), b.imag(), S(0)));
2493}
2494
2496
2500template<class T1, class T2, class T3>
2504
2505template<class T1, class T2, class T3>
2507where(const RScalar<T1>& a, const RScalar<T2>& b, const RComplex<T3>& c)
2508{
2510 typedef typename InternalScalar<T2>::Type_t S;
2511
2512 // Not optimal - want to have where outside assignment
2513 return Ret_t(where(a.elem(), b.real(), c.real()),
2514 where(a.elem(), S(0), c.imag()));
2515}
2516
2517
2518//-----------------------------------------------------------------------------
2519// Broadcast operations
2521template<class T>
2522inline
2524{
2525 zero_rep(dest.real());
2526 zero_rep(dest.imag());
2527}
2528
2529
2531template<class T, class T1, class T2>
2532inline void
2533fill_random(RComplex<T>& d, T1& seed, T2& skewed_seed, const T1& seed_mult)
2534{
2535 fill_random(d.real(), seed, skewed_seed, seed_mult);
2536 fill_random(d.imag(), seed, skewed_seed, seed_mult);
2537}
2538
2539
2541
2542template<class T>
2543inline void
2545{
2546 typedef typename InternalScalar<T>::Type_t S;
2547
2548 // r1 and r2 are the input random numbers needed
2549
2550 /* Stage 2: get the cos of the second number */
2551 T g_r, g_i;
2552
2553 r2.real() *= S(6.283185307);
2554 g_r = cos(r2.real());
2555 g_i = sin(r2.real());
2556
2557 /* Stage 4: get sqrt(-2.0 * log(u1)) */
2558 r1.real() = sqrt(-S(2.0) * log(r1.real()));
2559
2560 /* Stage 5: g_r = sqrt(-2*log(u1))*cos(2*pi*u2) */
2561 /* Stage 5: g_i = sqrt(-2*log(u1))*sin(2*pi*u2) */
2562 d.real() = r1.real() * g_r;
2563 d.imag() = r1.real() * g_i;
2564}
2565 // end of group rcomplex
2567
2568} // namespace QDP
2569
2570#endif
Reality complex.
RComplex & operator=(const RComplex< T1 > &rhs)
RComplex = RComplex.
const T & real() const
RComplex(const T1 &_re, const T2 &_im)
Construct from two scalars.
RComplex & operator-=(const RComplex< T1 > &rhs)
RComplex -= RComplex.
RComplex(const RScalar< T1 > &_re, const RScalar< T2 > &_im)
Construct from two reality scalars.
RComplex & operator-=(const RScalar< T1 > &rhs)
RComplex -= RScalar.
RComplex & operator*=(const RComplex< T1 > &rhs)
RComplex *= RComplex.
RComplex & operator/=(const RComplex< T1 > &rhs)
RComplex /= RComplex.
RComplex & operator/=(const RScalar< T1 > &rhs)
RComplex /= RScalar.
RComplex & operator+=(const RComplex< T1 > &rhs)
RComplex += RComplex.
const T & imag() const
RComplex & operator*=(const RScalar< T1 > &rhs)
RComplex *= RScalar.
RComplex & operator=(const RScalar< T1 > &rhs)
RComplex = RScalar.
RComplex & operator+=(const RScalar< T1 > &rhs)
RComplex += RScalar.
RComplex(const RComplex &a)
Deep copy constructor.
Scalar reality (not complex).
Definition qdp_reality.h:28
RScalar & operator=(const RScalar< T1 > &rhs)
RScalar = RScalar.
Definition qdp_reality.h:61
RScalar(const T1 &rhs)
construct dest = rhs
Definition qdp_reality.h:43
RScalar(const typename WordType< T >::Type_t &rhs)
construct dest = const
Definition qdp_reality.h:35
RScalar & operator<<=(const RScalar< T1 > &rhs)
RScalar <<= RScalar.
RScalar & operator*=(const RScalar< T1 > &rhs)
RScalar *= RScalar.
Definition qdp_reality.h:88
RScalar(const RScalar &a)
Do deep copies here.
RScalar & operator|=(const RScalar< T1 > &rhs)
RScalar |= RScalar.
RScalar(const RScalar< T1 > &rhs)
construct dest = rhs
Definition qdp_reality.h:39
RScalar & operator%=(const RScalar< T1 > &rhs)
RScalar %= RScalar.
RScalar & operator&=(const RScalar< T1 > &rhs)
RScalar &= RScalar.
RScalar & operator-=(const RScalar< T1 > &rhs)
RScalar -= RScalar.
Definition qdp_reality.h:79
RScalar & operator^=(const RScalar< T1 > &rhs)
RScalar ^= RScalar.
RScalar & operator+=(const RScalar< T1 > &rhs)
RScalar += RScalar.
Definition qdp_reality.h:70
const T & elem() const
RScalar & operator/=(const RScalar< T1 > &rhs)
RScalar /= RScalar.
Definition qdp_reality.h:97
RScalar & operator>>=(const RScalar< T1 > &rhs)
RScalar >>= RScalar.
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).
bool isnan(const QDPExpr< T, C > &s1)
bool = isnan(source)
bool isfinite(const QDPExpr< T, C > &s1)
bool = isfinite(source)
bool isnormal(const QDPExpr< T, C > &s1)
bool = isnormal(source)
bool isinf(const QDPExpr< T, C > &s1)
bool = isinf(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
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
BinaryReturn< PMatrix< T1, N, C >, PMatrix< T2, N, C >, FnTraceMultiply >::Type_t traceMultiply(const PMatrix< T1, N, C > &l, const PMatrix< T2, N, C > &r)
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< UnaryNode< FnTimesMinusI, typenameCreateLeaf< QDPExpr< T1, C1 > >::Leaf_t >, typenameUnaryReturn< C1, FnTimesMinusI >::Type_t >::Expression_t timesMinusI(const QDPExpr< T1, C1 > &l)
Definition qdp.h:5024
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< UnaryNode< FnPeekColorMatrix, typenameCreateLeaf< QDPExpr< T1, C1 > >::Leaf_t >, C1 >::Expression_t peekColor(const QDPExpr< T1, C1 > &l, int row, int col)
Definition qdp_newops.h:161
MakeReturn< UnaryNode< FnHypSin, typenameCreateLeaf< QDPExpr< T1, C1 > >::Leaf_t >, typenameUnaryReturn< C1, FnHypSin >::Type_t >::Expression_t sinh(const QDPExpr< T1, C1 > &l)
Definition qdp.h:5440
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< FnTimesI, typenameCreateLeaf< QDPExpr< T1, C1 > >::Leaf_t >, typenameUnaryReturn< C1, FnTimesI >::Type_t >::Expression_t timesI(const QDPExpr< T1, C1 > &l)
Definition qdp.h:5011
MakeReturn< UnaryNode< FnHypTan, typenameCreateLeaf< QDPExpr< T1, C1 > >::Leaf_t >, typenameUnaryReturn< C1, FnHypTan >::Type_t >::Expression_t tanh(const QDPExpr< T1, C1 > &l)
Definition qdp.h:5479
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< FnRealTrace, typenameCreateLeaf< QDPExpr< T1, C1 > >::Leaf_t >, typenameUnaryReturn< C1, FnRealTrace >::Type_t >::Expression_t realTrace(const QDPExpr< T1, C1 > &l)
Definition qdp.h:4920
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< FnLocalInnerProductReal, typenameCreateLeaf< QDPType< T1, C1 > >::Leaf_t, typenameCreateLeaf< QDPExpr< T2, C2 > >::Leaf_t >, typenameBinaryReturn< C1, C2, FnLocalInnerProductReal >::Type_t >::Expression_t localInnerProductReal(const QDPType< T1, C1 > &l, const QDPExpr< T2, C2 > &r)
Definition qdp.h:2428
MakeReturn< UnaryNode< FnHypCos, typenameCreateLeaf< QDPExpr< T1, C1 > >::Leaf_t >, typenameUnaryReturn< C1, FnHypCos >::Type_t >::Expression_t cosh(const QDPExpr< T1, C1 > &l)
Definition qdp.h:5349
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< FnFloor, typenameCreateLeaf< QDPExpr< T1, C1 > >::Leaf_t >, typenameUnaryReturn< C1, FnFloor >::Type_t >::Expression_t floor(const QDPExpr< T1, C1 > &l)
Definition qdp.h:5388
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< UnaryNode< FnPeekSpinMatrix, typenameCreateLeaf< QDPExpr< T1, C1 > >::Leaf_t >, C1 >::Expression_t peekSpin(const QDPExpr< T1, C1 > &l, int row, int col)
Definition qdp_newops.h:258
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< UnaryNode< FnLog10, typenameCreateLeaf< QDPExpr< T1, C1 > >::Leaf_t >, typenameUnaryReturn< C1, FnLog10 >::Type_t >::Expression_t log10(const QDPExpr< T1, C1 > &l)
Definition qdp.h:5414
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< FnCmplx, typenameCreateLeaf< QDPType< T1, C1 > >::Leaf_t, typenameCreateLeaf< QDPExpr< T2, C2 > >::Leaf_t >, typenameBinaryReturn< C1, C2, FnCmplx >::Type_t >::Expression_t cmplx(const QDPType< T1, C1 > &l, const QDPExpr< T2, C2 > &r)
Definition qdp.h:2348
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< FnCeil, typenameCreateLeaf< QDPExpr< T1, C1 > >::Leaf_t >, typenameUnaryReturn< C1, FnCeil >::Type_t >::Expression_t ceil(const QDPExpr< T1, C1 > &l)
Definition qdp.h:5323
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< UnaryNode< FnImagTrace, typenameCreateLeaf< QDPExpr< T1, C1 > >::Leaf_t >, typenameUnaryReturn< C1, FnImagTrace >::Type_t >::Expression_t imagTrace(const QDPExpr< T1, C1 > &l)
Definition qdp.h:4933
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
#define QDP_ALIGN8
Definition qdp.h:60
RComplex< typename UnaryReturn< T2, OpUnaryPlus >::Type_t > Type_t
RScalar< typename UnaryReturn< T2, OpUnaryPlus >::Type_t > Type_t
RComplex< typename UnaryReturn< T2, OpUnaryPlus >::Type_t > Type_t
RScalar< typename UnaryReturn< T2, OpUnaryPlus >::Type_t > Type_t
RComplex< typename UnaryReturn< T2, OpUnaryPlus >::Type_t > Type_t
RScalar< typename UnaryReturn< T2, OpUnaryPlus >::Type_t > Type_t
RComplex< typename UnaryReturn< T2, OpUnaryPlus >::Type_t > Type_t
RScalar< typename UnaryReturn< T2, OpUnaryPlus >::Type_t > Type_t
RScalar< typename BinaryReturn< T1, T2, FnInnerProduct >::Type_t > Type_t
RComplex< typename BinaryReturn< T1, T2, FnInnerProduct >::Type_t > Type_t
RComplex< typename BinaryReturn< T1, T2, FnLocalColorInnerProduct >::Type_t > Type_t
RScalar< typename BinaryReturn< T1, T2, FnLocalInnerProduct >::Type_t > Type_t
RComplex< typename BinaryReturn< T1, T2, FnLocalInnerProduct >::Type_t > Type_t
RComplex< typename BinaryReturn< T1, T2, OpAddAssign >::Type_t > Type_t
RComplex< typename BinaryReturn< T1, T2, OpAssign >::Type_t > Type_t
RComplex< typename BinaryReturn< T1, T2, OpBitwiseAndAssign >::Type_t > Type_t
RComplex< typename BinaryReturn< T1, T2, OpBitwiseOrAssign >::Type_t > Type_t
RComplex< typename BinaryReturn< T1, T2, OpBitwiseXorAssign >::Type_t > Type_t
RComplex< typename BinaryReturn< T1, T2, OpDivideAssign >::Type_t > Type_t
RComplex< typename BinaryReturn< T1, T2, OpLeftShiftAssign >::Type_t > Type_t
RComplex< typename BinaryReturn< T1, T2, OpModAssign >::Type_t > Type_t
RComplex< typename BinaryReturn< T1, T2, OpMultiplyAssign >::Type_t > Type_t
RComplex< typename BinaryReturn< T1, T2, OpRightShiftAssign >::Type_t > Type_t
RComplex< typename BinaryReturn< T1, T2, OpSubtractAssign >::Type_t > Type_t
RComplex< typename BinaryReturn< T1, T2, Op >::Type_t > Type_t
RComplex< typename BinaryReturn< T1, T2, Op >::Type_t > Type_t
RComplex< typename UnaryReturn< T2, OpUnaryPlus >::Type_t > Type_t
RComplex< typename UnaryReturn< T2, OpUnaryPlus >::Type_t > Type_t
RComplex< typename UnaryReturn< T2, OpUnaryPlus >::Type_t > Type_t
RComplex< typename UnaryReturn< T2, OpUnaryPlus >::Type_t > Type_t
RComplex< typename BinaryReturn< T1, T2, Op >::Type_t > Type_t
RComplex< typename BinaryReturn< T1, T2, FnCmplx >::Type_t > Type_t
RScalar< typename BinaryReturn< T1, T2, FnInnerProduct >::Type_t > Type_t
RScalar< typename BinaryReturn< T1, T2, FnInnerProduct >::Type_t > Type_t
RScalar< typename BinaryReturn< T1, T2, FnLocalColorInnerProduct >::Type_t > Type_t
RScalar< typename BinaryReturn< T1, T2, FnLocalInnerProduct >::Type_t > Type_t
RScalar< typename BinaryReturn< T1, T2, FnLocalInnerProduct >::Type_t > Type_t
RScalar< typename BinaryReturn< T1, T2, OpAddAssign >::Type_t > Type_t
RScalar< typename BinaryReturn< T1, T2, OpAnd >::Type_t > Type_t
RScalar< typename BinaryReturn< T1, T2, OpBitwiseAndAssign >::Type_t > Type_t
RScalar< typename BinaryReturn< T1, T2, OpBitwiseOrAssign >::Type_t > Type_t
RScalar< typename BinaryReturn< T1, T2, OpBitwiseXorAssign >::Type_t > Type_t
RScalar< typename BinaryReturn< T1, T2, OpDivideAssign >::Type_t > Type_t
RScalar< typename BinaryReturn< T1, T2, OpEQ >::Type_t > Type_t
RScalar< typename BinaryReturn< T1, T2, OpGE >::Type_t > Type_t
RScalar< typename BinaryReturn< T1, T2, OpGT >::Type_t > Type_t
RScalar< typename BinaryReturn< T1, T2, OpLE >::Type_t > Type_t
RScalar< typename BinaryReturn< T1, T2, OpLT >::Type_t > Type_t
RScalar< typename BinaryReturn< T1, T2, OpLeftShiftAssign >::Type_t > Type_t
RScalar< typename BinaryReturn< T1, T2, OpLeftShift >::Type_t > Type_t
RScalar< typename BinaryReturn< T1, T2, OpModAssign >::Type_t > Type_t
RScalar< typename BinaryReturn< T1, T2, OpMultiplyAssign >::Type_t > Type_t
RScalar< typename BinaryReturn< T1, T2, OpNE >::Type_t > Type_t
RScalar< typename BinaryReturn< T1, T2, OpOr >::Type_t > Type_t
RScalar< typename BinaryReturn< T1, T2, OpRightShiftAssign >::Type_t > Type_t
RScalar< typename BinaryReturn< T1, T2, OpRightShift >::Type_t > Type_t
RScalar< typename BinaryReturn< T1, T2, OpSubtractAssign >::Type_t > Type_t
RScalar< typename BinaryReturn< T1, T2, Op >::Type_t > Type_t
RScalar< typename UnaryReturn< T2, OpUnaryPlus >::Type_t > Type_t
RScalar< typename UnaryReturn< T2, OpUnaryPlus >::Type_t > Type_t
RScalar< typename UnaryReturn< T2, OpUnaryPlus >::Type_t > Type_t
RScalar< typename UnaryReturn< T2, OpUnaryPlus >::Type_t > Type_t
RComplex< typename DoublePrecType< T >::Type_t > Type_t
RScalar< typename DoublePrecType< T >::Type_t > Type_t
RScalar< typename InternalScalar< T >::Type_t > Type_t
RScalar< typename InternalScalar< T >::Type_t > Type_t
Construct simple word type used at some level within primitives.
Definition qdp_traits.h:98
RComplex< typename LatticeScalar< T >::Type_t > Type_t
RScalar< typename LatticeScalar< T >::Type_t > Type_t
Makes a lattice scalar leaving primitive indices alone.
Definition qdp_traits.h:108
RScalar< typename PrimitiveScalar< T >::Type_t > Type_t
RScalar< typename PrimitiveScalar< T >::Type_t > Type_t
Makes a primitive scalar leaving grid alone.
Definition qdp_traits.h:103
RScalar< typename RealScalar< T >::Type_t > Type_t
RScalar< typename RealScalar< T >::Type_t > Type_t
Construct simple word type used at some level within primitives.
Definition qdp_traits.h:113
RComplex< typename SinglePrecType< T >::Type_t > Type_t
RScalar< typename SinglePrecType< T >::Type_t > Type_t
RComplex< typename TrinaryReturn< T1, T2, T3, FnColorContract >::Type_t > Type_t
RComplex< typename TrinaryReturn< T1, T2, T3, FnWhere >::Type_t > Type_t
RComplex< typename TrinaryReturn< T1, T2, T3, FnWhere >::Type_t > Type_t
RComplex< typename TrinaryReturn< T1, T2, T3, FnWhere >::Type_t > Type_t
RScalar< typename TrinaryReturn< T1, T2, T3, FnColorContract >::Type_t > Type_t
RScalar< typename TrinaryReturn< T1, T2, T3, FnWhere >::Type_t > Type_t
RComplex< typename UnaryReturn< T1, Op >::Type_t > Type_t
RScalar< typename UnaryReturn< T, FnImagTrace >::Type_t > Type_t
RScalar< typename UnaryReturn< T, FnImag >::Type_t > Type_t
RScalar< typename UnaryReturn< T, FnLocalNorm2 >::Type_t > Type_t
RScalar< typename UnaryReturn< T, FnNorm2 >::Type_t > Type_t
RScalar< typename UnaryReturn< T, FnRealTrace >::Type_t > Type_t
RScalar< typename UnaryReturn< T, FnReal >::Type_t > Type_t
RComplex< typename UnaryReturn< T, FnSumMulti >::Type_t > Type_t
RComplex< typename UnaryReturn< T, FnSum >::Type_t > Type_t
RComplex< typename UnaryReturn< T, FnTrace >::Type_t > Type_t
RScalar< typename UnaryReturn< T1, Op >::Type_t > Type_t
RScalar< typename UnaryReturn< T, FnGlobalMax >::Type_t > Type_t
RScalar< typename UnaryReturn< T, FnGlobalMin >::Type_t > Type_t
RScalar< typename UnaryReturn< T, FnImagTrace >::Type_t > Type_t
RScalar< typename UnaryReturn< T, FnLocalNorm2 >::Type_t > Type_t
RScalar< typename UnaryReturn< T, FnNorm2 >::Type_t > Type_t
RScalar< typename UnaryReturn< T, FnRealTrace >::Type_t > Type_t
RScalar< typename UnaryReturn< T, FnSumMulti >::Type_t > Type_t
RScalar< typename UnaryReturn< T, FnSum >::Type_t > Type_t
RComplex< typename UnaryReturn< T, FnTimesI >::Type_t > Type_t
RComplex< typename UnaryReturn< T, FnTimesMinusI >::Type_t > Type_t
RScalar< typename UnaryReturn< T, FnTrace >::Type_t > Type_t
RScalar< typename UnaryReturn< T, OpNot >::Type_t > Type_t
WordType< T >::Type_t Type_t
WordType< T >::Type_t Type_t
Find the underlying word type of a field.
Definition qdp_traits.h:29