00001
00029 #ifndef FIXED_H
00030 #define FIXED_H
00031
00032 #ifndef _MSC_VER
00033 # include <itpp/config.h>
00034 #else
00035 # include <itpp/config_msvc.h>
00036 #endif
00037
00038 #include <itpp/fixed/fix.h>
00039
00040
00041 namespace itpp
00042 {
00043
00046
00052 template < int w, e_mode e = TC, o_mode o = WRAP, q_mode q = TRN >
00053 class Fixed : public Fix
00054 {
00055 public:
00057 Fixed(double x = 0.0, int s = 0, Stat *ptr = 0)
00058 : Fix(x, s, w, e, o, q, ptr) {}
00060 explicit Fixed(Stat *ptr)
00061 : Fix(0.0, 0, w, e, o, q, ptr) {}
00063 Fixed(const Fix &x, Stat *ptr = 0)
00064 : Fix(x, w, e, o, q, ptr) {}
00066 virtual ~Fixed() {}
00067
00069 Fixed& operator=(const Fix &x) {
00070 shift = x.shift;
00071 re = apply_o_mode(x.re);
00072 return *this;
00073 }
00075 Fixed& operator=(int x) {
00076 shift = 0;
00077 re = apply_o_mode(x);
00078 return *this;
00079 }
00080 protected:
00081 };
00082
00084
00086 typedef Fixed<1, TC, WRAP> fixed1;
00088 typedef Fixed<2, TC, WRAP> fixed2;
00089 typedef Fixed<3, TC, WRAP> fixed3;
00090 typedef Fixed<4, TC, WRAP> fixed4;
00091 typedef Fixed<5, TC, WRAP> fixed5;
00092 typedef Fixed<6, TC, WRAP> fixed6;
00093 typedef Fixed<7, TC, WRAP> fixed7;
00094 typedef Fixed<8, TC, WRAP> fixed8;
00095 typedef Fixed<9, TC, WRAP> fixed9;
00096 typedef Fixed<10, TC, WRAP> fixed10;
00097 typedef Fixed<11, TC, WRAP> fixed11;
00098 typedef Fixed<12, TC, WRAP> fixed12;
00099 typedef Fixed<13, TC, WRAP> fixed13;
00100 typedef Fixed<14, TC, WRAP> fixed14;
00101 typedef Fixed<15, TC, WRAP> fixed15;
00102 typedef Fixed<16, TC, WRAP> fixed16;
00103 typedef Fixed<17, TC, WRAP> fixed17;
00104 typedef Fixed<18, TC, WRAP> fixed18;
00105 typedef Fixed<19, TC, WRAP> fixed19;
00106 typedef Fixed<20, TC, WRAP> fixed20;
00107 typedef Fixed<21, TC, WRAP> fixed21;
00108 typedef Fixed<22, TC, WRAP> fixed22;
00109 typedef Fixed<23, TC, WRAP> fixed23;
00110 typedef Fixed<24, TC, WRAP> fixed24;
00111 typedef Fixed<25, TC, WRAP> fixed25;
00112 typedef Fixed<26, TC, WRAP> fixed26;
00113 typedef Fixed<27, TC, WRAP> fixed27;
00114 typedef Fixed<28, TC, WRAP> fixed28;
00115 typedef Fixed<29, TC, WRAP> fixed29;
00116 typedef Fixed<30, TC, WRAP> fixed30;
00117 typedef Fixed<31, TC, WRAP> fixed31;
00118 typedef Fixed<32, TC, WRAP> fixed32;
00119 typedef Fixed<33, TC, WRAP> fixed33;
00120 typedef Fixed<34, TC, WRAP> fixed34;
00121 typedef Fixed<35, TC, WRAP> fixed35;
00122 typedef Fixed<36, TC, WRAP> fixed36;
00123 typedef Fixed<37, TC, WRAP> fixed37;
00124 typedef Fixed<38, TC, WRAP> fixed38;
00125 typedef Fixed<39, TC, WRAP> fixed39;
00126 typedef Fixed<40, TC, WRAP> fixed40;
00127 typedef Fixed<41, TC, WRAP> fixed41;
00128 typedef Fixed<42, TC, WRAP> fixed42;
00129 typedef Fixed<43, TC, WRAP> fixed43;
00130 typedef Fixed<44, TC, WRAP> fixed44;
00131 typedef Fixed<45, TC, WRAP> fixed45;
00132 typedef Fixed<46, TC, WRAP> fixed46;
00133 typedef Fixed<47, TC, WRAP> fixed47;
00134 typedef Fixed<48, TC, WRAP> fixed48;
00135 typedef Fixed<49, TC, WRAP> fixed49;
00136 typedef Fixed<50, TC, WRAP> fixed50;
00137 typedef Fixed<51, TC, WRAP> fixed51;
00138 typedef Fixed<52, TC, WRAP> fixed52;
00139 typedef Fixed<53, TC, WRAP> fixed53;
00140 typedef Fixed<54, TC, WRAP> fixed54;
00141 typedef Fixed<55, TC, WRAP> fixed55;
00142 typedef Fixed<56, TC, WRAP> fixed56;
00143 typedef Fixed<57, TC, WRAP> fixed57;
00144 typedef Fixed<58, TC, WRAP> fixed58;
00145 typedef Fixed<59, TC, WRAP> fixed59;
00146 typedef Fixed<60, TC, WRAP> fixed60;
00147 typedef Fixed<61, TC, WRAP> fixed61;
00148 typedef Fixed<62, TC, WRAP> fixed62;
00149 typedef Fixed<63, TC, WRAP> fixed63;
00150 typedef Fixed<64, TC, WRAP> fixed64;
00152
00154 typedef Fixed<1, US, WRAP> ufixed1;
00156 typedef Fixed<2, US, WRAP> ufixed2;
00157 typedef Fixed<3, US, WRAP> ufixed3;
00158 typedef Fixed<4, US, WRAP> ufixed4;
00159 typedef Fixed<5, US, WRAP> ufixed5;
00160 typedef Fixed<6, US, WRAP> ufixed6;
00161 typedef Fixed<7, US, WRAP> ufixed7;
00162 typedef Fixed<8, US, WRAP> ufixed8;
00163 typedef Fixed<9, US, WRAP> ufixed9;
00164 typedef Fixed<10, US, WRAP> ufixed10;
00165 typedef Fixed<11, US, WRAP> ufixed11;
00166 typedef Fixed<12, US, WRAP> ufixed12;
00167 typedef Fixed<13, US, WRAP> ufixed13;
00168 typedef Fixed<14, US, WRAP> ufixed14;
00169 typedef Fixed<15, US, WRAP> ufixed15;
00170 typedef Fixed<16, US, WRAP> ufixed16;
00171 typedef Fixed<17, US, WRAP> ufixed17;
00172 typedef Fixed<18, US, WRAP> ufixed18;
00173 typedef Fixed<19, US, WRAP> ufixed19;
00174 typedef Fixed<20, US, WRAP> ufixed20;
00175 typedef Fixed<21, US, WRAP> ufixed21;
00176 typedef Fixed<22, US, WRAP> ufixed22;
00177 typedef Fixed<23, US, WRAP> ufixed23;
00178 typedef Fixed<24, US, WRAP> ufixed24;
00179 typedef Fixed<25, US, WRAP> ufixed25;
00180 typedef Fixed<26, US, WRAP> ufixed26;
00181 typedef Fixed<27, US, WRAP> ufixed27;
00182 typedef Fixed<28, US, WRAP> ufixed28;
00183 typedef Fixed<29, US, WRAP> ufixed29;
00184 typedef Fixed<30, US, WRAP> ufixed30;
00185 typedef Fixed<31, US, WRAP> ufixed31;
00186 typedef Fixed<32, US, WRAP> ufixed32;
00187 typedef Fixed<33, US, WRAP> ufixed33;
00188 typedef Fixed<34, US, WRAP> ufixed34;
00189 typedef Fixed<35, US, WRAP> ufixed35;
00190 typedef Fixed<36, US, WRAP> ufixed36;
00191 typedef Fixed<37, US, WRAP> ufixed37;
00192 typedef Fixed<38, US, WRAP> ufixed38;
00193 typedef Fixed<39, US, WRAP> ufixed39;
00194 typedef Fixed<40, US, WRAP> ufixed40;
00195 typedef Fixed<41, US, WRAP> ufixed41;
00196 typedef Fixed<42, US, WRAP> ufixed42;
00197 typedef Fixed<43, US, WRAP> ufixed43;
00198 typedef Fixed<44, US, WRAP> ufixed44;
00199 typedef Fixed<45, US, WRAP> ufixed45;
00200 typedef Fixed<46, US, WRAP> ufixed46;
00201 typedef Fixed<47, US, WRAP> ufixed47;
00202 typedef Fixed<48, US, WRAP> ufixed48;
00203 typedef Fixed<49, US, WRAP> ufixed49;
00204 typedef Fixed<50, US, WRAP> ufixed50;
00205 typedef Fixed<51, US, WRAP> ufixed51;
00206 typedef Fixed<52, US, WRAP> ufixed52;
00207 typedef Fixed<53, US, WRAP> ufixed53;
00208 typedef Fixed<54, US, WRAP> ufixed54;
00209 typedef Fixed<55, US, WRAP> ufixed55;
00210 typedef Fixed<56, US, WRAP> ufixed56;
00211 typedef Fixed<57, US, WRAP> ufixed57;
00212 typedef Fixed<58, US, WRAP> ufixed58;
00213 typedef Fixed<59, US, WRAP> ufixed59;
00214 typedef Fixed<60, US, WRAP> ufixed60;
00215 typedef Fixed<61, US, WRAP> ufixed61;
00216 typedef Fixed<62, US, WRAP> ufixed62;
00217 typedef Fixed<63, US, WRAP> ufixed63;
00218 typedef Fixed<64, US, WRAP> ufixed64;
00220
00222 typedef Fixed<1, TC, SAT> sfixed1;
00224 typedef Fixed<2, TC, SAT> sfixed2;
00225 typedef Fixed<3, TC, SAT> sfixed3;
00226 typedef Fixed<4, TC, SAT> sfixed4;
00227 typedef Fixed<5, TC, SAT> sfixed5;
00228 typedef Fixed<6, TC, SAT> sfixed6;
00229 typedef Fixed<7, TC, SAT> sfixed7;
00230 typedef Fixed<8, TC, SAT> sfixed8;
00231 typedef Fixed<9, TC, SAT> sfixed9;
00232 typedef Fixed<10, TC, SAT> sfixed10;
00233 typedef Fixed<11, TC, SAT> sfixed11;
00234 typedef Fixed<12, TC, SAT> sfixed12;
00235 typedef Fixed<13, TC, SAT> sfixed13;
00236 typedef Fixed<14, TC, SAT> sfixed14;
00237 typedef Fixed<15, TC, SAT> sfixed15;
00238 typedef Fixed<16, TC, SAT> sfixed16;
00239 typedef Fixed<17, TC, SAT> sfixed17;
00240 typedef Fixed<18, TC, SAT> sfixed18;
00241 typedef Fixed<19, TC, SAT> sfixed19;
00242 typedef Fixed<20, TC, SAT> sfixed20;
00243 typedef Fixed<21, TC, SAT> sfixed21;
00244 typedef Fixed<22, TC, SAT> sfixed22;
00245 typedef Fixed<23, TC, SAT> sfixed23;
00246 typedef Fixed<24, TC, SAT> sfixed24;
00247 typedef Fixed<25, TC, SAT> sfixed25;
00248 typedef Fixed<26, TC, SAT> sfixed26;
00249 typedef Fixed<27, TC, SAT> sfixed27;
00250 typedef Fixed<28, TC, SAT> sfixed28;
00251 typedef Fixed<29, TC, SAT> sfixed29;
00252 typedef Fixed<30, TC, SAT> sfixed30;
00253 typedef Fixed<31, TC, SAT> sfixed31;
00254 typedef Fixed<32, TC, SAT> sfixed32;
00255 typedef Fixed<33, TC, SAT> sfixed33;
00256 typedef Fixed<34, TC, SAT> sfixed34;
00257 typedef Fixed<35, TC, SAT> sfixed35;
00258 typedef Fixed<36, TC, SAT> sfixed36;
00259 typedef Fixed<37, TC, SAT> sfixed37;
00260 typedef Fixed<38, TC, SAT> sfixed38;
00261 typedef Fixed<39, TC, SAT> sfixed39;
00262 typedef Fixed<40, TC, SAT> sfixed40;
00263 typedef Fixed<41, TC, SAT> sfixed41;
00264 typedef Fixed<42, TC, SAT> sfixed42;
00265 typedef Fixed<43, TC, SAT> sfixed43;
00266 typedef Fixed<44, TC, SAT> sfixed44;
00267 typedef Fixed<45, TC, SAT> sfixed45;
00268 typedef Fixed<46, TC, SAT> sfixed46;
00269 typedef Fixed<47, TC, SAT> sfixed47;
00270 typedef Fixed<48, TC, SAT> sfixed48;
00271 typedef Fixed<49, TC, SAT> sfixed49;
00272 typedef Fixed<50, TC, SAT> sfixed50;
00273 typedef Fixed<51, TC, SAT> sfixed51;
00274 typedef Fixed<52, TC, SAT> sfixed52;
00275 typedef Fixed<53, TC, SAT> sfixed53;
00276 typedef Fixed<54, TC, SAT> sfixed54;
00277 typedef Fixed<55, TC, SAT> sfixed55;
00278 typedef Fixed<56, TC, SAT> sfixed56;
00279 typedef Fixed<57, TC, SAT> sfixed57;
00280 typedef Fixed<58, TC, SAT> sfixed58;
00281 typedef Fixed<59, TC, SAT> sfixed59;
00282 typedef Fixed<60, TC, SAT> sfixed60;
00283 typedef Fixed<61, TC, SAT> sfixed61;
00284 typedef Fixed<62, TC, SAT> sfixed62;
00285 typedef Fixed<63, TC, SAT> sfixed63;
00286 typedef Fixed<64, TC, SAT> sfixed64;
00288
00290 typedef Fixed<1, US, SAT> sufixed1;
00292 typedef Fixed<2, US, SAT> sufixed2;
00293 typedef Fixed<3, US, SAT> sufixed3;
00294 typedef Fixed<4, US, SAT> sufixed4;
00295 typedef Fixed<5, US, SAT> sufixed5;
00296 typedef Fixed<6, US, SAT> sufixed6;
00297 typedef Fixed<7, US, SAT> sufixed7;
00298 typedef Fixed<8, US, SAT> sufixed8;
00299 typedef Fixed<9, US, SAT> sufixed9;
00300 typedef Fixed<10, US, SAT> sufixed10;
00301 typedef Fixed<11, US, SAT> sufixed11;
00302 typedef Fixed<12, US, SAT> sufixed12;
00303 typedef Fixed<13, US, SAT> sufixed13;
00304 typedef Fixed<14, US, SAT> sufixed14;
00305 typedef Fixed<15, US, SAT> sufixed15;
00306 typedef Fixed<16, US, SAT> sufixed16;
00307 typedef Fixed<17, US, SAT> sufixed17;
00308 typedef Fixed<18, US, SAT> sufixed18;
00309 typedef Fixed<19, US, SAT> sufixed19;
00310 typedef Fixed<20, US, SAT> sufixed20;
00311 typedef Fixed<21, US, SAT> sufixed21;
00312 typedef Fixed<22, US, SAT> sufixed22;
00313 typedef Fixed<23, US, SAT> sufixed23;
00314 typedef Fixed<24, US, SAT> sufixed24;
00315 typedef Fixed<25, US, SAT> sufixed25;
00316 typedef Fixed<26, US, SAT> sufixed26;
00317 typedef Fixed<27, US, SAT> sufixed27;
00318 typedef Fixed<28, US, SAT> sufixed28;
00319 typedef Fixed<29, US, SAT> sufixed29;
00320 typedef Fixed<30, US, SAT> sufixed30;
00321 typedef Fixed<31, US, SAT> sufixed31;
00322 typedef Fixed<32, US, SAT> sufixed32;
00323 typedef Fixed<33, US, SAT> sufixed33;
00324 typedef Fixed<34, US, SAT> sufixed34;
00325 typedef Fixed<35, US, SAT> sufixed35;
00326 typedef Fixed<36, US, SAT> sufixed36;
00327 typedef Fixed<37, US, SAT> sufixed37;
00328 typedef Fixed<38, US, SAT> sufixed38;
00329 typedef Fixed<39, US, SAT> sufixed39;
00330 typedef Fixed<40, US, SAT> sufixed40;
00331 typedef Fixed<41, US, SAT> sufixed41;
00332 typedef Fixed<42, US, SAT> sufixed42;
00333 typedef Fixed<43, US, SAT> sufixed43;
00334 typedef Fixed<44, US, SAT> sufixed44;
00335 typedef Fixed<45, US, SAT> sufixed45;
00336 typedef Fixed<46, US, SAT> sufixed46;
00337 typedef Fixed<47, US, SAT> sufixed47;
00338 typedef Fixed<48, US, SAT> sufixed48;
00339 typedef Fixed<49, US, SAT> sufixed49;
00340 typedef Fixed<50, US, SAT> sufixed50;
00341 typedef Fixed<51, US, SAT> sufixed51;
00342 typedef Fixed<52, US, SAT> sufixed52;
00343 typedef Fixed<53, US, SAT> sufixed53;
00344 typedef Fixed<54, US, SAT> sufixed54;
00345 typedef Fixed<55, US, SAT> sufixed55;
00346 typedef Fixed<56, US, SAT> sufixed56;
00347 typedef Fixed<57, US, SAT> sufixed57;
00348 typedef Fixed<58, US, SAT> sufixed58;
00349 typedef Fixed<59, US, SAT> sufixed59;
00350 typedef Fixed<60, US, SAT> sufixed60;
00351 typedef Fixed<61, US, SAT> sufixed61;
00352 typedef Fixed<62, US, SAT> sufixed62;
00353 typedef Fixed<63, US, SAT> sufixed63;
00354 typedef Fixed<64, US, SAT> sufixed64;
00355
00356
00357
00358
00359
00360 #ifdef HAVE_EXTERN_TEMPLATE
00361 extern template class Fixed<64, TC, WRAP>;
00362 #endif // HAVE_EXTERN_TEMPLATE
00363
00365
00366 }
00367
00368 #endif // #ifndef FIXED_H