EvtComplex Class Reference

#include <EvtComplex.hh>

List of all members.

Public Member Functions

 EvtComplex ()
 EvtComplex (double rpart, double ipart=0.0)
 EvtComplex (const EvtComplex &c)
EvtComplexoperator *= (double d)
EvtComplexoperator/= (double d)
EvtComplexoperator *= (EvtComplex c)
EvtComplexoperator/= (EvtComplex c)
EvtComplexoperator= (const EvtComplex &c)
EvtComplexoperator+= (const EvtComplex &c)
EvtComplexoperator-= (const EvtComplex &c)
EvtComplexoperator+= (double d)
EvtComplexoperator-= (double d)
int operator== (const EvtComplex c)
int operator!= (const EvtComplex c)

Private Attributes

double _rpart
double _ipart

Friends

EvtComplex operator * (double d, const EvtComplex &c)
EvtComplex operator * (const EvtComplex &c, double d)
EvtComplex operator/ (const EvtComplex &c, double d)
EvtComplex operator/ (double d, const EvtComplex &c)
EvtComplex operator * (const EvtComplex &c1, const EvtComplex &c2)
EvtComplex operator/ (const EvtComplex &c1, const EvtComplex &c2)
EvtComplex operator+ (const EvtComplex &c1, const EvtComplex &c2)
EvtComplex operator- (const EvtComplex &c1, const EvtComplex &c2)
EvtComplex operator- (const EvtComplex &c)
EvtComplex conj (const EvtComplex &c)
double abs (const EvtComplex &c)
double abs2 (const EvtComplex &c)
double arg (const EvtComplex &c)
double real (const EvtComplex &c)
double imag (const EvtComplex &c)
EvtComplex exp (const EvtComplex &c)
std::ostreamoperator<< (std::ostream &s, const EvtComplex &c)


Detailed Description

Definition at line 28 of file EvtComplex.hh.


Constructor & Destructor Documentation

EvtComplex::EvtComplex (  )  [inline]

Definition at line 49 of file EvtComplex.hh.

00049 :_rpart(0.0),_ipart(0.0){}

EvtComplex::EvtComplex ( double  rpart,
double  ipart = 0.0 
) [inline]

Definition at line 50 of file EvtComplex.hh.

00050 :_rpart(rpart),_ipart(ipart){}

EvtComplex::EvtComplex ( const EvtComplex c  )  [inline]

Definition at line 51 of file EvtComplex.hh.

00051 :_rpart(c._rpart),_ipart(c._ipart){}


Member Function Documentation

EvtComplex & EvtComplex::operator *= ( EvtComplex  c  ) 

Definition at line 35 of file EvtComplex.cc.

References _ipart, _rpart, and genRecEmupikp::i.

00035                                               {
00036 
00037   double r=_rpart*c._rpart-_ipart*c._ipart;
00038   double i=_rpart*c._ipart+_ipart*c._rpart;
00039   
00040   _rpart=r;
00041   _ipart=i;
00042 
00043   return *this;
00044 
00045 }

EvtComplex & EvtComplex::operator *= ( double  d  )  [inline]

Definition at line 131 of file EvtComplex.hh.

References _ipart, and _rpart.

00131                                           {
00132 
00133   _rpart*=d;
00134   _ipart*=d;
00135 
00136   return *this;
00137 
00138 }

int EvtComplex::operator!= ( const EvtComplex  c  )  [inline]

Definition at line 193 of file EvtComplex.hh.

References _ipart, and _rpart.

00193                                             {
00194 
00195   return _rpart!=c._rpart||_ipart!=c._ipart;
00196 
00197 }

EvtComplex & EvtComplex::operator+= ( double  d  )  [inline]

Definition at line 97 of file EvtComplex.hh.

References _rpart.

00097                                           {
00098 
00099   _rpart+=d;
00100   
00101   return *this; 
00102 }

EvtComplex & EvtComplex::operator+= ( const EvtComplex c  )  [inline]

Definition at line 81 of file EvtComplex.hh.

