Yate

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | List of all members
Complex Class Reference

A Complex (float) number. More...

`#include <yatemath.h>`

## Public Member Functions
| Complex ()
| Complex (float real, float imag=0)
| Complex (const Complex &c)
float | re () const
void | re (float r)
float | im () const
void | im (float i)
Complex & | set (float r=0, float i=0)
bool | operator== (const Complex &c) const
bool | operator!= (const Complex &c) const
Complex & | operator= (const Complex &c)
Complex & | operator= (float real)
Complex & | operator+= (const Complex &c)
Complex & | operator+= (float real)
Complex & | operator-= (const Complex &c)
Complex & | operator-= (float real)
Complex & | operator*= (const Complex &c)
Complex & | operator*= (float f)
Complex & | operator/= (const Complex &c)
Complex & | operator/= (float f)
float | abs () const
float | mod () const
float | arg () const
Complex | exp () const
float | norm () const
float | norm2 () const

## Detailed Description

A Complex (float) number.

This class implements a complex number

## Constructor & Destructor Documentation

Complex | ( |  | ) |
| inline

Constructor

Referenced by Complex::exp().

Complex | ( | float | real,
|  | float | imag = `0`
| ) |  |
| inline

Constructor

Parameters

  real | The real part of the complex number
  imag | The imaginary part of a complex number

Complex | ( | const Complex & | c | ) |
| inline

Copy constructor

Parameters

  c | The source complex number

## Member Function Documentation

float abs | ( |  | ) | const
| inline

Compute the absolute value of this complex number

Returns
  The result

References Complex::norm2().

Referenced by Complex::mod(), and Complex::norm().

float arg | ( |  | ) | const
| inline

Compute the the argument of this complex number

Returns
  Ther result

Complex exp | ( |  | ) | const
| inline

Computes the exponential of this complex number

Returns
  The result

References Complex::Complex().

float im | ( |  | ) | const
| inline

Obtain the imaginary part of a complex number

Returns
  The imaginary part

void im | ( | float | i | ) |
| inline

Set the imaginary part of the complex number

Parameters

  i | The new imaginary part value

float mod | ( |  | ) | const
| inline

Compute the modulus value of this complex number

Returns
  The result

References Complex::abs().

float norm | ( |  | ) | const
| inline

Compute the norm of this complex number

Returns
  The result

References Complex::abs().

float norm2 | ( |  | ) | const
| inline

Compute the norm2 value of this complex number

Returns
  The result

Referenced by Complex::abs(), and Complex::operator/=().

bool operator!= | ( | const Complex & | c | ) | const
| inline

Inequality operator

Parameters

  c | Complex number to compare with

Returns
  True if not equal, false otherwise

Complex& operator*= | ( | const Complex & | c | ) |
| inline

Multiplication operator

Parameters

  c | Complex number to multiply with

Returns
  A reference to this object

References Complex::set().

Complex& operator*= | ( | float | f | ) |
| inline

Multiplication operator. Multiply this number with a float number

Parameters

  f | Value to multiply with

Returns
  A reference to this object

References Complex::set().

Complex& operator+= | ( | const Complex & | c | ) |
| inline

Addition operator

Parameters

  c | Complex number to add

Returns
  A reference to this object

References Complex::set().

Complex& operator+= | ( | float | real | ) |
| inline

Addition operator. Add a value to the real part

Parameters

  real | Value to add to real part

Returns
  A reference to this object

Complex& operator-= | ( | const Complex & | c | ) |
| inline

Substraction operator

Parameters

  c | Complex number to substract from this one

Returns
  A reference to this object

References Complex::set().

Complex& operator-= | ( | float | real | ) |
| inline

Substraction operator. Substract a value a value from the real part

Parameters

  real | Value to substract from real part

Returns
  A reference to this object

Complex& operator/= | ( | const Complex & | c | ) |
| inline

Division operator

Parameters

  c | Complex number to devide with

Returns
  A reference to this object

References Complex::norm2(), and Complex::set().

Complex& operator/= | ( | float | f | ) |
| inline

Division operator

Parameters

  f | Float number to devide with

Returns
  A reference to this object

References Complex::set().

Complex& operator= | ( | const Complex & | c | ) |
| inline

Assignment operator

Parameters

  c | Complex number to assign

Returns
  A reference to this object

References Complex::set().

Complex& operator= | ( | float | real | ) |
| inline

Assignment operator. Set the real part, reset the imaginary one

Parameters

  real | New real part value

Returns
  A reference to this object

References Complex::set().

bool operator== | ( | const Complex & | c | ) | const
| inline

Equality operator

Parameters

  c | Complex number to compare with

Returns
  True if equal, false otherwise

float re | ( |  | ) | const
| inline

Obtain the real part of the complex number

Returns
  The real part

void re | ( | float | r | ) |
| inline

Set the real part of the complex number

Parameters

  r | The new real part value

Complex& set | ( | float | r = `0`,
|  | float | i = `0`
| ) |  |
| inline

Set data

Parameters

  r | The real part of the complex number
  i | The imaginary part of a complex number

Returns
  A reference to this object

Referenced by Complex::operator*=(), Complex::operator+=(), Complex::operator-=(), Complex::operator/=(), and Complex::operator=().

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

- yatemath.h