IT++ Logo
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
fixed.h
Go to the documentation of this file.
1 
29 #ifndef FIXED_H
30 #define FIXED_H
31 
32 #include <itpp/fixed/fix.h>
33 
34 
35 namespace itpp
36 {
37 
40 
46 template < int w, e_mode e = TC, o_mode o = WRAP, q_mode q = TRN >
47 class Fixed : public Fix
48 {
49 public:
51  Fixed(double x = 0.0, int s = 0, Stat *ptr = 0)
52  : Fix(x, s, w, e, o, q, ptr) {}
54  explicit Fixed(Stat *ptr)
55  : Fix(0.0, 0, w, e, o, q, ptr) {}
57  Fixed(const Fix &x, Stat *ptr = 0)
58  : Fix(x, w, e, o, q, ptr) {}
60  virtual ~Fixed() {}
61 
63  Fixed& operator=(const Fix &x) {
64  shift = x.shift;
65  re = apply_o_mode(x.re);
66  return *this;
67  }
69  Fixed& operator=(int x) {
70  shift = 0;
71  re = apply_o_mode(x);
72  return *this;
73  }
74 protected:
75 };
76 
78 
82 typedef Fixed<2, TC, WRAP> fixed2;
83 typedef Fixed<3, TC, WRAP> fixed3;
84 typedef Fixed<4, TC, WRAP> fixed4;
85 typedef Fixed<5, TC, WRAP> fixed5;
86 typedef Fixed<6, TC, WRAP> fixed6;
87 typedef Fixed<7, TC, WRAP> fixed7;
88 typedef Fixed<8, TC, WRAP> fixed8;
89 typedef Fixed<9, TC, WRAP> fixed9;
90 typedef Fixed<10, TC, WRAP> fixed10;
91 typedef Fixed<11, TC, WRAP> fixed11;
92 typedef Fixed<12, TC, WRAP> fixed12;
93 typedef Fixed<13, TC, WRAP> fixed13;
94 typedef Fixed<14, TC, WRAP> fixed14;
95 typedef Fixed<15, TC, WRAP> fixed15;
96 typedef Fixed<16, TC, WRAP> fixed16;
97 typedef Fixed<17, TC, WRAP> fixed17;
98 typedef Fixed<18, TC, WRAP> fixed18;
99 typedef Fixed<19, TC, WRAP> fixed19;
100 typedef Fixed<20, TC, WRAP> fixed20;
101 typedef Fixed<21, TC, WRAP> fixed21;
102 typedef Fixed<22, TC, WRAP> fixed22;
103 typedef Fixed<23, TC, WRAP> fixed23;
104 typedef Fixed<24, TC, WRAP> fixed24;
105 typedef Fixed<25, TC, WRAP> fixed25;
106 typedef Fixed<26, TC, WRAP> fixed26;
107 typedef Fixed<27, TC, WRAP> fixed27;
108 typedef Fixed<28, TC, WRAP> fixed28;
109 typedef Fixed<29, TC, WRAP> fixed29;
110 typedef Fixed<30, TC, WRAP> fixed30;
111 typedef Fixed<31, TC, WRAP> fixed31;
112 typedef Fixed<32, TC, WRAP> fixed32;
113 typedef Fixed<33, TC, WRAP> fixed33;
114 typedef Fixed<34, TC, WRAP> fixed34;
115 typedef Fixed<35, TC, WRAP> fixed35;
116 typedef Fixed<36, TC, WRAP> fixed36;
117 typedef Fixed<37, TC, WRAP> fixed37;
118 typedef Fixed<38, TC, WRAP> fixed38;
119 typedef Fixed<39, TC, WRAP> fixed39;
120 typedef Fixed<40, TC, WRAP> fixed40;
121 typedef Fixed<41, TC, WRAP> fixed41;
122 typedef Fixed<42, TC, WRAP> fixed42;
123 typedef Fixed<43, TC, WRAP> fixed43;
124 typedef Fixed<44, TC, WRAP> fixed44;
125 typedef Fixed<45, TC, WRAP> fixed45;
126 typedef Fixed<46, TC, WRAP> fixed46;
127 typedef Fixed<47, TC, WRAP> fixed47;
128 typedef Fixed<48, TC, WRAP> fixed48;
129 typedef Fixed<49, TC, WRAP> fixed49;
130 typedef Fixed<50, TC, WRAP> fixed50;
131 typedef Fixed<51, TC, WRAP> fixed51;
132 typedef Fixed<52, TC, WRAP> fixed52;
133 typedef Fixed<53, TC, WRAP> fixed53;
134 typedef Fixed<54, TC, WRAP> fixed54;
135 typedef Fixed<55, TC, WRAP> fixed55;
136 typedef Fixed<56, TC, WRAP> fixed56;
137 typedef Fixed<57, TC, WRAP> fixed57;
138 typedef Fixed<58, TC, WRAP> fixed58;
139 typedef Fixed<59, TC, WRAP> fixed59;
140 typedef Fixed<60, TC, WRAP> fixed60;
141 typedef Fixed<61, TC, WRAP> fixed61;
142 typedef Fixed<62, TC, WRAP> fixed62;
143 typedef Fixed<63, TC, WRAP> fixed63;
144 typedef Fixed<64, TC, WRAP> fixed64;
146 
150 typedef Fixed<2, US, WRAP> ufixed2;
151 typedef Fixed<3, US, WRAP> ufixed3;
152 typedef Fixed<4, US, WRAP> ufixed4;
153 typedef Fixed<5, US, WRAP> ufixed5;
154 typedef Fixed<6, US, WRAP> ufixed6;
155 typedef Fixed<7, US, WRAP> ufixed7;
156 typedef Fixed<8, US, WRAP> ufixed8;
157 typedef Fixed<9, US, WRAP> ufixed9;
158 typedef Fixed<10, US, WRAP> ufixed10;
159 typedef Fixed<11, US, WRAP> ufixed11;
160 typedef Fixed<12, US, WRAP> ufixed12;
161 typedef Fixed<13, US, WRAP> ufixed13;
162 typedef Fixed<14, US, WRAP> ufixed14;
163 typedef Fixed<15, US, WRAP> ufixed15;
164 typedef Fixed<16, US, WRAP> ufixed16;
165 typedef Fixed<17, US, WRAP> ufixed17;
166 typedef Fixed<18, US, WRAP> ufixed18;
167 typedef Fixed<19, US, WRAP> ufixed19;
168 typedef Fixed<20, US, WRAP> ufixed20;
169 typedef Fixed<21, US, WRAP> ufixed21;
170 typedef Fixed<22, US, WRAP> ufixed22;
171 typedef Fixed<23, US, WRAP> ufixed23;
172 typedef Fixed<24, US, WRAP> ufixed24;
173 typedef Fixed<25, US, WRAP> ufixed25;
174 typedef Fixed<26, US, WRAP> ufixed26;
175 typedef Fixed<27, US, WRAP> ufixed27;
176 typedef Fixed<28, US, WRAP> ufixed28;
177 typedef Fixed<29, US, WRAP> ufixed29;
178 typedef Fixed<30, US, WRAP> ufixed30;
179 typedef Fixed<31, US, WRAP> ufixed31;
180 typedef Fixed<32, US, WRAP> ufixed32;
181 typedef Fixed<33, US, WRAP> ufixed33;
182 typedef Fixed<34, US, WRAP> ufixed34;
183 typedef Fixed<35, US, WRAP> ufixed35;
184 typedef Fixed<36, US, WRAP> ufixed36;
185 typedef Fixed<37, US, WRAP> ufixed37;
186 typedef Fixed<38, US, WRAP> ufixed38;
187 typedef Fixed<39, US, WRAP> ufixed39;
188 typedef Fixed<40, US, WRAP> ufixed40;
189 typedef Fixed<41, US, WRAP> ufixed41;
190 typedef Fixed<42, US, WRAP> ufixed42;
191 typedef Fixed<43, US, WRAP> ufixed43;
192 typedef Fixed<44, US, WRAP> ufixed44;
193 typedef Fixed<45, US, WRAP> ufixed45;
194 typedef Fixed<46, US, WRAP> ufixed46;
195 typedef Fixed<47, US, WRAP> ufixed47;
196 typedef Fixed<48, US, WRAP> ufixed48;
197 typedef Fixed<49, US, WRAP> ufixed49;
198 typedef Fixed<50, US, WRAP> ufixed50;
199 typedef Fixed<51, US, WRAP> ufixed51;
200 typedef Fixed<52, US, WRAP> ufixed52;
201 typedef Fixed<53, US, WRAP> ufixed53;
202 typedef Fixed<54, US, WRAP> ufixed54;
203 typedef Fixed<55, US, WRAP> ufixed55;
204 typedef Fixed<56, US, WRAP> ufixed56;
205 typedef Fixed<57, US, WRAP> ufixed57;
206 typedef Fixed<58, US, WRAP> ufixed58;
207 typedef Fixed<59, US, WRAP> ufixed59;
208 typedef Fixed<60, US, WRAP> ufixed60;
209 typedef Fixed<61, US, WRAP> ufixed61;
210 typedef Fixed<62, US, WRAP> ufixed62;
211 typedef Fixed<63, US, WRAP> ufixed63;
212 typedef Fixed<64, US, WRAP> ufixed64;
214 
218 typedef Fixed<2, TC, SAT> sfixed2;
219 typedef Fixed<3, TC, SAT> sfixed3;
220 typedef Fixed<4, TC, SAT> sfixed4;
221 typedef Fixed<5, TC, SAT> sfixed5;
222 typedef Fixed<6, TC, SAT> sfixed6;
223 typedef Fixed<7, TC, SAT> sfixed7;
224 typedef Fixed<8, TC, SAT> sfixed8;
225 typedef Fixed<9, TC, SAT> sfixed9;
226 typedef Fixed<10, TC, SAT> sfixed10;
227 typedef Fixed<11, TC, SAT> sfixed11;
228 typedef Fixed<12, TC, SAT> sfixed12;
229 typedef Fixed<13, TC, SAT> sfixed13;
230 typedef Fixed<14, TC, SAT> sfixed14;
231 typedef Fixed<15, TC, SAT> sfixed15;
232 typedef Fixed<16, TC, SAT> sfixed16;
233 typedef Fixed<17, TC, SAT> sfixed17;
234 typedef Fixed<18, TC, SAT> sfixed18;
235 typedef Fixed<19, TC, SAT> sfixed19;
236 typedef Fixed<20, TC, SAT> sfixed20;
237 typedef Fixed<21, TC, SAT> sfixed21;
238 typedef Fixed<22, TC, SAT> sfixed22;
239 typedef Fixed<23, TC, SAT> sfixed23;
240 typedef Fixed<24, TC, SAT> sfixed24;
241 typedef Fixed<25, TC, SAT> sfixed25;
242 typedef Fixed<26, TC, SAT> sfixed26;
243 typedef Fixed<27, TC, SAT> sfixed27;
244 typedef Fixed<28, TC, SAT> sfixed28;
245 typedef Fixed<29, TC, SAT> sfixed29;
246 typedef Fixed<30, TC, SAT> sfixed30;
247 typedef Fixed<31, TC, SAT> sfixed31;
248 typedef Fixed<32, TC, SAT> sfixed32;
249 typedef Fixed<33, TC, SAT> sfixed33;
250 typedef Fixed<34, TC, SAT> sfixed34;
251 typedef Fixed<35, TC, SAT> sfixed35;
252 typedef Fixed<36, TC, SAT> sfixed36;
253 typedef Fixed<37, TC, SAT> sfixed37;
254 typedef Fixed<38, TC, SAT> sfixed38;
255 typedef Fixed<39, TC, SAT> sfixed39;
256 typedef Fixed<40, TC, SAT> sfixed40;
257 typedef Fixed<41, TC, SAT> sfixed41;
258 typedef Fixed<42, TC, SAT> sfixed42;
259 typedef Fixed<43, TC, SAT> sfixed43;
260 typedef Fixed<44, TC, SAT> sfixed44;
261 typedef Fixed<45, TC, SAT> sfixed45;
262 typedef Fixed<46, TC, SAT> sfixed46;
263 typedef Fixed<47, TC, SAT> sfixed47;
264 typedef Fixed<48, TC, SAT> sfixed48;
265 typedef Fixed<49, TC, SAT> sfixed49;
266 typedef Fixed<50, TC, SAT> sfixed50;
267 typedef Fixed<51, TC, SAT> sfixed51;
268 typedef Fixed<52, TC, SAT> sfixed52;
269 typedef Fixed<53, TC, SAT> sfixed53;
270 typedef Fixed<54, TC, SAT> sfixed54;
271 typedef Fixed<55, TC, SAT> sfixed55;
272 typedef Fixed<56, TC, SAT> sfixed56;
273 typedef Fixed<57, TC, SAT> sfixed57;
274 typedef Fixed<58, TC, SAT> sfixed58;
275 typedef Fixed<59, TC, SAT> sfixed59;
276 typedef Fixed<60, TC, SAT> sfixed60;
277 typedef Fixed<61, TC, SAT> sfixed61;
278 typedef Fixed<62, TC, SAT> sfixed62;
279 typedef Fixed<63, TC, SAT> sfixed63;
280 typedef Fixed<64, TC, SAT> sfixed64;
282 
286 typedef Fixed<2, US, SAT> sufixed2;
287 typedef Fixed<3, US, SAT> sufixed3;
288 typedef Fixed<4, US, SAT> sufixed4;
289 typedef Fixed<5, US, SAT> sufixed5;
290 typedef Fixed<6, US, SAT> sufixed6;
291 typedef Fixed<7, US, SAT> sufixed7;
292 typedef Fixed<8, US, SAT> sufixed8;
293 typedef Fixed<9, US, SAT> sufixed9;
294 typedef Fixed<10, US, SAT> sufixed10;
295 typedef Fixed<11, US, SAT> sufixed11;
296 typedef Fixed<12, US, SAT> sufixed12;
297 typedef Fixed<13, US, SAT> sufixed13;
298 typedef Fixed<14, US, SAT> sufixed14;
299 typedef Fixed<15, US, SAT> sufixed15;
300 typedef Fixed<16, US, SAT> sufixed16;
301 typedef Fixed<17, US, SAT> sufixed17;
302 typedef Fixed<18, US, SAT> sufixed18;
303 typedef Fixed<19, US, SAT> sufixed19;
304 typedef Fixed<20, US, SAT> sufixed20;
305 typedef Fixed<21, US, SAT> sufixed21;
306 typedef Fixed<22, US, SAT> sufixed22;
307 typedef Fixed<23, US, SAT> sufixed23;
308 typedef Fixed<24, US, SAT> sufixed24;
309 typedef Fixed<25, US, SAT> sufixed25;
310 typedef Fixed<26, US, SAT> sufixed26;
311 typedef Fixed<27, US, SAT> sufixed27;
312 typedef Fixed<28, US, SAT> sufixed28;
313 typedef Fixed<29, US, SAT> sufixed29;
314 typedef Fixed<30, US, SAT> sufixed30;
315 typedef Fixed<31, US, SAT> sufixed31;
316 typedef Fixed<32, US, SAT> sufixed32;
317 typedef Fixed<33, US, SAT> sufixed33;
318 typedef Fixed<34, US, SAT> sufixed34;
319 typedef Fixed<35, US, SAT> sufixed35;
320 typedef Fixed<36, US, SAT> sufixed36;
321 typedef Fixed<37, US, SAT> sufixed37;
322 typedef Fixed<38, US, SAT> sufixed38;
323 typedef Fixed<39, US, SAT> sufixed39;
324 typedef Fixed<40, US, SAT> sufixed40;
325 typedef Fixed<41, US, SAT> sufixed41;
326 typedef Fixed<42, US, SAT> sufixed42;
327 typedef Fixed<43, US, SAT> sufixed43;
328 typedef Fixed<44, US, SAT> sufixed44;
329 typedef Fixed<45, US, SAT> sufixed45;
330 typedef Fixed<46, US, SAT> sufixed46;
331 typedef Fixed<47, US, SAT> sufixed47;
332 typedef Fixed<48, US, SAT> sufixed48;
333 typedef Fixed<49, US, SAT> sufixed49;
334 typedef Fixed<50, US, SAT> sufixed50;
335 typedef Fixed<51, US, SAT> sufixed51;
336 typedef Fixed<52, US, SAT> sufixed52;
337 typedef Fixed<53, US, SAT> sufixed53;
338 typedef Fixed<54, US, SAT> sufixed54;
339 typedef Fixed<55, US, SAT> sufixed55;
340 typedef Fixed<56, US, SAT> sufixed56;
341 typedef Fixed<57, US, SAT> sufixed57;
342 typedef Fixed<58, US, SAT> sufixed58;
343 typedef Fixed<59, US, SAT> sufixed59;
344 typedef Fixed<60, US, SAT> sufixed60;
345 typedef Fixed<61, US, SAT> sufixed61;
346 typedef Fixed<62, US, SAT> sufixed62;
347 typedef Fixed<63, US, SAT> sufixed63;
348 typedef Fixed<64, US, SAT> sufixed64;
349 
350 // ----------------------------------------------------------------------
351 // Instantiations
352 // ----------------------------------------------------------------------
353 
354 #ifndef _MSC_VER
355 extern template class Fixed<64, TC, WRAP>;
356 #endif // _MSC_VER
357 
359 
360 } // namespace itpp
361 
362 #endif // #ifndef FIXED_H
SourceForge Logo

Generated on Fri Mar 21 2014 17:14:13 for IT++ by Doxygen 1.8.1.2