References _ipart, and _rpart.

00081                                                      {
00082 
00083   _rpart+=c._rpart;
00084   _ipart+=c._ipart;
00085   
00086   return *this; 
00087 }

EvtComplex & EvtComplex::operator-= ( double  d  )  [inline]

Definition at line 104 of file EvtComplex.hh.

References _rpart.

00104                                           {
00105 
00106   _rpart-=d;
00107 
00108   return *this; 
00109 }

EvtComplex & EvtComplex::operator-= ( const EvtComplex c  )  [inline]

Definition at line 89 of file EvtComplex.hh.

References _ipart, and _rpart.

00089                                                      {
00090 
00091   _rpart-=c._rpart;
00092   _ipart-=c._ipart;
00093 
00094   return *this; 
00095 }

EvtComplex & EvtComplex::operator/= ( EvtComplex  c  ) 

Definition at line 47 of file EvtComplex.cc.

References _ipart, _rpart, and genRecEmupikp::i.

00047                                               {
00048 
00049   double inv=1.0/(c._rpart*c._rpart+c._ipart*c._ipart);
00050 
00051   double r=inv*(_rpart*c._rpart+_ipart*c._ipart);
00052   double i=inv*(_ipart*c._rpart-_rpart*c._ipart);
00053 
00054   _rpart=r;
00055   _ipart=i;
00056 
00057   return *this;
00058 
00059 }

EvtComplex & EvtComplex::operator/= ( double  d  )  [inline]

Definition at line 141 of file EvtComplex.hh.

References _ipart, and _rpart.

00141                                           {
00142 
00143   _rpart/=d;
00144   _ipart/=d;
00145 
00146   return *this;
00147 }

EvtComplex & EvtComplex::operator= ( const EvtComplex c  )  [inline]

Definition at line 73 of file EvtComplex.hh.

References _ipart, and _rpart.

00073                                                     {
00074   
00075   _rpart=c._rpart;
00076   _ipart=c._ipart;
00077   
00078   return *this; 
00079 }

int EvtComplex::operator== ( const EvtComplex  c  )  [inline]

Definition at line 187 of file EvtComplex.hh.

References _ipart, and _rpart.

00187                                             {
00188 
00189   return _rpart==c._rpart&&_ipart==c._ipart;
00190 
00191 }


Friends And Related Function Documentation

double abs ( const EvtComplex c  )  [friend]

Definition at line 212 of file EvtComplex.hh.

00212                                {
00213 
00214   double c2=c._rpart*c._rpart+c._ipart*c._ipart;
00215   if (c2<=0.0) return 0.0;
00216   return sqrt(c2);
00217 
00218 }

double abs2 ( const EvtComplex c  )  [friend]

Definition at line 221 of file EvtComplex.hh.

00221                                 {
00222 
00223   return c._rpart*c._rpart+c._ipart*c._ipart;
00224 }

double arg ( const EvtComplex c  )  [friend]

Definition at line 227 of file EvtComplex.hh.

00227                                {     //added by FS
00228   if ((c._rpart==0)&&(c._ipart==0)) {return 0.0;}
00229   if (c._rpart==0){
00230     if (c._ipart>0){
00231       return EvtConst::pi/2;
00232     } else {
00233       return -EvtConst::pi/2;
00234     }
00235   } else {
00236     return atan2(c._ipart,c._rpart);
00237   }      
00238 }

EvtComplex conj ( const EvtComplex c  )  [friend]

Definition at line 206 of file EvtComplex.hh.

00206                                     {
00207 
00208   return EvtComplex(c._rpart,-c._ipart);
00209 
00210 }

EvtComplex exp ( const EvtComplex c  )  [friend]

Definition at line 252 of file EvtComplex.hh.

00252                                    {
00253 
00254   return exp(c._rpart)*EvtComplex(cos(c._ipart),sin(c._ipart));
00255 
00256 }

double imag ( const EvtComplex c  )  [friend]

Definition at line 246 of file EvtComplex.hh.

00246                                 {
00247 
00248   return c._ipart;
00249 
00250 }

