00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 namespace cxsc {
00028
00029
00030
00031 inline l_complex operator +(const l_complex &a, const l_complex &b) throw()
00032 {
00033 return l_complex(a.re + b.re, a.im + b.im);
00034 }
00035
00036 inline l_complex operator -(const l_complex &a, const l_complex &b) throw()
00037 {
00038 return l_complex(a.re - b.re, a.im - b.im);
00039 }
00040
00041 inline l_complex l_complex::operator +(const complex &op2) const throw()
00042 {
00043 return l_complex(this->re + Re(op2), this->im + Im(op2));
00044 }
00045
00046 inline l_complex operator + (const complex& c, const l_complex& lc) throw()
00047 {
00048 return lc + c;
00049 }
00050
00051 inline l_complex l_complex::operator + (const real& op2) const throw()
00052 {
00053 return l_complex(this->re + op2, this->im);
00054 }
00055
00056 inline l_complex operator +
00057 (const real& r, const l_complex& lc) throw()
00058 {
00059 return lc + r;
00060 }
00061
00062 inline l_complex l_complex::operator + (const l_real& op2) const throw()
00063 {
00064 return l_complex(this->re + op2, this->im);
00065 }
00066
00067 inline l_complex operator +
00068 (const l_real& r, const l_complex& lc) throw()
00069 {
00070 return lc + r;
00071 }
00072
00073 inline l_complex l_complex::operator - (const l_real& op2) const throw()
00074 {
00075 return l_complex(this->re - op2, this->im);
00076 }
00077
00078 inline l_complex operator -
00079 (const l_real& r, const l_complex& lc) throw()
00080 {
00081 return -(lc - r);
00082 }
00083
00084 inline l_complex l_complex::operator -(const complex &op2) const throw()
00085 {
00086 return l_complex(this->re - Re(op2), this->im - Im(op2));
00087 }
00088
00089 inline l_complex operator - (const complex& c, const l_complex& lc) throw()
00090 {
00091 return -(lc-c);
00092 }
00093
00094 inline l_complex l_complex::operator - (const real& op2) const throw()
00095 {
00096 return l_complex(this->re - op2, this->im);
00097 }
00098
00099 inline l_complex operator -
00100 (const real& r, const l_complex& lc) throw()
00101 {
00102 return -(lc-r);
00103 }
00104
00105 inline l_complex l_complex::operator * (const real& op2) const throw()
00106 {
00107 return l_complex(this->re * op2, this->im * op2);
00108 }
00109
00110 inline l_complex operator *
00111 (const real& r, const l_complex& lc) throw()
00112 {
00113 return lc * r;
00114 }
00115
00116 inline l_complex l_complex::operator * (const l_real& op2) const throw()
00117 {
00118 return l_complex(this->re * op2, this->im * op2);
00119 }
00120
00121 inline l_complex operator *
00122 (const l_real& r, const l_complex& lc) throw()
00123 {
00124 return lc * r;
00125 }
00126
00127
00128 inline l_complex & operator += (l_complex &lc, const l_complex &lc1) throw()
00129 {
00130 lc = lc + lc1; return lc;
00131 }
00132 inline l_complex & operator -= (l_complex &lc, const l_complex &lc1) throw()
00133 {
00134 lc = lc - lc1; return lc;
00135 }
00136 inline l_complex & operator += (l_complex &lc, const complex &c) throw()
00137 {
00138 lc = lc + c; return lc;
00139 }
00140 inline l_complex & operator -= (l_complex &lc, const complex &c) throw()
00141 {
00142 lc = lc - c; return lc;
00143 }
00144 inline l_complex & operator += (l_complex &lc, const real &r) throw()
00145 {
00146 lc = lc + r; return lc;
00147 }
00148 inline l_complex & operator -= (l_complex &lc, const real &r) throw()
00149 {
00150 lc = lc - r; return lc;
00151 }
00152 inline l_complex & operator += (l_complex &lc, const l_real &lr) throw()
00153 {
00154 lc = lc + lr; return lc;
00155 }
00156 inline l_complex & operator -= (l_complex &lc, const l_real &lr) throw()
00157 {
00158 lc = lc - lr; return lc;
00159 }
00160
00161
00162 inline l_complex & operator *= (l_complex &lc, const l_complex &lc1) throw()
00163 {
00164 lc = lc * lc1; return lc;
00165 }
00166 inline l_complex & operator *= (l_complex &lc, const complex &c) throw()
00167 {
00168 lc = lc * c; return lc;
00169 }
00170 inline l_complex & operator *= (l_complex &lc, const real &r) throw()
00171 {
00172 lc = lc * r; return lc;
00173 }
00174 inline l_complex & operator *= (l_complex &lc, const l_real &lr) throw()
00175 {
00176 lc = lc * lr; return lc;
00177 }
00178
00179 inline l_complex operator / (const l_complex& a, const complex& b) throw()
00180 {
00181 return a / l_complex(b);
00182 }
00183
00184 inline l_complex operator / (const l_complex& a, const l_real& b) throw()
00185 {
00186 return l_complex(a.re/b, a.im/b);
00187 }
00188
00189 inline l_complex operator / (const l_complex& a, const real& b) throw()
00190 {
00191 return l_complex(a.re/b, a.im/b);
00192 }
00193
00194 inline l_complex operator / (const complex& a, const l_complex& b) throw()
00195 {
00196 return l_complex(a) / b;
00197 }
00198
00199 inline l_complex operator / (const real& a, const l_complex& b) throw()
00200 {
00201 return l_complex(a) / b;
00202 }
00203
00204 inline l_complex operator / (const l_real& a, const l_complex& b) throw()
00205 {
00206 return l_complex(a) / b;
00207 }
00208
00209 inline l_complex& operator /= (l_complex& a, const l_complex& b) throw()
00210 { return a = a/b; }
00211
00212 inline l_complex& operator /= (l_complex& a, const complex& b) throw()
00213 { return a = a/b; }
00214
00215 inline l_complex& operator /= (l_complex& a, const real& b) throw()
00216 { return a = a/b; }
00217
00218 inline l_complex& operator /= (l_complex& a, const l_real& b) throw()
00219 { return a = a/b; }
00220
00221
00222
00223 inline bool operator! (const l_complex & a) throw() { return !a.re && !a.im; }
00224 inline bool operator== (const l_complex & a, const l_complex & b) throw()
00225 { return a.re==b.re && a.im==b.im; }
00226 inline bool operator!= (const l_complex & a, const l_complex & b) throw()
00227 { return a.re!=b.re || a.im!=b.im; }
00228 inline bool operator== (const l_complex & a, const complex & b) throw()
00229 { return a.re==Re(b) && a.im==Im(b); }
00230 inline bool operator== (const complex & a, const l_complex & b) throw()
00231 { return Re(a)==b.re && Im(a)==b.im; }
00232 inline bool operator!= (const l_complex & a, const complex & b) throw()
00233 { return a.re!=Re(b) || a.im!=Im(b); }
00234 inline bool operator!= (const complex & a, const l_complex & b) throw()
00235 { return Re(a)!=b.re || Im(a)!=b.im; }
00236 inline bool operator== (const l_complex & a, const real & b) throw()
00237 { return a.re==b && !a.im; }
00238 inline bool operator== (const real & a, const l_complex & b) throw()
00239 { return a==b.re && !b.im; }
00240 inline bool operator!= (const l_complex & a, const real & b) throw()
00241 { return a.re!=b || !!a.im; }
00242 inline bool operator!= (const real & a, const l_complex & b) throw()
00243 { return a!=b.re || !!b.im; }
00244 inline bool operator== (const l_complex & a, const l_real & b) throw()
00245 { return a.re==b && !a.im; }
00246 inline bool operator== (const l_real & a, const l_complex & b) throw()
00247 { return a==b.re && !b.im; }
00248 inline bool operator!= (const l_complex & a, const l_real & b) throw()
00249 { return a.re!=b || !!a.im; }
00250 inline bool operator!= (const l_real & a, const l_complex & b) throw()
00251 { return a!=b.re || !!b.im; }
00252 inline bool operator== (const l_complex & a, const dotprecision & b) throw()
00253 { return a.re==b && !a.im; }
00254 inline bool operator== (const dotprecision & a, const l_complex & b) throw()
00255 { return b.re==a && !b.im; }
00256 inline bool operator!= (const l_complex & a, const dotprecision & b) throw()
00257 { return a.re!=b || !!a.im; }
00258 inline bool operator!= (const dotprecision & a, const l_complex & b) throw()
00259 { return b.re!=a || !!b.im; }
00260
00261 inline bool operator ==(const l_complex &c, const cdotprecision &a)
00262 throw() { return(c.re==Re(_l_complex(a)) && c.im==Im(_l_complex(a))); }
00263 inline bool operator !=(const l_complex &c, const cdotprecision &a)
00264 throw() { return(c.re!=Re(_l_complex(a)) || c.im!=Im(_l_complex(a))); }
00265 inline bool operator ==(const cdotprecision &a, const l_complex &c)
00266 throw() { return(c.re==Re(_l_complex(a)) && c.im==Im(_l_complex(a))); }
00267 inline bool operator !=(const cdotprecision &a, const l_complex &c)
00268 throw() { return(c.re!=Re(_l_complex(a)) || c.im!=Im(_l_complex(a))); }
00269
00270 inline l_complex conj(const l_complex& a) throw()
00271 { return l_complex(a.re,-a.im); }
00272
00273 }
00274
00275
00276
00277
00278
00279
00280
00281