11 #include <gsl/gsl_complex_math.h>
23 fData =
new double[2];
47 fData[0]=other.dat[0];
48 fData[1]=other.dat[1];
146 (*this)= (*this)*other;
152 (*this)= (*this)/other;
237 Diana::QComplex
operator*(
double t,
const Diana::QComplex &z){
238 Diana::QComplex tmp(z);
242 Diana::QComplex
operator/(
double t,
const Diana::QComplex &z){
243 Diana::QComplex tmp(t,0);
246 Diana::QComplex
pow(
const Diana::QComplex &z,
double a) {
250 gsl_complex oZ=gsl_complex_pow_real(iZ,
a);
251 return Diana::QComplex(oZ.dat[0],oZ.dat[1]);
253 Diana::QComplex
pow(
const Diana::QComplex &z,
const Diana::QComplex &
a) {
255 iZ.dat[0]=z.Re();iZ.dat[1]=z.Im();
256 iA.dat[0]=
a.Re();iA.dat[1]=
a.Im();
257 gsl_complex oZ=gsl_complex_pow(iZ,iA);
258 return Diana::QComplex(oZ.dat[0],oZ.dat[1]);
260 double Re(
const Diana::QComplex &z) {
return z.Re(); }
262 double Im(
const Diana::QComplex &z) {
return z.Im(); }
264 std::ostream&
operator<<(std::ostream& s,
const Diana::QComplex& z)
std::ostream & operator<<(std::ostream &s, const Diana::QComplex &z)
Diana::QComplex pow(const Diana::QComplex &z, double a)
Raise a complex number to a real power.
Diana::QComplex operator/(double t, const Diana::QComplex &z)
QObjectImp(Diana::QComplex)
double Im(const Diana::QComplex &z)
Function to get the imag part.
double Re(const Diana::QComplex &z)
Function to get the real part.
Q_END_NAMESPACE Diana::QComplex operator*(double t, const Diana::QComplex &z)
#define Q_BEGIN_NAMESPACE
Diana::QVector sin(const Diana::QVector &v)
Diana::QVector cos(const Diana::QVector &v)
QComplex operator+(const QComplex &other) const
QComplex & operator*=(const QComplex &other)
void SetIm(const double Im)
QComplex & operator+=(const QComplex &other)
QComplex & operator-=(const QComplex &other)
gsl_complex Get_gsl_complex() const
void SetRe(const double Re)
QComplex()
default constructor
QComplex operator-(const QComplex &other) const
double GetModulusSquare() const
void Set(const double Re, const double Im)
const QComplex & operator=(const QComplex &other)
QComplex operator/(const QComplex &other) const
QComplex & operator/=(const QComplex &other)
double GetMagnitude() const
QComplex operator*(const QComplex &other) const
void SetPolar(const double mag, const double phase)
Interface for complex vectors in Diana analysis.