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

Generated on Tue Aug 17 2021 10:59:15 for IT++ by Doxygen 1.9.4