EvtComplex operator * ( const EvtComplex c1,
const EvtComplex c2 
) [friend]

Definition at line 168 of file EvtComplex.hh.

00168                                                                {
00169 
00170   return EvtComplex(c1._rpart*c2._rpart-c1._ipart*c2._ipart,
00171                     c1._rpart*c2._ipart+c1._ipart*c2._rpart);
00172 
00173 }

EvtComplex operator * ( const EvtComplex c,
double  d 
) [friend]

Definition at line 117 of file EvtComplex.hh.

00117                                                    {
00118   
00119   return EvtComplex(c._rpart*d,c._ipart*d);
00120 
00121 }

EvtComplex operator * ( double  d,
const EvtComplex c 
) [friend]

Definition at line 111 of file EvtComplex.hh.

00111                                                   {
00112   
00113   return EvtComplex(c._rpart*d,c._ipart*d);
00114 
00115 }

EvtComplex operator+ ( const EvtComplex c1,
const EvtComplex c2 
) [friend]

Definition at line 181 of file EvtComplex.hh.

00181                                                                {
00182   
00183   return EvtComplex(c1._rpart+c2._rpart,c1._ipart+c2._ipart);
00184 
00185 }

EvtComplex operator- ( const EvtComplex c  )  [friend]

Definition at line 200 of file EvtComplex.hh.

00200                                          {
00201 
00202   return EvtComplex(-c._rpart,-c._ipart);
00203 
00204 }

EvtComplex operator- ( const EvtComplex c1,
const EvtComplex c2 
) [friend]

Definition at line 175 of file EvtComplex.hh.

00175                                                                {
00176   
00177   return EvtComplex(c1._rpart-c2._rpart,c1._ipart-c2._ipart);
00178 
00179 }

EvtComplex operator/ ( const EvtComplex c1,
const EvtComplex c2 
) [friend]

Definition at line 159 of file EvtComplex.hh.

00159                                                                {
00160 
00161   double inv=1.0/(c2._rpart*c2._rpart+c2._ipart*c2._ipart);
00162 
00163   return EvtComplex(inv*(c1._rpart*c2._rpart+c1._ipart*c2._ipart),
00164                     inv*(c1._ipart*c2._rpart-c1._rpart*c2._ipart));
00165 
00166 }

EvtComplex operator/ ( double  d,
const EvtComplex c 
) [friend]

Definition at line 149 of file EvtComplex.hh.

00149                                                    {
00150 
00151 double Num=d/(c._rpart*c._rpart+c._ipart*c._ipart);
00152 
00153 return EvtComplex( Num*c._rpart, -Num*c._ipart );
00154 
00155 }

EvtComplex operator/ ( const EvtComplex c,
double  d 
) [friend]

Definition at line 125 of file EvtComplex.hh.

00125                                                   {
00126   
00127   return EvtComplex(c._rpart/d,c._ipart/d);
00128 
00129 }

std::ostream& operator<< ( std::ostream s,
const EvtComplex c 
) [friend]

double real ( const EvtComplex c  )  [friend]

Definition at line 240 of file EvtComplex.hh.

00240                                 {
00241 
00242   return c._rpart;
00243 
00244 }


Member Data Documentation

double EvtComplex::_ipart [private]

Definition at line 64 of file EvtComplex.hh.

Referenced by abs(), abs2(), arg(), conj(), exp(), imag(), operator *(), operator *=(), operator!=(), operator+(), operator+=(), operator-(), operator-=(), operator/(), operator/=(), operator<<(), operator=(), and operator==().

double EvtComplex::_rpart [private]

Definition at line 64 of file EvtComplex.hh.

Referenced by abs(), abs2(), arg(), conj(), exp(), operator *(), operator *=(), operator!=(), operator+(), operator+=(), operator-(), operator-=(), operator/(), operator/=(), operator<<(), operator=(), operator==(), and real().


Generated on Tue Nov 29 23:18:56 2016 for BOSS_7.0.2 by  doxygen 1.4.7