Edinburgh Speech Tools  2.1-release
EST_Complex Class Reference

A class for complex numbers. More...

#include <include/EST_Complex.h>

Public Member Functions

double mag () const
 Polar magnitude, read only. More...
 
double ang (int degrees=0) const
 Polar angle, read only. More...
 
double & real ()
 The real part - can be used for reading or writing. More...
 
double & imag ()
 The imaginary part - can be used for reading or writing. More...
 
Constructor functions
 EST_Complex ()
 default constructor, initialises values to 0.0 More...
 
 EST_Complex (double real, double imag)
 Constructor initialising real and imaginary parts. More...
 

Friends

EST_Complex operator+ (const EST_Complex &z1, const EST_Complex &z2)
 
EST_Complex operator+ (const EST_Complex &z, float x)
 
EST_Complex operator+ (float x, const EST_Complex &z)
 
EST_Complex operator- (const EST_Complex &z1, const EST_Complex &z2)
 
EST_Complex operator- (const EST_Complex &z, float x)
 
EST_Complex operator- (float x, const EST_Complex &z)
 
EST_Complex operator* (const EST_Complex &z1, const EST_Complex &z2)
 
EST_Complex operator* (const EST_Complex &z, float x)
 
EST_Complex operator* (float x, const EST_Complex &z)
 
EST_Complex operator/ (const EST_Complex &z1, const EST_Complex &z2)
 
EST_Complex operator/ (const EST_Complex &z, float x)
 
EST_Complex operator/ (float x, const EST_Complex &z)
 
std::ostream & operator<< (std::ostream &s, const EST_Complex &a)
 

Detailed Description

A class for complex numbers.

The class stores the values as cartesian real and imaginary parts, but these can be read as polar coordinates using the EST_Complex::mag() and EST_Complex::ang() methods. Addition, subtraction, multiplication and division are supported.

Definition at line 59 of file EST_Complex.h.

Constructor & Destructor Documentation

EST_Complex::EST_Complex ( )
inline

default constructor, initialises values to 0.0

Definition at line 67 of file EST_Complex.h.

EST_Complex::EST_Complex ( double  real,
double  imag 
)
inline

Constructor initialising real and imaginary parts.

Definition at line 69 of file EST_Complex.h.

Member Function Documentation

double EST_Complex::mag ( ) const
inline

Polar magnitude, read only.

Definition at line 74 of file EST_Complex.h.

double EST_Complex::ang ( int  degrees = 0) const
inline

Polar angle, read only.

Definition at line 78 of file EST_Complex.h.

double& EST_Complex::real ( )
inline

The real part - can be used for reading or writing.

Definition at line 88 of file EST_Complex.h.

double& EST_Complex::imag ( )
inline

The imaginary part - can be used for reading or writing.

Definition at line 90 of file EST_Complex.h.

Friends And Related Function Documentation

EST_Complex operator+ ( const EST_Complex z1,
const EST_Complex z2 
)
friend

Definition at line 44 of file EST_Complex.cc.

EST_Complex operator+ ( const EST_Complex z,
float  x 
)
friend

Definition at line 49 of file EST_Complex.cc.

EST_Complex operator+ ( float  x,
const EST_Complex z 
)
friend

Definition at line 54 of file EST_Complex.cc.

EST_Complex operator- ( const EST_Complex z1,
const EST_Complex z2 
)
friend

Definition at line 61 of file EST_Complex.cc.

EST_Complex operator- ( const EST_Complex z,
float  x 
)
friend

Definition at line 66 of file EST_Complex.cc.

EST_Complex operator- ( float  x,
const EST_Complex z 
)
friend

Definition at line 71 of file EST_Complex.cc.

EST_Complex operator* ( const EST_Complex z1,
const EST_Complex z2 
)
friend

Definition at line 78 of file EST_Complex.cc.

EST_Complex operator* ( const EST_Complex z,
float  x 
)
friend

Definition at line 83 of file EST_Complex.cc.

EST_Complex operator* ( float  x,
const EST_Complex z 
)
friend

Definition at line 88 of file EST_Complex.cc.

EST_Complex operator/ ( const EST_Complex z1,
const EST_Complex z2 
)
friend

Definition at line 95 of file EST_Complex.cc.

EST_Complex operator/ ( const EST_Complex z,
float  x 
)
friend

Definition at line 104 of file EST_Complex.cc.

EST_Complex operator/ ( float  x,
const EST_Complex z 
)
friend

Definition at line 109 of file EST_Complex.cc.

std::ostream& operator<< ( std::ostream &  s,
const EST_Complex a 
)
friend

Definition at line 106 of file EST_Complex.h.


The documentation for this class was generated from the following file: