Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

EvtComplex Class Reference

#include <EvtComplex.hh>

List of all members.

Public Member Functions

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

Private Attributes

double _ipart
double _rpart

Friends

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


Constructor & Destructor Documentation

EvtComplex::EvtComplex  )  [inline]
 

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

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

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

EvtComplex::EvtComplex const EvtComplex c  )  [inline]
 

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


Member Function Documentation

EvtComplex & EvtComplex::operator *= EvtComplex  c  ) 
 

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]
 

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

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

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

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

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

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

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

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

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

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

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

EvtComplex & EvtComplex::operator/= EvtComplex  c  ) 
 

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*(_rpart*c._ipart-_ipart*c._rpart);
00053 
00054   _rpart=r;
00055   _ipart=i;
00056 
00057   return *this;
00058 
00059 }

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

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

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

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

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

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


Friends And Related Function Documentation

double abs const EvtComplex c  )  [friend]
 

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]
 

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

double arg const EvtComplex c  )  [friend]
 

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]
 

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

EvtComplex exp const EvtComplex c  )  [friend]
 

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

double imag const EvtComplex c  )  [friend]
 

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

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

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]
 

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

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

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

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

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

EvtComplex operator- const EvtComplex c  )  [friend]
 

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

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

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

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

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]
 

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]
 

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]
 

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


Member Data Documentation

double EvtComplex::_ipart [private]
 

double EvtComplex::_rpart [private]
 


The documentation for this class was generated from the following files:
Generated on Wed Feb 2 16:04:24 2011 for BOSS6.5.5 by  doxygen 1.3.9.1