IT++ Logo

cfixed.h

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

Generated on Tue Feb 2 09:33:31 2010 for IT++ by Doxygen 1.6.2