00001 00029 #ifndef CFIXED_H 00030 #define CFIXED_H 00031 00032 #include <itpp/fixed/cfix.h> 00033 00034 00035 namespace itpp 00036 { 00037 00048 template < int w, e_mode e = TC, o_mode o = WRAP, q_mode q = TRN > 00049 class CFixed : public CFix 00050 { 00051 public: 00053 CFixed(double r = 0.0, double i = 0.0, int s = 0, Stat *ptr = 0) 00054 : CFix(r, i, s, w, e, o, q, ptr) {} 00056 CFixed(std::complex<double> x, double, int s = 0, Stat *ptr = 0) 00057 : CFix(x, 0.0, s, w, e, o, q, ptr) {} 00059 explicit CFixed(Stat *ptr) 00060 : CFix(0.0, 0.0, 0, w, e, o, q, ptr) {} 00062 CFixed(const Fix &r, const Fix &i = 0.0, Stat *ptr = 0) 00063 : CFix(r, i, w, e, o, q, ptr) {} 00065 CFixed(const CFix &x, double, Stat *ptr = 0) 00066 : CFix(x, 0.0, w, e, o, q, ptr) {} 00068 virtual ~CFixed() {} 00069 00071 CFixed& operator=(const CFix &x) { 00072 shift = x.shift; 00073 re = apply_o_mode(x.re); 00074 im = apply_o_mode(x.im); 00075 return *this; 00076 } 00078 CFixed& operator=(const Fix &x) { 00079 shift = x.shift; 00080 re = apply_o_mode(x.re); 00081 im = 0; 00082 return *this; 00083 } 00085 CFixed& operator=(const std::complex<double> &x) { 00086 shift = 0; 00087 re = apply_o_mode(fixrep(real(x))); 00088 im = apply_o_mode(fixrep(imag(x))); 00089 return *this; 00090 } 00092 CFixed& operator=(int x) { 00093 shift = 0; 00094 re = apply_o_mode(x); 00095 im = 0; 00096 return *this; 00097 } 00098 protected: 00099 }; 00100 00103 00104 typedef CFixed<1, TC, WRAP> cfixed1; 00106 typedef CFixed<2, TC, WRAP> cfixed2; 00107 typedef CFixed<3, TC, WRAP> cfixed3; 00108 typedef CFixed<4, TC, WRAP> cfixed4; 00109 typedef CFixed<5, TC, WRAP> cfixed5; 00110 typedef CFixed<6, TC, WRAP> cfixed6; 00111 typedef CFixed<7, TC, WRAP> cfixed7; 00112 typedef CFixed<8, TC, WRAP> cfixed8; 00113 typedef CFixed<9, TC, WRAP> cfixed9; 00114 typedef CFixed<10, TC, WRAP> cfixed10; 00115 typedef CFixed<11, TC, WRAP> cfixed11; 00116 typedef CFixed<12, TC, WRAP> cfixed12; 00117 typedef CFixed<13, TC, WRAP> cfixed13; 00118 typedef CFixed<14, TC, WRAP> cfixed14; 00119 typedef CFixed<15, TC, WRAP> cfixed15; 00120 typedef CFixed<16, TC, WRAP> cfixed16; 00121 typedef CFixed<17, TC, WRAP> cfixed17; 00122 typedef CFixed<18, TC, WRAP> cfixed18; 00123 typedef CFixed<19, TC, WRAP> cfixed19; 00124 typedef CFixed<20, TC, WRAP> cfixed20; 00125 typedef CFixed<21, TC, WRAP> cfixed21; 00126 typedef CFixed<22, TC, WRAP> cfixed22; 00127 typedef CFixed<23, TC, WRAP> cfixed23; 00128 typedef CFixed<24, TC, WRAP> cfixed24; 00129 typedef CFixed<25, TC, WRAP> cfixed25; 00130 typedef CFixed<26, TC, WRAP> cfixed26; 00131 typedef CFixed<27, TC, WRAP> cfixed27; 00132 typedef CFixed<28, TC, WRAP> cfixed28; 00133 typedef CFixed<29, TC, WRAP> cfixed29; 00134 typedef CFixed<30, TC, WRAP> cfixed30; 00135 typedef CFixed<31, TC, WRAP> cfixed31; 00136 typedef CFixed<32, TC, WRAP> cfixed32; 00137 typedef CFixed<33, TC, WRAP> cfixed33; 00138 typedef CFixed<34, TC, WRAP> cfixed34; 00139 typedef CFixed<35, TC, WRAP> cfixed35; 00140 typedef CFixed<36, TC, WRAP> cfixed36; 00141 typedef CFixed<37, TC, WRAP> cfixed37; 00142 typedef CFixed<38, TC, WRAP> cfixed38; 00143 typedef CFixed<39, TC, WRAP> cfixed39; 00144 typedef CFixed<40, TC, WRAP> cfixed40; 00145 typedef CFixed<41, TC, WRAP> cfixed41; 00146 typedef CFixed<42, TC, WRAP> cfixed42; 00147 typedef CFixed<43, TC, WRAP> cfixed43; 00148 typedef CFixed<44, TC, WRAP> cfixed44; 00149 typedef CFixed<45, TC, WRAP> cfixed45; 00150 typedef CFixed<46, TC, WRAP> cfixed46; 00151 typedef CFixed<47, TC, WRAP> cfixed47; 00152 typedef CFixed<48, TC, WRAP> cfixed48; 00153 typedef CFixed<49, TC, WRAP> cfixed49; 00154 typedef CFixed<50, TC, WRAP> cfixed50; 00155 typedef CFixed<51, TC, WRAP> cfixed51; 00156 typedef CFixed<52, TC, WRAP> cfixed52; 00157 typedef CFixed<53, TC, WRAP> cfixed53; 00158 typedef CFixed<54, TC, WRAP> cfixed54; 00159 typedef CFixed<55, TC, WRAP> cfixed55; 00160 typedef CFixed<56, TC, WRAP> cfixed56; 00161 typedef CFixed<57, TC, WRAP> cfixed57; 00162 typedef CFixed<58, TC, WRAP> cfixed58; 00163 typedef CFixed<59, TC, WRAP> cfixed59; 00164 typedef CFixed<60, TC, WRAP> cfixed60; 00165 typedef CFixed<61, TC, WRAP> cfixed61; 00166 typedef CFixed<62, TC, WRAP> cfixed62; 00167 typedef CFixed<63, TC, WRAP> cfixed63; 00168 typedef CFixed<64, TC, WRAP> cfixed64; 00170 00172 typedef CFixed<1, TC, WRAP> cfixed1; 00174 typedef CFixed<1, TC, SAT> scfixed1; 00175 typedef CFixed<2, TC, SAT> scfixed2; 00176 typedef CFixed<3, TC, SAT> scfixed3; 00177 typedef CFixed<4, TC, SAT> scfixed4; 00178 typedef CFixed<5, TC, SAT> scfixed5; 00179 typedef CFixed<6, TC, SAT> scfixed6; 00180 typedef CFixed<7, TC, SAT> scfixed7; 00181 typedef CFixed<8, TC, SAT> scfixed8; 00182 typedef CFixed<9, TC, SAT> scfixed9; 00183 typedef CFixed<10, TC, SAT> scfixed10; 00184 typedef CFixed<11, TC, SAT> scfixed11; 00185 typedef CFixed<12, TC, SAT> scfixed12; 00186 typedef CFixed<13, TC, SAT> scfixed13; 00187 typedef CFixed<14, TC, SAT> scfixed14; 00188 typedef CFixed<15, TC, SAT> scfixed15; 00189 typedef CFixed<16, TC, SAT> scfixed16; 00190 typedef CFixed<17, TC, SAT> scfixed17; 00191 typedef CFixed<18, TC, SAT> scfixed18; 00192 typedef CFixed<19, TC, SAT> scfixed19; 00193 typedef CFixed<20, TC, SAT> scfixed20; 00194 typedef CFixed<21, TC, SAT> scfixed21; 00195 typedef CFixed<22, TC, SAT> scfixed22; 00196 typedef CFixed<23, TC, SAT> scfixed23; 00197 typedef CFixed<24, TC, SAT> scfixed24; 00198 typedef CFixed<25, TC, SAT> scfixed25; 00199 typedef CFixed<26, TC, SAT> scfixed26; 00200 typedef CFixed<27, TC, SAT> scfixed27; 00201 typedef CFixed<28, TC, SAT> scfixed28; 00202 typedef CFixed<29, TC, SAT> scfixed29; 00203 typedef CFixed<30, TC, SAT> scfixed30; 00204 typedef CFixed<31, TC, SAT> scfixed31; 00205 typedef CFixed<32, TC, SAT> scfixed32; 00206 typedef CFixed<33, TC, SAT> scfixed33; 00207 typedef CFixed<34, TC, SAT> scfixed34; 00208 typedef CFixed<35, TC, SAT> scfixed35; 00209 typedef CFixed<36, TC, SAT> scfixed36; 00210 typedef CFixed<37, TC, SAT> scfixed37; 00211 typedef CFixed<38, TC, SAT> scfixed38; 00212 typedef CFixed<39, TC, SAT> scfixed39; 00213 typedef CFixed<40, TC, SAT> scfixed40; 00214 typedef CFixed<41, TC, SAT> scfixed41; 00215 typedef CFixed<42, TC, SAT> scfixed42; 00216 typedef CFixed<43, TC, SAT> scfixed43; 00217 typedef CFixed<44, TC, SAT> scfixed44; 00218 typedef CFixed<45, TC, SAT> scfixed45; 00219 typedef CFixed<46, TC, SAT> scfixed46; 00220 typedef CFixed<47, TC, SAT> scfixed47; 00221 typedef CFixed<48, TC, SAT> scfixed48; 00222 typedef CFixed<49, TC, SAT> scfixed49; 00223 typedef CFixed<50, TC, SAT> scfixed50; 00224 typedef CFixed<51, TC, SAT> scfixed51; 00225 typedef CFixed<52, TC, SAT> scfixed52; 00226 typedef CFixed<53, TC, SAT> scfixed53; 00227 typedef CFixed<54, TC, SAT> scfixed54; 00228 typedef CFixed<55, TC, SAT> scfixed55; 00229 typedef CFixed<56, TC, SAT> scfixed56; 00230 typedef CFixed<57, TC, SAT> scfixed57; 00231 typedef CFixed<58, TC, SAT> scfixed58; 00232 typedef CFixed<59, TC, SAT> scfixed59; 00233 typedef CFixed<60, TC, SAT> scfixed60; 00234 typedef CFixed<61, TC, SAT> scfixed61; 00235 typedef CFixed<62, TC, SAT> scfixed62; 00236 typedef CFixed<63, TC, SAT> scfixed63; 00237 typedef CFixed<64, TC, SAT> scfixed64; 00238 00239 // ---------------------------------------------------------------------- 00240 // Instantiations 00241 // ---------------------------------------------------------------------- 00242 #ifndef _MSC_VER 00243 extern template class CFixed<64, TC, WRAP>; 00244 #endif // _MSC_VER 00245 00247 00248 } // namespace itpp 00249 00250 #endif // #ifndef CFIXED_H
Generated on Sat Jul 9 2011 15:21:32 for IT++ by Doxygen 1.7.4