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