ALPSCore reference
Public Member Functions | Static Public Member Functions | Friends | List of all members
alps::alea::complex_op< T > Class Template Reference

#include <complex_op.hpp>

Collaboration diagram for alps::alea::complex_op< T >:
Collaboration graph

Public Member Functions

 complex_op ()
 
 complex_op (double x)
 
 complex_op (T rere, T reim, T imre, T imim)
 
T & rere ()
 
T & reim ()
 
T & imre ()
 
T & imim ()
 
const T & rere () const
 
const T & reim () const
 
const T & imre () const
 
const T & imim () const
 
complex_opoperator+= (complex_op x)
 
complex_opoperator-= (complex_op x)
 
complex_opoperator*= (double x)
 
complex_opoperator/= (double x)
 

Static Public Member Functions

static complex_op outer (std::complex< T > a, std::complex< T > b)
 
static complex_op diag (std::complex< T > a)
 
static complex_op diag (T a)
 

Friends

complex_op operator- (complex_op x)
 
complex_op operator+ (complex_op l, complex_op r)
 
complex_op operator- (complex_op l, complex_op r)
 
complex_op operator* (complex_op x, double f)
 
complex_op operator* (double f, complex_op x)
 
complex_op operator/ (complex_op x, double f)
 
complex_op dot (complex_op l, complex_op r)
 
complex_op solve (complex_op l, complex_op r)
 
bool operator== (complex_op l, complex_op r)
 
bool operator!= (complex_op l, complex_op r)
 
complex_op inv (complex_op x)
 
complex_op abs2 (complex_op x)
 
complex_op sqrt (complex_op x)
 
bool isnan (complex_op x)
 
bool isfinite (complex_op x)
 
bool isinf (complex_op x)
 
complex_op abs (complex_op x)
 
std::ostream & operator<< (std::ostream &out, complex_op x)
 

Detailed Description

template<typename T>
class alps::alea::complex_op< T >

General linear operation on a complex number.

If one interprets a complex number x as column vector given by { x.real(), x.imag() }, the effect of an complex_op A is equivalent to the left multiplication with the 2x2 matrix:

{{ A.rere(), A.reim() },
 { A.imre(), A.imim() }}

(The elements are laid out in that way as well.) If one identifies the imaginary part of the result with the prefactor of 'j', then complex_op is equivalent to a quarternion a + b*i + c*j + d*k.

Note that dot(a, b) must be used to multiply two complex_op instances and solve(a, b) for division because multiplication is not commutative.

Definition at line 20 of file complex_op.hpp.

Constructor & Destructor Documentation

template<typename T>
alps::alea::complex_op< T >::complex_op ( )
inline

Default constructed (uninitialized)

Definition at line 70 of file complex_op.hpp.

template<typename T>
alps::alea::complex_op< T >::complex_op ( double  x)
inline

Scaling transformation

Definition at line 73 of file complex_op.hpp.

template<typename T>
alps::alea::complex_op< T >::complex_op ( rere,
reim,
imre,
imim 
)
inline

Construct new operation

Definition at line 76 of file complex_op.hpp.

Member Function Documentation

template<typename T>
static complex_op alps::alea::complex_op< T >::diag ( std::complex< T >  a)
inlinestatic

Definition at line 61 of file complex_op.hpp.

template<typename T>
static complex_op alps::alea::complex_op< T >::diag ( a)
inlinestatic

Definition at line 66 of file complex_op.hpp.

template<typename T>
T& alps::alea::complex_op< T >::imim ( )
inline

Definition at line 87 of file complex_op.hpp.

template<typename T>
const T& alps::alea::complex_op< T >::imim ( ) const
inline

Definition at line 92 of file complex_op.hpp.

template<typename T>
T& alps::alea::complex_op< T >::imre ( )
inline

Definition at line 86 of file complex_op.hpp.

template<typename T>
const T& alps::alea::complex_op< T >::imre ( ) const
inline

Definition at line 91 of file complex_op.hpp.

