ROOT logo

class TComplex

Function Members (Methods)

TComplex(const TComplex&)
TComplex(Double_t re, Double_t im = 0, Bool_t polar = kFALSE)
static Double_tAbs(const TComplex& c)
static TComplexACos(const TComplex& c)
static TComplexACosH(const TComplex& c)
static TComplexASin(const TComplex& c)
static TComplexASinH(const TComplex& c)
static TComplexATan(const TComplex& c)
static TComplexATanH(const TComplex& c)
static TClass*Class()
static TComplexConjugate(const TComplex& c)
static TComplexCos(const TComplex& c)
static TComplexCosH(const TComplex& c)
static TComplexExp(const TComplex& c)
static Int_tFinite(const TComplex& c)
static TComplexI()
Double_tIm() const
virtual TClass*IsA() const
static Int_tIsNaN(const TComplex& c)
static TComplexLog(const TComplex& c)
static TComplexLog10(const TComplex& c)
static TComplexLog2(const TComplex& c)
static TComplexMax(const TComplex& a, const TComplex& b)
static TComplexMin(const TComplex& a, const TComplex& b)
static TComplexNormalize(const TComplex& c)
static TComplexOne()
Double_toperator Double_t() const
Float_toperator Float_t() const
Int_toperator Int_t() const
TComplexoperator()(Double_t x, Double_t y, Bool_t polar = kFALSE)
TComplexoperator*(const TComplex& c) const
TComplexoperator*(Double_t c) const
TComplexoperator*=(const TComplex& c)
TComplexoperator+(const TComplex& c) const
TComplexoperator+(Double_t c) const
TComplexoperator+=(const TComplex& c)
TComplexoperator-(const TComplex& c) const
TComplexoperator-(Double_t c) const
TComplexoperator-=(const TComplex& c)
TComplexoperator/(const TComplex& c) const
TComplexoperator/(Double_t c) const
TComplexoperator/=(const TComplex& c)
TComplex&operator=(const TComplex&)
static TComplexPower(const TComplex& x, const TComplex& y)
static TComplexPower(const TComplex& x, Double_t y)
static TComplexPower(Double_t x, const TComplex& y)
static TComplexPower(const TComplex& x, Int_t y)
static TComplexRange(const TComplex& lb, const TComplex& ub, const TComplex& c)
Double_tRe() const
Double_tRho() const
Double_tRho2() const
virtual voidShowMembers(TMemberInspector& insp)
static TComplexSin(const TComplex& c)
static TComplexSinH(const TComplex& c)
static TComplexSqrt(const TComplex& c)
virtual voidStreamer(TBuffer& b)
voidStreamerNVirtual(TBuffer& b)
static TComplexTan(const TComplex& c)
static TComplexTanH(const TComplex& c)
Double_tTheta() const

Data Members

Double_tfImimaginary part
Double_tfRereal part

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

TComplex(Double_t re, Double_t im = 0, Bool_t polar = kFALSE)
 Standard constructor
 ctors and dtors
TComplex(Double_t re, Double_t im = 0, Bool_t polar = kFALSE)
virtual ~TComplex()
TComplex I()
{return TComplex(0,1);}
TComplex One()
{return TComplex(1,0);}
Double_t Re() const
 getters and setters
{return fRe;}
Double_t Im() const
{return fIm;}
Double_t Rho() const
{return TMath::Sqrt(fRe*fRe+fIm*fIm);}
Double_t Rho2() const
{return fRe*fRe+fIm*fIm;}
Double_t Theta() const
{return (fIm||fRe)?TMath::ATan2(fIm,fRe):0;}
TComplex operator()(Double_t x, Double_t y, Bool_t polar = kFALSE)
operator Double_t() const
{return fRe;}
operator Float_t() const
{return static_cast<Float_t>(fRe);}
operator Int_t() const
{return static_cast<Int_t>(fRe);}
TComplex Sqrt(const TComplex& c)
 TMath:: extensions
{return TComplex(TMath::Sqrt(c.Rho()),0.5*c.Theta(),kTRUE);}
TComplex Exp(const TComplex& c)
{return TComplex(TMath::Exp(c.fRe),c.fIm,kTRUE);}
TComplex Log(const TComplex& c)
{return TComplex(0.5*TMath::Log(c.Rho2()),c.Theta());}
TComplex Log2(const TComplex& c)
{return Log(c)/TMath::Log(2);}
TComplex Log10(const TComplex& c)
{return Log(c)/TMath::Log(10);}
TComplex Sin(const TComplex& c)
Cos(const TComplex& c)
TComplex Tan(const TComplex& c)
{TComplex cc=Cos(c); return Sin(c)*Conjugate(cc)/cc.Rho2();}
TComplex ASin(const TComplex& c)
{return -I()*Log(I()*c+TMath::Sign(1.,c.Im())*Sqrt(1.-c*c));}
TComplex ACos(const TComplex& c)
{return -I()*Log(c+TMath::Sign(1.,c.Im())*Sqrt(c*c-1.));}
TComplex ATan(const TComplex& c)
{return -0.5*I()*Log((1.+I()*c)/(1.-I()*c));}
TComplex SinH(const TComplex& c)
CosH(const TComplex& c)
TComplex TanH(const TComplex& c)
{TComplex cc=CosH(c); return SinH(c)*Conjugate(cc)/cc.Rho2();}
TComplex ASinH(const TComplex& c)
{return Log(c+TMath::Sign(1.,c.Im())*Sqrt(c*c+1.));}
TComplex ACosH(const TComplex& c)
{return Log(c+TMath::Sign(1.,c.Im())*Sqrt(c*c-1.));}
TComplex ATanH(const TComplex& c)
{return 0.5*Log((1.+c)/(1.-c));}
Double_t Abs(const TComplex& c)
{return c.Rho();}
TComplex Power(const TComplex& x, const TComplex& y)
TComplex Power(const TComplex& x, Double_t y)
{return TComplex(TMath::Power(x.Rho(),y),x.Theta()*y,kTRUE);}
TComplex Power(Double_t x, const TComplex& y)
TComplex Power(const TComplex& x, Int_t y)
{return TComplex(TMath::Power(x.Rho(),y),x.Theta()*y,kTRUE);}
Int_t Finite(const TComplex& c)
{return TMath::Min(TMath::Finite(c.Re()),TMath::Finite(c.Im()));}
Int_t IsNaN(const TComplex& c)
{return TMath::Max(TMath::IsNaN(c.Re()),TMath::IsNaN(c.Im()));}
TComplex Min(const TComplex& a, const TComplex& b)
{return a.Rho()<=b.Rho()?a:b;}
TComplex Max(const TComplex& a, const TComplex& b)
{return a.Rho()>=b.Rho()?a:b;}
TComplex Normalize(const TComplex& c)
{return TComplex(1.,c.Theta(),kTRUE);}
TComplex Conjugate(const TComplex& c)
{return TComplex(c.Re(),-c.Im());}
TComplex Range(const TComplex& lb, const TComplex& ub, const TComplex& c)
{return Max(lb,Min(c,ub));}