shared
 All Classes Functions Variables Typedefs Enumerations Enumerator Friends
Public Member Functions | Public Attributes | Friends | List of all members
jcomplex Struct Reference

A representation of complex numbers. More...

#include <Common.hpp>

Public Member Functions

 jcomplex (jdouble re, jdouble im)
 Default constructor. More...
 
 jcomplex ()
 Alternate constructor.
 
jdouble abs ()
 Gets the complex magnitude.
 

Public Attributes

jdouble re
 The real part.
 
jdouble im
 The imaginary part.
 

Friends

jcomplex operator+ (const jcomplex &a, const jcomplex &b)
 Adds two complex numbers. More...
 
jcomplex operator- (const jcomplex &a, const jcomplex &b)
 Subtracts two complex numbers. More...
 
jcomplex operator* (const jcomplex &a, const jcomplex &b)
 Multiplies two complex numbers. More...
 
jcomplex operator/ (const jcomplex &a, const jcomplex &b)
 Divides two complex numbers. More...
 
jcomplexoperator+= (jcomplex &a, const jcomplex &b)
 Adds two complex numbers and mutates the left hand side. More...
 
jcomplexoperator*= (jcomplex &a, const jcomplex &b)
 Multiplies two complex numbers and mutates the left hand side. More...
 
bool operator< (const jcomplex &a, const jcomplex &b)
 Performs a comparison on the basis of magnitudes. More...
 

Detailed Description

A representation of complex numbers.

Constructor & Destructor Documentation

jcomplex::jcomplex ( jdouble  re,
jdouble  im 
)
inline

Default constructor.

Parameters
rethe real part.
imthe imaginary part.

Friends And Related Function Documentation

jcomplex operator* ( const jcomplex a,
const jcomplex b 
)
friend

Multiplies two complex numbers.

Parameters
athe left hand side.
bthe right hand side.
Returns
the operation result.
jcomplex& operator*= ( jcomplex a,
const jcomplex b 
)
friend

Multiplies two complex numbers and mutates the left hand side.

Parameters
athe left hand side.
bthe right hand side.
Returns
the operation result.
jcomplex operator+ ( const jcomplex a,
const jcomplex b 
)
friend

Adds two complex numbers.

Parameters
athe left hand side.
bthe right hand side.
Returns
the operation result.
jcomplex& operator+= ( jcomplex a,
const jcomplex b 
)
friend

Adds two complex numbers and mutates the left hand side.

Parameters
athe left hand side.
bthe right hand side.
Returns
the operation result.
jcomplex operator- ( const jcomplex a,
const jcomplex b 
)
friend

Subtracts two complex numbers.

Parameters
athe left hand side.
bthe right hand side.
Returns
the operation result.
jcomplex operator/ ( const jcomplex a,
const jcomplex b 
)
friend

Divides two complex numbers.

Parameters
athe left hand side.
bthe right hand side.
Returns
the operation result.
bool operator< ( const jcomplex a,
const jcomplex b 
)
friend

Performs a comparison on the basis of magnitudes.

Parameters
athe left hand side.
bthe right hand side.
Returns
the operation result.