template<typename T>
complex_op& alps::alea::complex_op< T >::operator*= ( double  x)
inline

Definition at line 108 of file complex_op.hpp.

template<typename T>
complex_op& alps::alea::complex_op< T >::operator+= ( complex_op< T >  x)
inline

Definition at line 94 of file complex_op.hpp.

template<typename T>
complex_op& alps::alea::complex_op< T >::operator-= ( complex_op< T >  x)
inline

Definition at line 101 of file complex_op.hpp.

template<typename T>
complex_op& alps::alea::complex_op< T >::operator/= ( double  x)
inline

Definition at line 117 of file complex_op.hpp.

template<typename T>
static complex_op alps::alea::complex_op< T >::outer ( std::complex< T >  a,
std::complex< T >  b 
)
inlinestatic

Definition at line 55 of file complex_op.hpp.

template<typename T>
T& alps::alea::complex_op< T >::reim ( )
inline

Definition at line 85 of file complex_op.hpp.

template<typename T>
const T& alps::alea::complex_op< T >::reim ( ) const
inline

Definition at line 90 of file complex_op.hpp.

template<typename T>
T& alps::alea::complex_op< T >::rere ( )
inline

Definition at line 84 of file complex_op.hpp.

template<typename T>
const T& alps::alea::complex_op< T >::rere ( ) const
inline

Definition at line 89 of file complex_op.hpp.

Friends And Related Function Documentation

template<typename T>
complex_op abs ( complex_op< T >  x)
friend

Definition at line 224 of file complex_op.hpp.

template<typename T>
complex_op abs2 ( complex_op< T >  x)
friend

Definition at line 178 of file complex_op.hpp.

template<typename T>
complex_op dot ( complex_op< T >  l,
complex_op< T >  r 
)
friend

Definition at line 146 of file complex_op.hpp.

template<typename T>
complex_op inv ( complex_op< T >  x)
friend

Definition at line 170 of file complex_op.hpp.

template<typename T>
bool isfinite ( complex_op< T >  x)
friend

Definition at line 209 of file complex_op.hpp.

template<typename T>
bool isinf ( complex_op< T >  x)
friend

Definition at line 214 of file complex_op.hpp.

template<typename T>
bool isnan ( complex_op< T >  x)
friend

Definition at line 204 of file complex_op.hpp.

template<typename T>
bool operator!= ( complex_op< T >  l,
complex_op< T >  r 
)
friend

Definition at line 165 of file complex_op.hpp.

template<typename T>
complex_op operator* ( complex_op< T >  x,
double  f 
)
friend

Definition at line 134 of file complex_op.hpp.

template<typename T>
complex_op operator* ( double  f,
complex_op< T >  x 
)
friend

Definition at line 139 of file complex_op.hpp.

template<typename T>
complex_op operator+ ( complex_op< T >  l,
complex_op< T >  r 
)
friend

Definition at line 124 of file complex_op.hpp.

template<typename T>
complex_op operator- ( complex_op< T >  x)
friend

Definition at line 119 of file complex_op.hpp.

template<typename T>
complex_op operator- ( complex_op< T >  l,
complex_op< T >  r 
)
friend

Definition at line 129 of file complex_op.hpp.

template<typename T>
complex_op operator/ ( complex_op< T >  x,
double  f 
)
friend

Definition at line 141 of file complex_op.hpp.

template<typename T>
std::ostream& operator<< ( std::ostream &  out,
complex_op< T >  x 
)
friend

Definition at line 226 of file complex_op.hpp.

template<typename T>
bool operator== ( complex_op< T >  l,
complex_op< T >  r 
)
friend

Definition at line 160 of file complex_op.hpp.

template<typename T>
complex_op solve ( complex_op< T >  l,
complex_op< T >  r 
)
friend

Definition at line 155 of file complex_op.hpp.

template<typename T>
complex_op sqrt ( complex_op< T >  x)
friend

Definition at line 187 of file complex_op.hpp.


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