PARP Research Group Universidad de Murcia


QVComplex Class Reference
[Math functionality]

Implementation of complex numbers. More...

#include <QVComplex>

List of all members.

Public Member Functions

 QVComplex ()
 Default constructor.
 QVComplex (const QVComplex &complex)
 Copy constructor.
 QVComplex (const double real, const double imaginary=0.0)
 Common constructor.
 QVComplex (const QPointF &point)
 Constructor from a QPointF.
QVComplexoperator= (const QVComplex &complex)
 Copy operator.
bool operator== (const QVComplex &complex) const
 Complex-complex equality operator.
QVComplexoperator+= (const QVComplex &complex)
 Complex-complex incremental operator.
bool operator!= (const QVComplex &complex) const
 Complex-complex unequality operator.
QVComplex operator* (const QVComplex &complex) const
 Complex-complex product operator.
QVComplex operator/ (const QVComplex &complex) const
 Complex-complex division.
QVComplex operator+ (const QVComplex &complex) const
 Complex-complex addition operator.
QVComplex operator- (const QVComplex &complex) const
 Complex-complex substraction operator.
QVComplex operator- () const
 Obtains the additive inverse of the complex.
QVComplex operator* (const double value) const
 Complex-scalar product.
QVComplex operator/ (const double value) const
 Complex-scalar division operator.
QVComplex operator+ (const double value) const
 Complex-scalar addition.
QVComplex operator- (const double value) const
 Complex-scalar substraction operator.
double norm2 () const
 Gets the norm2 for complex.
double real () const
 Get real component of complex value.
double imaginary () const
 Get imaginary component of complex value.
double & real ()
 Get reference to the real component of complex value.
double & imaginary ()
 Get reference to the imaginary component of complex value.

Static Public Member Functions

static QVComplex i ()
 Creates the unit imaginary value.

Detailed Description

Implementation of complex numbers.

Definition at line 37 of file qvcomplex.h.


Constructor & Destructor Documentation

QVComplex::QVComplex (  ) 

Default constructor.

Constructs a complex number object equal to zero.

Definition at line 31 of file qvcomplex.cpp.

Referenced by i(), operator*(), operator+(), operator-(), and operator/().

QVComplex::QVComplex ( const QVComplex complex  ) 

Copy constructor.

Creates a complex object copying the content from a given one.

Parameters:
complex complex to be copied.

Definition at line 32 of file qvcomplex.cpp.

QVComplex::QVComplex ( const double  real,
const double  imaginary = 0.0 
)

Common constructor.

Creates a new complex number object, specifying the real and imaginary parts.

Parameters:
real Real part of the complex number.
imaginary Imaginary part of the complex number.

Definition at line 33 of file qvcomplex.cpp.

QVComplex::QVComplex ( const QPointF &  point  ) 

Constructor from a QPointF.

Creates a new complex number object, obtaining its components from a point object. The real part of the complex number will be obtained from the x component of the point, and the imaginary part from the y component.

Parameters:
point Point containing the components of the new complex number.

Definition at line 34 of file qvcomplex.cpp.


Member Function Documentation

QVComplex & QVComplex::operator= ( const QVComplex complex  ) 

Copy operator.

Parameters:
complex complex to be copied.

Definition at line 36 of file qvcomplex.cpp.

bool QVComplex::operator== ( const QVComplex complex  )  const

Complex-complex equality operator.

Parameters:
complex term for the compare operation.
Returns:
true if the given complex has same dimensions and equal content of the data buffer, else false.

Definition at line 43 of file qvcomplex.cpp.

QVComplex & QVComplex::operator+= ( const QVComplex complex  ) 

Complex-complex incremental operator.

Parameters:
complex addendum to the actual complex
Returns:
true if the given complex has same dimensions and equal content of the data buffer, else false.

Definition at line 44 of file qvcomplex.cpp.

bool QVComplex::operator!= ( const QVComplex complex  )  const

Complex-complex unequality operator.

Parameters:
complex term for the compare operation.
Returns:
false if the given complex has same dimensions and equal content of the data buffer, else true.

Definition at line 45 of file qvcomplex.cpp.

QVComplex QVComplex::operator* ( const QVComplex complex  )  const

Complex-complex product operator.

Parameters:
complex factor for the product operation.

Definition at line 47 of file qvcomplex.cpp.

QVComplex QVComplex::operator/ ( const QVComplex complex  )  const

Complex-complex division.

Parameters:
complex factor for the operation.

Definition at line 58 of file qvcomplex.cpp.

QVComplex QVComplex::operator+ ( const QVComplex complex  )  const

Complex-complex addition operator.

Parameters:
complex term for the operation.

Definition at line 70 of file qvcomplex.cpp.

QVComplex QVComplex::operator- ( const QVComplex complex  )  const

Complex-complex substraction operator.

Parameters:
complex subtrahend for the operation.

Definition at line 71 of file qvcomplex.cpp.

QVComplex QVComplex::operator- (  )  const

Obtains the additive inverse of the complex.

Obtains a complex changing the sign of its elements.

Definition at line 72 of file qvcomplex.cpp.

QVComplex QVComplex::operator* ( const double  value  )  const

Complex-scalar product.

Parameters:
value factor for the operation.

Definition at line 73 of file qvcomplex.cpp.

QVComplex QVComplex::operator/ ( const double  value  )  const

Complex-scalar division operator.

Parameters:
value divider for the operation.

Definition at line 74 of file qvcomplex.cpp.

QVComplex QVComplex::operator+ ( const double  value  )  const

Complex-scalar addition.

Parameters:
value addendum for the operation.

Definition at line 75 of file qvcomplex.cpp.

QVComplex QVComplex::operator- ( const double  value  )  const

Complex-scalar substraction operator.

Parameters:
value value to substract.

Definition at line 76 of file qvcomplex.cpp.

double QVComplex::norm2 (  )  const

Gets the norm2 for complex.

Returns:
norm-2 of the complex.

Definition at line 77 of file qvcomplex.cpp.

double QVComplex::real (  )  const [inline]

Get real component of complex value.

Definition at line 155 of file qvcomplex.h.

Referenced by operator<<().

double QVComplex::imaginary (  )  const [inline]

Get imaginary component of complex value.

Definition at line 158 of file qvcomplex.h.

Referenced by operator<<().

double& QVComplex::real (  )  [inline]

Get reference to the real component of complex value.

Definition at line 161 of file qvcomplex.h.

double& QVComplex::imaginary (  )  [inline]

Get reference to the imaginary component of complex value.

Definition at line 164 of file qvcomplex.h.

QVComplex QVComplex::i (  )  [static]

Creates the unit imaginary value.

Returns:
complex number containing a unit value for the imaginary coordinate, and zero value for the real coordinate.

Definition at line 78 of file qvcomplex.cpp.


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



QVision framework. PARP research group. Copyright © 2007, 2008, 2009, 2010, 2011.