HILA
|
Imaginary type, used to represent purely imaginary numbers. More...
#include <cmplx.h>
Public Member Functions | |
T | real () const |
Real part of Complex number. | |
T | imag () const |
Imaginary part of Complex number. | |
T | squarenorm () const |
Compute square norm of Complex number. | |
T | abs () const |
Compute absolute value of Complex number. | |
T | arg () const |
Compute argument of Complex number. | |
Complex< T > | conj () const |
Compute conjugate of Complex number. | |
Complex< T > | dagger () const |
Compute dagger of Complex number. | |
Complex< T > | polar (const T r, const T theta) |
Stores and returns Complex number given in polar coordinates. | |
Complex< T > & | random () |
Assign random values to Complex real and imaginary part. | |
Complex< T > & | gaussian_random (double width=1.0) |
Produces complex gaussian random values. | |
template<typename A > | |
Complex< T > & | operator+= (const Complex< A > &lhs) & |
+= addition assignment operator | |
template<typename A > | |
Complex< T > & | operator-= (const Complex< A > &lhs) & |
-= subtraction assignment operator | |
template<typename A > | |
Complex< T > & | operator*= (const Complex< A > &lhs) & |
*= multiply assignment operator | |
template<typename A > | |
Complex< T > & | operator/= (const Complex< A > &lhs) & |
/= divide assignment operator | |
Complex< T > & | operator++ () |
++ increment operator | |
Complex< T > & | operator-- () |
– decrement operator | |
template<typename A > | |
Complex< T > | conj_mul (const Complex< A > &b) const |
Conjugate multiply method. | |
template<typename A > | |
Complex< T > | mul_conj (const Complex< A > &b) const |
Multiply conjugate method. | |
Imaginary type, used to represent purely imaginary numbers.
Useful for reducing multiply operations in im * complex or im * real -ops Derived from Complex class, so generic complex ops should remain valid Defines only operators * and /, others go via Complex class
Note: Imaginary_t should NOT be used in Field variables
T | type of imaginary (float/double) |
|
inlineinherited |
|
inlineinherited |
Compute dagger of Complex number.
Alias to Complex::conj
\begin{align} z^* = z^\dagger \end{align}
|
inlineinherited |
Produces complex gaussian random values.
Uses hila::gaussrand2 for both real and imaignary part Assigns same random value for both real and imaginary part
width | gaussian_random |
|
inlineinherited |
|
inlineinherited |
*= multiply assignment operator
Multiply assignment for Complex numbers can be performed in the following ways
Complex multiply assign:
Standard Complex number multiplication
\begin{align}z &= x + iy, w = x' + iy' \\ z w &= (x + iy)(x' + iy') = (xx'-yy') + i(xy' + yx')\end{align}
Real multiply assign:
Multiply assign by real number to both components of Complex number
++ increment operator
Increments real part of Complex number
|
inlineinherited |
+= addition assignment operator
Addition assignment for Complex numbers can be performed in the following ways
Complex addition assignment:
Real addition assignment:
Add assign only to real part of Complex number
– decrement operator
Decrement real part of Complex number
|
inlineinherited |
-= subtraction assignment operator
Subtraction assignment for Complex numbers can be performed in the following ways
Complex subtract assign:
Real subtract assign:
Subtract assign only to real part of Complex number
|
inlineinherited |
/= divide assignment operator
Divide assignment for Complex numbers can be performed in the following ways
Complex divide assign:
Standard Complex number division
\begin{align}z &= x + iy, w = x' + iy' \\ \frac{z}{w} &= \frac{x + iy}{x' + iy'} = \frac{(xx'+ yy') + i( yx' - xy')}{|w|^2}\end{align}
Real divide assign:
Divide assign by real number to both components of Complex number
Stores and returns Complex number given in polar coordinates.
\begin{align} z = r\cdot e^{i\theta} \end{align}
r | Radius of Complex number |
theta | Angle of complex number in radians |
Assign random values to Complex real and imaginary part.
Uses hila::random for both real and imaginary part
|
inlineinherited |
|
inlineinherited |