QDP++
qdp_traits.h
Go to the documentation of this file.
1// -*- C++ -*-
2
8
9#ifndef QDP_TRAITS_H
10#define QDP_TRAITS_H
11
12namespace QDP {
13
14//-----------------------------------------------------------------------------
15// Traits class for returning the subset-ted class name of a outer grid class
16//-----------------------------------------------------------------------------
17
18template<class T>
20
21//-----------------------------------------------------------------------------
22// Traits classes to support operations of simple scalars (floating constants,
23// etc.) on QDPTypes
24//-----------------------------------------------------------------------------
25
27template<class T>
29{
30 typedef T Type_t;
31};
32
33
34//-----------------------------------------------------------------------------
35// Traits Classes to support getting fixed precision versions of floating
36// precision classes
37// ----------------------------------------------------------------------------
38template<class T>
40{
41 typedef T Type_t; // This should never be instantiated as such
42};
43
44template<class T>
46{
47 typedef T Type_t; // This should never be instantiated as such
48};
49
50// Now we need to specialise to the bit whose precisions float
51// The single prec types for both REAL32 and REAL64 are REAL32
52template<>
54{
55 typedef REAL32 Type_t;
56};
57
58template<>
60{
61 typedef REAL32 Type_t;
62};
63
64// The Double prec types for both REAL32 and REAL64 are REAL64
65template<>
67{
68 typedef REAL64 Type_t;
69};
70
71template<>
73{
74 typedef REAL64 Type_t;
75};
76
77 template<typename T>
82
83
84
85
86
87//-----------------------------------------------------------------------------
88// Constructors for simple word types
89//-----------------------------------------------------------------------------
90
92template<class T>
93struct SimpleScalar {};
94
95
97template<class T>
99
100
102template<class T>
104
105
107template<class T>
109
110
112template<class T>
113struct RealScalar {};
114
115
117template<class T>
118struct NoComplex {};
119
120
122struct Zero {};
123
125namespace {
126 Zero zero;
127}
128
129} // namespace QDP
130
131#endif
132
Container for a multi-dimensional 1D array.
Definition qdp_multi.h:25
double REAL64
Yet another random number generator.
multi1d< typename DoublePrecType< T >::Type_t > Type_t
Definition qdp_traits.h:80
Construct simple word type used at some level within primitives.
Definition qdp_traits.h:98
Makes a lattice scalar leaving primitive indices alone.
Definition qdp_traits.h:108
Construct primitive type of input but always RScalar complex type.
Definition qdp_traits.h:118
Makes a primitive scalar leaving grid alone.
Definition qdp_traits.h:103
Construct simple word type used at some level within primitives.
Definition qdp_traits.h:113
Construct simple word type. Default behavior is empty.
Definition qdp_traits.h:93
Find the underlying word type of a field.
Definition qdp_traits.h:29
Simple zero tag.
Definition qdp_traits.h:122