CNORXZ
Container with Native Operation Routines and Expressions
Loading...
Searching...
No Matches
types.h
Go to the documentation of this file.
1// -*- C++ -*-
14#ifndef __cxz_types_h__
15#define __cxz_types_h__
16
17#include <string>
18#include <vector>
19#include <memory>
20#include <tuple>
21#include <complex>
22#include <array>
23#include <map>
24#include <typeinfo>
25#include <utility>
26#include <numeric>
27#include <cstdint>
28
29namespace CNORXZ
30{
31 /*====================+
32 | standard types |
33 =====================*/
34
35 typedef std::intptr_t PtrId;
36 typedef int32_t Int;
37 typedef int64_t LInt;
38 typedef uint64_t SizeT;
39 typedef double Double;
40 typedef Double Real;
41 typedef std::complex<Real> Complex;
42 typedef std::string String;
43
44 template <typename T, size_t N>
45 using Arr = std::array<T,N>;
46
47 template <typename T>
48 using Sptr = std::shared_ptr<T>;
49
50 template <typename T>
51 using Wptr = std::weak_ptr<T>;
52
53 template <typename T>
54 using Uptr = std::unique_ptr<T>;
55
56 template <typename T, typename U>
57 using Pair = std::pair<T,U>;
58
59 template <typename... T>
60 using Tuple = std::tuple<T...>;
61
62 template <SizeT I, typename... T>
63 using TupleElem = std::tuple_element<I,Tuple<T...>>;
64
65 template <typename T>
66 using RemoveRef = typename std::remove_reference<T>::type;
67
68 template <typename K, typename V>
69 using Map = std::map<K,V>;
70
71 typedef std::type_info TypeInfo;
72
73 template <SizeT... Is>
74 using Isq = std::index_sequence<Is...>;
75 // cxz helper functions/classes: -> isq.h
76
77 template <class... T>
78 using Isqf = std::index_sequence_for<T...>;
79
80 template <SizeT N>
81 using CSizeT = std::integral_constant<SizeT,N>;
82
83 /*===================+
84 | library types |
85 +===================*/
86
87 /*
88 Naming Prefixes:
89 D = Y = Dynamic
90 V = X = Virtual
91 S = Static
92 P = Partial = Sub
93 C = Classic
94 M = Multi (Index,Ranges) or !const (Container)
95 U = One(=Uni) dimensional
96 N = None = Null
97 E = Extension (SSE,AVX,etc dof)
98 T = Thread
99 R = Rank
100 A = (const) Array
101 B = (mutable) Array
102 F = Functional, Map,...
103 */
104
105 // default template parameter
106 class None {};
107
108 // definition: base/dtype.h
109 class DType;
110
111 // definition: base/obj_handle.h
112 template <typename T>
113 class ObjHandle;
114
115 // definition: memory/allocator.h
116 template <typename T>
117 class Allocator;
118
119 // definition: xpr/vpos_type.h
120 class VPosBase;
121
122 // definition: xpr/vpos_type.h
123 template <class PosT>
124 class VPos;
125
126 // definition: xpr/vpos_type.h
127 template <class PosT>
128 class VPosRef;
129
130 // definition: xpr/pos_type.h
131 class UPos;
132
133 // definition: xpr/pos_type.h
134 template <SizeT N>
135 class SPos;
136
137 // definition: xpr/pos_type.h
138 class FPos;
139
140 // definition: xpr/pos_type.h
141 template <SizeT N, SizeT... Ms>
142 class SFPos;
143
144 // definition: xpr/pos_type.h
145 class DPos;
146
147 // definition: xpr/pos_type.h
148 class DPosRef;
149
150 // definition: xpr/pos_type.h
151 template <class PosT1, class PosT2>
152 class MPos;
153
154 // definition: ranges/range_base.h
155 class RangeBase;
156
158
159 // definition: ranges/index_base.h
160 template <class I, typename MetaType>
161 class IndexInterface;
162
163 template <class I, typename MetaType>
165
166 // definition: ranges/nrange.h
167 class NRange; // null-range (range over none)
168
169 // definition: ranges/nrange.h
170 class NIndex;
171
172 // definition: ranges/urange.h
173 template <typename Meta>
174 class URange; // generic simple range (uni-dimensional)
175
176 // definition: ranges/urange.h
177 template <typename Meta>
178 class UIndex;
179
180 // definition: ranges/prange.h
181 template <class Range>
182 class PRange;
183
184 // definition: ranges/prange.h
185 template <class Index>
186 class PIndex;
187
188 // definition: ranges/crange.h
189 class CRange; // classic range, trivial meta data
190
191 // definition: ranges/crange.h
192 class CIndex;
193
194 // definition: ranges/srange.h
195 template <typename Meta, SizeT S>
196 class SRange; // generic static size range
197
198 // definition: ranges/srange.h
199 template <typename Meta, SizeT S>
200 class SIndex;
201
202 // definition: ranges/mrange.h
203 template <class... Ranges>
204 class MRange; // multi range
205
206 // definition: ranges/mrange.h
207 template <class BlockType, class... Indices>
208 class GMIndex;
209
210 template <class... Indices>
212
213 // definition: ranges/xindex.h
214 class XIndexBase; // dynamic index wrapper
215
217
218 // definition: ranges/dindex.h
219 class DIndex;
220
221 // definition: ranges/yrange.h
222 class YRange; // dynamic multi range
223
224 // definition: ranges/yrange.h
225 class YIndex;
226
228
229 // definition: ranges/pindex.h
230 template <class Index>
231 class PIndex; // partial index (index over sub-ranges and permutations)
232
233 // there should be also a static analogue
234
235 // definition: ranges/lindex.h
236 template <class Index, SizeT L>
237 class LIndex;
238
239 // definition: ranges/index_pack.h
240 template <class... Indices>
241 class SPack;
242
243 // definition: ranges/index_pack.h
244 class DPack;
245
246 // definition: ranges/index_format.h
247 template <SizeT N>
248 class MFormat;
249
250 // definition: ranges/index_format.h
251 template <class... PosT>
252 class GMFormat;
253
254 // definition: ranges/index_format.h
255 class YFormat;
256
257 // definition: array/array_base.h
258 template <typename T>
259 class CArrayBase;
260
261 // definition: array/array_base.h
262 template <typename T>
263 class ArrayBase;
264
265 // definition: array/array.h
266 template <typename T>
267 class MArray;
268
269 // definition: array/slice.h
270 template <typename T>
271 class CSlice;
272
273 // definition: array/slice.h
274 template <typename T>
275 class Slice;
276
277 // definition: operation/op_types.h
278 template <class OpT>
279 class COpInterface;
280
281 // definition: operation/op_types.h
282 template <class OpT>
283 class OpInterface;
284
285 // definition: operation/op_types.h
286 template <typename T, class IndexT>
287 class COpRoot;
288
289 // definition: operation/op_types.h
290 template <typename T, class IndexT>
291 class OpCont;
292
293 // definition: operation/op_types.h
294 template <typename T, class IndexT>
295 class OpRoot;
296
297 // definition: operation/op_types.h
298 template <class F, class... Ops>
299 class Operation;
300
301 // definition: operation/op_types.h
302 template <class CXpr>
303 class Contraction;
304
305 /*===================+
306 | derived types |
307 +===================*/
308
309 template <typename T>
310 using Vector = std::vector<T,Allocator<T>>;
311
312 template <typename T, SizeT N, bool Static>
314 { typedef Vector<T> type; };
315
316 template <typename T, SizeT N>
317 struct Container<T,N,true>
318 { typedef Arr<T,N> type; };
319}
320
321#endif
Double Real
Definition types.h:40
std::intptr_t PtrId
Definition types.h:35
std::string String
Definition types.h:42
typename std::remove_reference< T >::type RemoveRef
Definition types.h:66
std::type_info TypeInfo
Definition types.h:71
double Double
Definition types.h:39
uint64_t SizeT
Definition types.h:38
std::complex< Real > Complex
Definition types.h:41
Sptr< RangeBase > RangePtr
Definition types.h:157
Sptr< XIndexBase > XIndexPtr
Definition types.h:216
std::unique_ptr< T > Uptr
Definition types.h:54
std::tuple_element< I, Tuple< T... > > TupleElem
Definition types.h:63
std::vector< T, Allocator< T > > Vector
Definition types.h:310
int32_t Int
Definition types.h:36
std::integral_constant< SizeT, N > CSizeT
Definition types.h:81
Sptr< Range > rangeCast(const RangePtr r)
std::tuple< T... > Tuple
Definition types.h:60
std::array< T, N > Arr
Definition types.h:45
std::index_sequence_for< T... > Isqf
Definition types.h:78
std::index_sequence< Is... > Isq
Definition types.h:74
Sptr< YIndex > YIndexPtr
Definition types.h:227
Sptr< IndexInterface< I, MetaType > > IndexPtr
Definition types.h:164
std::pair< T, U > Pair
Definition types.h:57
int64_t LInt
Definition types.h:37
std::map< K, V > Map
Definition types.h:69
std::weak_ptr< T > Wptr
Definition types.h:51
std::shared_ptr< T > Sptr
Definition types.h:48
Vector< T > type
Definition types.h:314