50 EvtComplex(
double rpart,
double ipart = 0.0 ) : _rpart( rpart ), _ipart( ipart ) {}
65 double _rpart, _ipart;
112 return EvtComplex( c._rpart * d, c._ipart * d );
117 return EvtComplex( c._rpart * d, c._ipart * d );
122 return EvtComplex( c._rpart / d, c._ipart / d );
143 double Num = d / ( c._rpart * c._rpart + c._ipart * c._ipart );
145 return EvtComplex( Num * c._rpart, -Num * c._ipart );
150 double inv = 1.0 / ( c2._rpart * c2._rpart + c2._ipart * c2._ipart );
152 return EvtComplex( inv * ( c1._rpart * c2._rpart + c1._ipart * c2._ipart ),
153 inv * ( c1._ipart * c2._rpart - c1._rpart * c2._ipart ) );
158 return EvtComplex( c1._rpart * c2._rpart - c1._ipart * c2._ipart,
159 c1._rpart * c2._ipart + c1._ipart * c2._rpart );
164 return EvtComplex( c1._rpart - c2._rpart, c1._ipart - c2._ipart );
169 return EvtComplex( c1._rpart + c2._rpart, c1._ipart + c2._ipart );
174 return _rpart == c._rpart && _ipart == c._ipart;
179 return _rpart != c._rpart || _ipart != c._ipart;
188 double c2 = c._rpart * c._rpart + c._ipart * c._ipart;
189 if ( c2 <= 0.0 )
return 0.0;
193double abs2(
const EvtComplex& c ) {
return c._rpart * c._rpart + c._ipart * c._ipart; }
196 if ( ( c._rpart == 0 ) && ( c._ipart == 0 ) ) {
return 0.0; }
202 else {
return atan2( c._ipart, c._rpart ); }
EvtComplex conj(const EvtComplex &c)
double imag(const EvtComplex &c)
EvtComplexPtrPtr * EvtComplexPtrPtrPtr
double abs2(const EvtComplex &c)
EvtComplex exp(const EvtComplex &c)
EvtComplex operator/(const EvtComplex &c, double d)
EvtComplex * EvtComplexPtr
EvtComplex operator*(double d, const EvtComplex &c)
EvtComplex operator-(const EvtComplex &c1, const EvtComplex &c2)
double arg(const EvtComplex &c)
EvtComplex operator+(const EvtComplex &c1, const EvtComplex &c2)
EvtComplexPtr * EvtComplexPtrPtr
double sin(const BesAngle a)
double cos(const BesAngle a)
EvtComplex & operator+=(const EvtComplex &c)
friend EvtComplex conj(const EvtComplex &c)
friend double imag(const EvtComplex &c)
friend std::ostream & operator<<(std::ostream &s, const EvtComplex &c)
EvtComplex & operator=(const EvtComplex &c)
friend double abs2(const EvtComplex &c)
EvtComplex(const EvtComplex &c)
friend EvtComplex exp(const EvtComplex &c)
EvtComplex & operator*=(double d)
friend EvtComplex operator/(const EvtComplex &c, double d)
int operator!=(const EvtComplex c)
EvtComplex(double rpart, double ipart=0.0)
friend EvtComplex operator*(double d, const EvtComplex &c)
EvtComplex & operator-=(const EvtComplex &c)
EvtComplex & operator/=(double d)
friend EvtComplex operator-(const EvtComplex &c1, const EvtComplex &c2)
friend double arg(const EvtComplex &c)
friend EvtComplex operator+(const EvtComplex &c1, const EvtComplex &c2)
int operator==(const EvtComplex c)