IT++ Logo
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
cfixed.h
Go to the documentation of this file.
1 
29 #ifndef CFIXED_H
30 #define CFIXED_H
31 
32 #include <itpp/fixed/cfix.h>
33 
34 
35 namespace itpp
36 {
37 
48 template < int w, e_mode e = TC, o_mode o = WRAP, q_mode q = TRN >
49 class CFixed : public CFix
50 {
51 public:
53  CFixed(double r = 0.0, double i = 0.0, int s = 0, Stat *ptr = 0)
54  : CFix(r, i, s, w, e, o, q, ptr) {}
56  CFixed(std::complex<double> x, double, int s = 0, Stat *ptr = 0)
57  : CFix(x, 0.0, s, w, e, o, q, ptr) {}
59  explicit CFixed(Stat *ptr)
60  : CFix(0.0, 0.0, 0, w, e, o, q, ptr) {}
62  CFixed(const Fix &r, const Fix &i = 0.0, Stat *ptr = 0)
63  : CFix(r, i, w, e, o, q, ptr) {}
65  CFixed(const CFix &x, double, Stat *ptr = 0)
66  : CFix(x, 0.0, w, e, o, q, ptr) {}
68  virtual ~CFixed() {}
69 
71  CFixed& operator=(const CFix &x) {
72  shift = x.shift;
73  re = apply_o_mode(x.re);
74  im = apply_o_mode(x.im);
75  return *this;
76  }
78  CFixed& operator=(const Fix &x) {
79  shift = x.shift;
80  re = apply_o_mode(x.re);
81  im = 0;
82  return *this;
83  }
85  CFixed& operator=(const std::complex<double> &x) {
86  shift = 0;
87  re = apply_o_mode(fixrep(real(x)));
88  im = apply_o_mode(fixrep(imag(x)));
89  return *this;
90  }
92  CFixed& operator=(int x) {
93  shift = 0;
94  re = apply_o_mode(x);
95  im = 0;
96  return *this;
97  }
98 protected:
99 };
100 
103 
106 typedef CFixed<2, TC, WRAP> cfixed2;
107 typedef CFixed<3, TC, WRAP> cfixed3;
108 typedef CFixed<4, TC, WRAP> cfixed4;
109 typedef CFixed<5, TC, WRAP> cfixed5;
110 typedef CFixed<6, TC, WRAP> cfixed6;
111 typedef CFixed<7, TC, WRAP> cfixed7;
112 typedef CFixed<8, TC, WRAP> cfixed8;
113 typedef CFixed<9, TC, WRAP> cfixed9;
114 typedef CFixed<10, TC, WRAP> cfixed10;
115 typedef CFixed<11, TC, WRAP> cfixed11;
116 typedef CFixed<12, TC, WRAP> cfixed12;
117 typedef CFixed<13, TC, WRAP> cfixed13;
118 typedef CFixed<14, TC, WRAP> cfixed14;
119 typedef CFixed<15, TC, WRAP> cfixed15;
120 typedef CFixed<16, TC, WRAP> cfixed16;
121 typedef CFixed<17, TC, WRAP> cfixed17;
122 typedef CFixed<18, TC, WRAP> cfixed18;
123 typedef CFixed<19, TC, WRAP> cfixed19;
124 typedef CFixed<20, TC, WRAP> cfixed20;
125 typedef CFixed<21, TC, WRAP> cfixed21;
126 typedef CFixed<22, TC, WRAP> cfixed22;
127 typedef CFixed<23, TC, WRAP> cfixed23;
128 typedef CFixed<24, TC, WRAP> cfixed24;
129 typedef CFixed<25, TC, WRAP> cfixed25;
130 typedef CFixed<26, TC, WRAP> cfixed26;
131 typedef CFixed<27, TC, WRAP> cfixed27;
132 typedef CFixed<28, TC, WRAP> cfixed28;
133 typedef CFixed<29, TC, WRAP> cfixed29;
134 typedef CFixed<30, TC, WRAP> cfixed30;
135 typedef CFixed<31, TC, WRAP> cfixed31;
136 typedef CFixed<32, TC, WRAP> cfixed32;
137 typedef CFixed<33, TC, WRAP> cfixed33;
138 typedef CFixed<34, TC, WRAP> cfixed34;
139 typedef CFixed<35, TC, WRAP> cfixed35;
140 typedef CFixed<36, TC, WRAP> cfixed36;
141 typedef CFixed<37, TC, WRAP> cfixed37;
142 typedef CFixed<38, TC, WRAP> cfixed38;
143 typedef CFixed<39, TC, WRAP> cfixed39;
144 typedef CFixed<40, TC, WRAP> cfixed40;
145 typedef CFixed<41, TC, WRAP> cfixed41;
146 typedef CFixed<42, TC, WRAP> cfixed42;
147 typedef CFixed<43, TC, WRAP> cfixed43;
148 typedef CFixed<44, TC, WRAP> cfixed44;
149 typedef CFixed<45, TC, WRAP> cfixed45;
150 typedef CFixed<46, TC, WRAP> cfixed46;
151 typedef CFixed<47, TC, WRAP> cfixed47;
152 typedef CFixed<48, TC, WRAP> cfixed48;
153 typedef CFixed<49, TC, WRAP> cfixed49;
154 typedef CFixed<50, TC, WRAP> cfixed50;
155 typedef CFixed<51, TC, WRAP> cfixed51;
156 typedef CFixed<52, TC, WRAP> cfixed52;
157 typedef CFixed<53, TC, WRAP> cfixed53;
158 typedef CFixed<54, TC, WRAP> cfixed54;
159 typedef CFixed<55, TC, WRAP> cfixed55;
160 typedef CFixed<56, TC, WRAP> cfixed56;
161 typedef CFixed<57, TC, WRAP> cfixed57;
162 typedef CFixed<58, TC, WRAP> cfixed58;
163 typedef CFixed<59, TC, WRAP> cfixed59;
164 typedef CFixed<60, TC, WRAP> cfixed60;
165 typedef CFixed<61, TC, WRAP> cfixed61;
166 typedef CFixed<62, TC, WRAP> cfixed62;
167 typedef CFixed<63, TC, WRAP> cfixed63;
168 typedef CFixed<64, TC, WRAP> cfixed64;
170 
174 typedef CFixed<1, TC, SAT> scfixed1;
175 typedef CFixed<2, TC, SAT> scfixed2;
176 typedef CFixed<3, TC, SAT> scfixed3;
177 typedef CFixed<4, TC, SAT> scfixed4;
178 typedef CFixed<5, TC, SAT> scfixed5;
179 typedef CFixed<6, TC, SAT> scfixed6;
180 typedef CFixed<7, TC, SAT> scfixed7;
181 typedef CFixed<8, TC, SAT> scfixed8;
182 typedef CFixed<9, TC, SAT> scfixed9;
183 typedef CFixed<10, TC, SAT> scfixed10;
184 typedef CFixed<11, TC, SAT> scfixed11;
185 typedef CFixed<12, TC, SAT> scfixed12;
186 typedef CFixed<13, TC, SAT> scfixed13;
187 typedef CFixed<14, TC, SAT> scfixed14;
188 typedef CFixed<15, TC, SAT> scfixed15;
189 typedef CFixed<16, TC, SAT> scfixed16;
190 typedef CFixed<17, TC, SAT> scfixed17;
191 typedef CFixed<18, TC, SAT> scfixed18;
192 typedef CFixed<19, TC, SAT> scfixed19;
193 typedef CFixed<20, TC, SAT> scfixed20;
194 typedef CFixed<21, TC, SAT> scfixed21;
195 typedef CFixed<22, TC, SAT> scfixed22;
196 typedef CFixed<23, TC, SAT> scfixed23;
197 typedef CFixed<24, TC, SAT> scfixed24;
198 typedef CFixed<25, TC, SAT> scfixed25;
199 typedef CFixed<26, TC, SAT> scfixed26;
200 typedef CFixed<27, TC, SAT> scfixed27;
201 typedef CFixed<28, TC, SAT> scfixed28;
202 typedef CFixed<29, TC, SAT> scfixed29;
203 typedef CFixed<30, TC, SAT> scfixed30;
204 typedef CFixed<31, TC, SAT> scfixed31;
205 typedef CFixed<32, TC, SAT> scfixed32;
206 typedef CFixed<33, TC, SAT> scfixed33;
207 typedef CFixed<34, TC, SAT> scfixed34;
208 typedef CFixed<35, TC, SAT> scfixed35;
209 typedef CFixed<36, TC, SAT> scfixed36;
210 typedef CFixed<37, TC, SAT> scfixed37;
211 typedef CFixed<38, TC, SAT> scfixed38;
212 typedef CFixed<39, TC, SAT> scfixed39;
213 typedef CFixed<40, TC, SAT> scfixed40;
214 typedef CFixed<41, TC, SAT> scfixed41;
215 typedef CFixed<42, TC, SAT> scfixed42;
216 typedef CFixed<43, TC, SAT> scfixed43;
217 typedef CFixed<44, TC, SAT> scfixed44;
218 typedef CFixed<45, TC, SAT> scfixed45;
219 typedef CFixed<46, TC, SAT> scfixed46;
220 typedef CFixed<47, TC, SAT> scfixed47;
221 typedef CFixed<48, TC, SAT> scfixed48;
222 typedef CFixed<49, TC, SAT> scfixed49;
223 typedef CFixed<50, TC, SAT> scfixed50;
224 typedef CFixed<51, TC, SAT> scfixed51;
225 typedef CFixed<52, TC, SAT> scfixed52;
226 typedef CFixed<53, TC, SAT> scfixed53;
227 typedef CFixed<54, TC, SAT> scfixed54;
228 typedef CFixed<55, TC, SAT> scfixed55;
229 typedef CFixed<56, TC, SAT> scfixed56;
230 typedef CFixed<57, TC, SAT> scfixed57;
231 typedef CFixed<58, TC, SAT> scfixed58;
232 typedef CFixed<59, TC, SAT> scfixed59;
233 typedef CFixed<60, TC, SAT> scfixed60;
234 typedef CFixed<61, TC, SAT> scfixed61;
235 typedef CFixed<62, TC, SAT> scfixed62;
236 typedef CFixed<63, TC, SAT> scfixed63;
237 typedef CFixed<64, TC, SAT> scfixed64;
238 
239 // ----------------------------------------------------------------------
240 // Instantiations
241 // ----------------------------------------------------------------------
242 #ifndef _MSC_VER
243 extern template class CFixed<64, TC, WRAP>;
244 #endif // _MSC_VER
245 
247 
248 } // namespace itpp
249 
250 #endif // #ifndef CFIXED_H
SourceForge Logo

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