Version 1.2 (June 2013)
 All Classes Namespaces Files Functions Variables Pages
Public Member Functions | List of all members
utils.Complex Class Reference

Class for storing complex numbers as two doubles representing real and imaginary part, respectively. More...

Public Member Functions

 Complex ()
 Default constructor. Sets number to 0 + 0i. More...
 
 Complex (double realPart, double imaginaryPart)
 Specific constructor, setting number to given real and imaginary part. More...
 
void add (Complex c)
 Utility to add a complex number c to this complex number. More...
 
void sub (Complex c)
 Utility to subtract a complex number c from this complex number. More...
 
void mul (Complex c)
 Utility to multiply a complex number c to this complex number. More...
 
void div (Complex c)
 Utility to divide a complex number by complex number c. More...
 
void add (double z)
 Utility to add a double to this complex number. More...
 
void sub (double z)
 Utility to subtract a double from this complex number. More...
 
void mul (double z)
 Utility to multiply this complex number by a double. More...
 
void div (double z)
 Utility to divide this complex number by a double. More...
 
void setReal (double realPart)
 Sets the real part of this number. More...
 
void setImag (double imaginaryPart)
 Sets the imaginary part of this number. More...
 
double getReal ()
 Returns the real part of this number. More...
 
double getImag ()
 Returns the imaginary part of this number. More...
 

Detailed Description

Class for storing complex numbers as two doubles representing real and imaginary part, respectively.

Class for storing complex numbers as two doubles representing real and imaginary part, respectively. Includes basic math operations (addition, subtraction, multiplication, division)

Author
Andreas Dotsch (andre.nosp@m.as.d.nosp@m.oetsc.nosp@m.h@he.nosp@m.lmhol.nosp@m.tz-h.nosp@m.zi.de), Helmholtz Centre for Infection Research (Germany)

Constructor & Destructor Documentation

utils.Complex.Complex ( )

Default constructor. Sets number to 0 + 0i.

Default constructor. Sets number to 0 + 0i

utils.Complex.Complex ( double  realPart,
double  imaginaryPart 
)

Specific constructor, setting number to given real and imaginary part.

Specific constructor, setting number to given real and imaginary part

Parameters
realPartNumber to be assigned to the 'Real' part of this complex number
imaginaryPartNumber to be assigned to the 'Imaginary' part of this complex number

Member Function Documentation

void utils.Complex.add ( Complex  c)

Utility to add a complex number c to this complex number.

Utility to add a complex number c to this complex number

Parameters
cComplex number being added to this complex number
void utils.Complex.add ( double  z)

Utility to add a double to this complex number.

Utility to add a double to this complex number

Parameters
zDouble being added to this number
void utils.Complex.div ( Complex  c)

Utility to divide a complex number by complex number c.

Utility to divide a complex number by this complex number c

Parameters
cComplex number by which this object is being divided
void utils.Complex.div ( double  z)

Utility to divide this complex number by a double.

Utility to divide this complex number by a double

Parameters
zDouble being divided into this complex number
double utils.Complex.getImag ( )

Returns the imaginary part of this number.

Returns the imaginary part of this number

Returns
Double value stating the value of the imaginary part of this complex number
double utils.Complex.getReal ( )

Returns the real part of this number.

Returns the real part of this number

Returns
Double value stating the value of the real part of this complex number
void utils.Complex.mul ( Complex  c)

Utility to multiply a complex number c to this complex number.

Utility to multiply a complex number c to this complex number

Parameters
cComplex number being multiplied to this complex number
void utils.Complex.mul ( double  z)

Utility to multiply this complex number by a double.

Utility to multiply this complex number by a double

Parameters
zDouble being multiplied to this complex number
void utils.Complex.setImag ( double  imaginaryPart)

Sets the imaginary part of this number.

Sets the imaginary part of this number

Parameters
imaginaryPartDouble value to set the imaginary part of this number too
void utils.Complex.setReal ( double  realPart)

Sets the real part of this number.

Sets the real part of this number

Parameters
realPartDouble value to set the real part of this number too
void utils.Complex.sub ( Complex  c)

Utility to subtract a complex number c from this complex number.

Utility to subtract a complex number c from this complex number

Parameters
cComplex number being subtracted from this complex number
void utils.Complex.sub ( double  z)

Utility to subtract a double from this complex number.

Utility to subtract a double from this complex number

Parameters
zDouble being subtracted from this number

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