Allolib  1.0
C++ Components For Interactive Multimedia
al::Complex< T > Class Template Reference

#include <C:/Users/Andres/source/repos/casm_viewer/external/tinc/external/allolib/include/al/math/al_Complex.hpp>

Public Types

typedef Complex< T > C
 

Public Member Functions

 Complex (const Complex &v)
 
 Complex (const Polar< T > &v)
 
 Complex (const T &r=T(0), const T &i=T(0))
 
 Complex (const T &m, const T &p, int fromPolar)
 
Carg (T v)
 Set argument leaving norm the same.
 
Cnorm (T v)
 Set norm leaving argument the same.
 
CfromPolar (T phase)
 Set phase and normalize.
 
CfromPolar (T m, T p)
 Set magnitude and phase.
 
Cset (T vr, T vi)
 Set real and imaginary components.
 
Cset (const Polar< T > &p)
 
T & operator[] (int i)
 
const T & operator[] (int i) const
 
T & real ()
 
const T & real () const
 
T & imag ()
 
const T & imag () const
 
bool operator== (const C &v) const
 Returns true if all components are equal.
 
bool operator== (const T &v) const
 Returns true if real and equals value.
 
bool operator!= (const C &v) const
 Returns true if any components are not equal.
 
bool operator> (const C &v) const
 Returns true if norm is greater than argument's norm.
 
bool operator< (const C &c) const
 Returns true if norm is less than argument's norm.
 
Coperator= (const Polar< T > &v)
 
Coperator= (const C &v)
 
Coperator= (T v)
 
Coperator-= (const C &v)
 
Coperator-= (T v)
 
Coperator+= (const C &v)
 
Coperator+= (T v)
 
Coperator*= (const C &v)
 
Coperator*= (T v)
 
Coperator/= (const C &v)
 
Coperator/= (T v)
 
C operator- () const
 
C operator- (const C &v) const
 
C operator- (T v) const
 
C operator+ (const C &v) const
 
C operator+ (T v) const
 
C operator* (const C &v) const
 
C operator* (T v) const
 
C operator/ (const C &v) const
 
C operator/ (T v) const
 
arg () const
 Returns argument in [-pi, pi].
 
argUnit () const
 Return argument in unit interval [0, 1)
 
C conj () const
 Returns conjugate, z*.
 
dot (const C &v) const
 Returns vector dot product.
 
C exp () const
 Returns e^z.
 
C log () const
 Returns log(z)
 
norm () const
 Returns norm (radius), |z|.
 
normSqr () const
 Returns square of norm, |z|^2.
 
Cnormalize (T m=T(1))
 Sets magnitude to 1, |z|=1.
 
C pow (const C &v) const
 Returns z^v.
 
C pow (T v) const
 Returns z^v.
 
C recip () const
 Return multiplicative inverse, 1/z.
 
C sgn (T m=T(1)) const
 Returns signum, z/|z|, the closest point on unit circle.
 
C sqr () const
 Returns square.
 
C sqrt () const
 Returns square root.
 
C cos () const
 Returns cos(z)
 
C sin () const
 Returns sin(z)
 
C cosh () const
 Returns cosh(z)
 
C sinh () const
 Returns sinh(z)
 
abs () const
 Returns norm (radius), |z|.
 
mag () const
 Returns norm (radius), |z|.
 
magSqr () const
 Returns square of norm, |z|^2.
 
phase () const
 Returns argument (angle)
 

Public Attributes

union {
   struct {
      T   r
 Real component.
 
      T   i
 Imaginary component.
 
   } 
 
   T   elems [2]
 
}; 
 

Detailed Description

template<class T>
class al::Complex< T >

Complex number

Definition at line 95 of file al_Complex.hpp.


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