00001
00030 #ifndef FIX_FACTORY_H
00031 #define FIX_FACTORY_H
00032
00033 #include <itpp/base/factory.h>
00034 #include <itpp/fixed/fix_base.h>
00035
00036
00037 namespace itpp
00038 {
00039
00040
00041 class Fix;
00042 class CFix;
00043
00046
00119 class Fix_Factory : public Factory
00120 {
00121 friend class Fix;
00122 friend class CFix;
00123 public:
00125 explicit Fix_Factory(int w = MAX_WORDLEN, e_mode e = TC, o_mode o = WRAP, q_mode q = TRN, Stat *ptr = 0)
00126 : wordlen(w), emode(e), omode(o), qmode(q), stat_ptr(ptr) {}
00128 virtual ~Fix_Factory() {}
00130 operator double() const {return 0.0;}
00132 virtual void create(Fix* &ptr, const int n) const;
00134 virtual void create(CFix* &ptr, const int n) const;
00135 protected:
00137 int wordlen;
00139 e_mode emode;
00141 o_mode omode;
00143 q_mode qmode;
00145 Stat *stat_ptr;
00146 };
00147
00149 template<>
00150 void create_elements<Fix>(Fix* &ptr, const int n, const Factory &f);
00151
00153 template<>
00154 void create_elements<CFix>(CFix* &ptr, const int n, const Factory &f);
00155
00157
00158
00160 const Fix_Factory FIX1(1, TC, WRAP);
00162 const Fix_Factory FIX2(2, TC, WRAP);
00163 const Fix_Factory FIX3(3, TC, WRAP);
00164 const Fix_Factory FIX4(4, TC, WRAP);
00165 const Fix_Factory FIX5(5, TC, WRAP);
00166 const Fix_Factory FIX6(6, TC, WRAP);
00167 const Fix_Factory FIX7(7, TC, WRAP);
00168 const Fix_Factory FIX8(8, TC, WRAP);
00169 const Fix_Factory FIX9(9, TC, WRAP);
00170 const Fix_Factory FIX10(10, TC, WRAP);
00171 const Fix_Factory FIX11(11, TC, WRAP);
00172 const Fix_Factory FIX12(12, TC, WRAP);
00173 const Fix_Factory FIX13(13, TC, WRAP);
00174 const Fix_Factory FIX14(14, TC, WRAP);
00175 const Fix_Factory FIX15(15, TC, WRAP);
00176 const Fix_Factory FIX16(16, TC, WRAP);
00177 const Fix_Factory FIX17(17, TC, WRAP);
00178 const Fix_Factory FIX18(18, TC, WRAP);
00179 const Fix_Factory FIX19(19, TC, WRAP);
00180 const Fix_Factory FIX20(20, TC, WRAP);
00181 const Fix_Factory FIX21(21, TC, WRAP);
00182 const Fix_Factory FIX22(22, TC, WRAP);
00183 const Fix_Factory FIX23(23, TC, WRAP);
00184 const Fix_Factory FIX24(24, TC, WRAP);
00185 const Fix_Factory FIX25(25, TC, WRAP);
00186 const Fix_Factory FIX26(26, TC, WRAP);
00187 const Fix_Factory FIX27(27, TC, WRAP);
00188 const Fix_Factory FIX28(28, TC, WRAP);
00189 const Fix_Factory FIX29(29, TC, WRAP);
00190 const Fix_Factory FIX30(30, TC, WRAP);
00191 const Fix_Factory FIX31(31, TC, WRAP);
00192 const Fix_Factory FIX32(32, TC, WRAP);
00193 const Fix_Factory FIX33(33, TC, WRAP);
00194 const Fix_Factory FIX34(34, TC, WRAP);
00195 const Fix_Factory FIX35(35, TC, WRAP);
00196 const Fix_Factory FIX36(36, TC, WRAP);
00197 const Fix_Factory FIX37(37, TC, WRAP);
00198 const Fix_Factory FIX38(38, TC, WRAP);
00199 const Fix_Factory FIX39(39, TC, WRAP);
00200 const Fix_Factory FIX40(40, TC, WRAP);
00201 const Fix_Factory FIX41(41, TC, WRAP);
00202 const Fix_Factory FIX42(42, TC, WRAP);
00203 const Fix_Factory FIX43(43, TC, WRAP);
00204 const Fix_Factory FIX44(44, TC, WRAP);
00205 const Fix_Factory FIX45(45, TC, WRAP);
00206 const Fix_Factory FIX46(46, TC, WRAP);
00207 const Fix_Factory FIX47(47, TC, WRAP);
00208 const Fix_Factory FIX48(48, TC, WRAP);
00209 const Fix_Factory FIX49(49, TC, WRAP);
00210 const Fix_Factory FIX50(50, TC, WRAP);
00211 const Fix_Factory FIX51(51, TC, WRAP);
00212 const Fix_Factory FIX52(52, TC, WRAP);
00213 const Fix_Factory FIX53(53, TC, WRAP);
00214 const Fix_Factory FIX54(54, TC, WRAP);
00215 const Fix_Factory FIX55(55, TC, WRAP);
00216 const Fix_Factory FIX56(56, TC, WRAP);
00217 const Fix_Factory FIX57(57, TC, WRAP);
00218 const Fix_Factory FIX58(58, TC, WRAP);
00219 const Fix_Factory FIX59(59, TC, WRAP);
00220 const Fix_Factory FIX60(60, TC, WRAP);
00221 const Fix_Factory FIX61(61, TC, WRAP);
00222 const Fix_Factory FIX62(62, TC, WRAP);
00223 const Fix_Factory FIX63(63, TC, WRAP);
00224 const Fix_Factory FIX64(64, TC, WRAP);
00226
00228 const Fix_Factory UFIX1(1, US, WRAP);
00230 const Fix_Factory UFIX2(2, US, WRAP);
00231 const Fix_Factory UFIX3(3, US, WRAP);
00232 const Fix_Factory UFIX4(4, US, WRAP);
00233 const Fix_Factory UFIX5(5, US, WRAP);
00234 const Fix_Factory UFIX6(6, US, WRAP);
00235 const Fix_Factory UFIX7(7, US, WRAP);
00236 const Fix_Factory UFIX8(8, US, WRAP);
00237 const Fix_Factory UFIX9(9, US, WRAP);
00238 const Fix_Factory UFIX10(10, US, WRAP);
00239 const Fix_Factory UFIX11(11, US, WRAP);
00240 const Fix_Factory UFIX12(12, US, WRAP);
00241 const Fix_Factory UFIX13(13, US, WRAP);
00242 const Fix_Factory UFIX14(14, US, WRAP);
00243 const Fix_Factory UFIX15(15, US, WRAP);
00244 const Fix_Factory UFIX16(16, US, WRAP);
00245 const Fix_Factory UFIX17(17, US, WRAP);
00246 const Fix_Factory UFIX18(18, US, WRAP);
00247 const Fix_Factory UFIX19(19, US, WRAP);
00248 const Fix_Factory UFIX20(20, US, WRAP);
00249 const Fix_Factory UFIX21(21, US, WRAP);
00250 const Fix_Factory UFIX22(22, US, WRAP);
00251 const Fix_Factory UFIX23(23, US, WRAP);
00252 const Fix_Factory UFIX24(24, US, WRAP);
00253 const Fix_Factory UFIX25(25, US, WRAP);
00254 const Fix_Factory UFIX26(26, US, WRAP);
00255 const Fix_Factory UFIX27(27, US, WRAP);
00256 const Fix_Factory UFIX28(28, US, WRAP);
00257 const Fix_Factory UFIX29(29, US, WRAP);
00258 const Fix_Factory UFIX30(30, US, WRAP);
00259 const Fix_Factory UFIX31(31, US, WRAP);
00260 const Fix_Factory UFIX32(32, US, WRAP);
00261 const Fix_Factory UFIX33(33, US, WRAP);
00262 const Fix_Factory UFIX34(34, US, WRAP);
00263 const Fix_Factory UFIX35(35, US, WRAP);
00264 const Fix_Factory UFIX36(36, US, WRAP);
00265 const Fix_Factory UFIX37(37, US, WRAP);
00266 const Fix_Factory UFIX38(38, US, WRAP);
00267 const Fix_Factory UFIX39(39, US, WRAP);
00268 const Fix_Factory UFIX40(40, US, WRAP);
00269 const Fix_Factory UFIX41(41, US, WRAP);
00270 const Fix_Factory UFIX42(42, US, WRAP);
00271 const Fix_Factory UFIX43(43, US, WRAP);
00272 const Fix_Factory UFIX44(44, US, WRAP);
00273 const Fix_Factory UFIX45(45, US, WRAP);
00274 const Fix_Factory UFIX46(46, US, WRAP);
00275 const Fix_Factory UFIX47(47, US, WRAP);
00276 const Fix_Factory UFIX48(48, US, WRAP);
00277 const Fix_Factory UFIX49(49, US, WRAP);
00278 const Fix_Factory UFIX50(50, US, WRAP);
00279 const Fix_Factory UFIX51(51, US, WRAP);
00280 const Fix_Factory UFIX52(52, US, WRAP);
00281 const Fix_Factory UFIX53(53, US, WRAP);
00282 const Fix_Factory UFIX54(54, US, WRAP);
00283 const Fix_Factory UFIX55(55, US, WRAP);
00284 const Fix_Factory UFIX56(56, US, WRAP);
00285 const Fix_Factory UFIX57(57, US, WRAP);
00286 const Fix_Factory UFIX58(58, US, WRAP);
00287 const Fix_Factory UFIX59(59, US, WRAP);
00288 const Fix_Factory UFIX60(60, US, WRAP);
00289 const Fix_Factory UFIX61(61, US, WRAP);
00290 const Fix_Factory UFIX62(62, US, WRAP);
00291 const Fix_Factory UFIX63(63, US, WRAP);
00292 const Fix_Factory UFIX64(64, US, WRAP);
00294
00296 const Fix_Factory SFIX1(1, TC, SAT);
00298 const Fix_Factory SFIX2(2, TC, SAT);
00299 const Fix_Factory SFIX3(3, TC, SAT);
00300 const Fix_Factory SFIX4(4, TC, SAT);
00301 const Fix_Factory SFIX5(5, TC, SAT);
00302 const Fix_Factory SFIX6(6, TC, SAT);
00303 const Fix_Factory SFIX7(7, TC, SAT);
00304 const Fix_Factory SFIX8(8, TC, SAT);
00305 const Fix_Factory SFIX9(9, TC, SAT);
00306 const Fix_Factory SFIX10(10, TC, SAT);
00307 const Fix_Factory SFIX11(11, TC, SAT);
00308 const Fix_Factory SFIX12(12, TC, SAT);
00309 const Fix_Factory SFIX13(13, TC, SAT);
00310 const Fix_Factory SFIX14(14, TC, SAT);
00311 const Fix_Factory SFIX15(15, TC, SAT);
00312 const Fix_Factory SFIX16(16, TC, SAT);
00313 const Fix_Factory SFIX17(17, TC, SAT);
00314 const Fix_Factory SFIX18(18, TC, SAT);
00315 const Fix_Factory SFIX19(19, TC, SAT);
00316 const Fix_Factory SFIX20(20, TC, SAT);
00317 const Fix_Factory SFIX21(21, TC, SAT);
00318 const Fix_Factory SFIX22(22, TC, SAT);
00319 const Fix_Factory SFIX23(23, TC, SAT);
00320 const Fix_Factory SFIX24(24, TC, SAT);
00321 const Fix_Factory SFIX25(25, TC, SAT);
00322 const Fix_Factory SFIX26(26, TC, SAT);
00323 const Fix_Factory SFIX27(27, TC, SAT);
00324 const Fix_Factory SFIX28(28, TC, SAT);
00325 const Fix_Factory SFIX29(29, TC, SAT);
00326 const Fix_Factory SFIX30(30, TC, SAT);
00327 const Fix_Factory SFIX31(31, TC, SAT);
00328 const Fix_Factory SFIX32(32, TC, SAT);
00329 const Fix_Factory SFIX33(33, TC, SAT);
00330 const Fix_Factory SFIX34(34, TC, SAT);
00331 const Fix_Factory SFIX35(35, TC, SAT);
00332 const Fix_Factory SFIX36(36, TC, SAT);
00333 const Fix_Factory SFIX37(37, TC, SAT);
00334 const Fix_Factory SFIX38(38, TC, SAT);
00335 const Fix_Factory SFIX39(39, TC, SAT);
00336 const Fix_Factory SFIX40(40, TC, SAT);
00337 const Fix_Factory SFIX41(41, TC, SAT);
00338 const Fix_Factory SFIX42(42, TC, SAT);
00339 const Fix_Factory SFIX43(43, TC, SAT);
00340 const Fix_Factory SFIX44(44, TC, SAT);
00341 const Fix_Factory SFIX45(45, TC, SAT);
00342 const Fix_Factory SFIX46(46, TC, SAT);
00343 const Fix_Factory SFIX47(47, TC, SAT);
00344 const Fix_Factory SFIX48(48, TC, SAT);
00345 const Fix_Factory SFIX49(49, TC, SAT);
00346 const Fix_Factory SFIX50(50, TC, SAT);
00347 const Fix_Factory SFIX51(51, TC, SAT);
00348 const Fix_Factory SFIX52(52, TC, SAT);
00349 const Fix_Factory SFIX53(53, TC, SAT);
00350 const Fix_Factory SFIX54(54, TC, SAT);
00351 const Fix_Factory SFIX55(55, TC, SAT);
00352 const Fix_Factory SFIX56(56, TC, SAT);
00353 const Fix_Factory SFIX57(57, TC, SAT);
00354 const Fix_Factory SFIX58(58, TC, SAT);
00355 const Fix_Factory SFIX59(59, TC, SAT);
00356 const Fix_Factory SFIX60(60, TC, SAT);
00357 const Fix_Factory SFIX61(61, TC, SAT);
00358 const Fix_Factory SFIX62(62, TC, SAT);
00359 const Fix_Factory SFIX63(63, TC, SAT);
00360 const Fix_Factory SFIX64(64, TC, SAT);
00362
00364 const Fix_Factory SUFIX1(1, US, SAT);
00366 const Fix_Factory SUFIX2(2, US, SAT);
00367 const Fix_Factory SUFIX3(3, US, SAT);
00368 const Fix_Factory SUFIX4(4, US, SAT);
00369 const Fix_Factory SUFIX5(5, US, SAT);
00370 const Fix_Factory SUFIX6(6, US, SAT);
00371 const Fix_Factory SUFIX7(7, US, SAT);
00372 const Fix_Factory SUFIX8(8, US, SAT);
00373 const Fix_Factory SUFIX9(9, US, SAT);
00374 const Fix_Factory SUFIX10(10, US, SAT);
00375 const Fix_Factory SUFIX11(11, US, SAT);
00376 const Fix_Factory SUFIX12(12, US, SAT);
00377 const Fix_Factory SUFIX13(13, US, SAT);
00378 const Fix_Factory SUFIX14(14, US, SAT);
00379 const Fix_Factory SUFIX15(15, US, SAT);
00380 const Fix_Factory SUFIX16(16, US, SAT);
00381 const Fix_Factory SUFIX17(17, US, SAT);
00382 const Fix_Factory SUFIX18(18, US, SAT);
00383 const Fix_Factory SUFIX19(19, US, SAT);
00384 const Fix_Factory SUFIX20(20, US, SAT);
00385 const Fix_Factory SUFIX21(21, US, SAT);
00386 const Fix_Factory SUFIX22(22, US, SAT);
00387 const Fix_Factory SUFIX23(23, US, SAT);
00388 const Fix_Factory SUFIX24(24, US, SAT);
00389 const Fix_Factory SUFIX25(25, US, SAT);
00390 const Fix_Factory SUFIX26(26, US, SAT);
00391 const Fix_Factory SUFIX27(27, US, SAT);
00392 const Fix_Factory SUFIX28(28, US, SAT);
00393 const Fix_Factory SUFIX29(29, US, SAT);
00394 const Fix_Factory SUFIX30(30, US, SAT);
00395 const Fix_Factory SUFIX31(31, US, SAT);
00396 const Fix_Factory SUFIX32(32, US, SAT);
00397 const Fix_Factory SUFIX33(33, US, SAT);
00398 const Fix_Factory SUFIX34(34, US, SAT);
00399 const Fix_Factory SUFIX35(35, US, SAT);
00400 const Fix_Factory SUFIX36(36, US, SAT);
00401 const Fix_Factory SUFIX37(37, US, SAT);
00402 const Fix_Factory SUFIX38(38, US, SAT);
00403 const Fix_Factory SUFIX39(39, US, SAT);
00404 const Fix_Factory SUFIX40(40, US, SAT);
00405 const Fix_Factory SUFIX41(41, US, SAT);
00406 const Fix_Factory SUFIX42(42, US, SAT);
00407 const Fix_Factory SUFIX43(43, US, SAT);
00408 const Fix_Factory SUFIX44(44, US, SAT);
00409 const Fix_Factory SUFIX45(45, US, SAT);
00410 const Fix_Factory SUFIX46(46, US, SAT);
00411 const Fix_Factory SUFIX47(47, US, SAT);
00412 const Fix_Factory SUFIX48(48, US, SAT);
00413 const Fix_Factory SUFIX49(49, US, SAT);
00414 const Fix_Factory SUFIX50(50, US, SAT);
00415 const Fix_Factory SUFIX51(51, US, SAT);
00416 const Fix_Factory SUFIX52(52, US, SAT);
00417 const Fix_Factory SUFIX53(53, US, SAT);
00418 const Fix_Factory SUFIX54(54, US, SAT);
00419 const Fix_Factory SUFIX55(55, US, SAT);
00420 const Fix_Factory SUFIX56(56, US, SAT);
00421 const Fix_Factory SUFIX57(57, US, SAT);
00422 const Fix_Factory SUFIX58(58, US, SAT);
00423 const Fix_Factory SUFIX59(59, US, SAT);
00424 const Fix_Factory SUFIX60(60, US, SAT);
00425 const Fix_Factory SUFIX61(61, US, SAT);
00426 const Fix_Factory SUFIX62(62, US, SAT);
00427 const Fix_Factory SUFIX63(63, US, SAT);
00428 const Fix_Factory SUFIX64(64, US, SAT);
00430
00431 }
00432
00433 #endif // #ifndef FIX_FACTORY_H