ParGeMSLR
Public Member Functions | List of all members
pargemslr::ComplexValueClass< T > Class Template Reference

The template class complex. More...

#include <complex.hpp>

Public Member Functions

 ComplexValueClass ()
 The constructor of complex value class. More...
 
 ComplexValueClass (T real)
 The constructor of complex value class. More...
 
 ComplexValueClass (T real, T imag)
 The constructor of complex value class. More...
 
T & Real ()
 Get the real part. More...
 
const T & Real () const
 Get the real part. More...
 
T & Imag ()
 Get the imag part. More...
 
const T & Imag () const
 Get the imag part. More...
 
Norm () const
 Get the square of 2-norm. Note that std::complex use the this value as norm. More...
 
Norm2 () const
 Get the 2-norm. Note that std::complex use the square of this value as norm. More...
 
Abs () const
 Get the 2-norm as absolute value. More...
 
ComplexValueClass< T > Conj () const
 Get the conjugate. More...
 
ComplexValueClass< T > & operator= (const T &real)
 Conver to real value, only keep the real part. More...
 
ComplexValueClass< T > & operator+= (const T &real)
 += operator with real value. More...
 
ComplexValueClass< T > & operator-= (const T &real)
 -= operator with real value. More...
 
ComplexValueClass< T > & operator*= (const T &real)
 *= operator with real value. More...
 
ComplexValueClass< T > & operator/= (const T &real)
 /= operator with real value. More...
 
ComplexValueClass< T > & operator= (const ComplexValueClass< T > &val)
 = operator with real value. More...
 
ComplexValueClass< T > & operator+= (const ComplexValueClass< T > &val)
 += operator with real value. More...
 
ComplexValueClass< T > & operator-= (const ComplexValueClass< T > &val)
 -= operator with real value. More...
 
ComplexValueClass< T > & operator*= (const ComplexValueClass< T > &val)
 *= operator with real value. More...
 
ComplexValueClass< T > & operator/= (const ComplexValueClass< T > &val)
 /= operator with real value. More...
 

Detailed Description

template<typename T>
class pargemslr::ComplexValueClass< T >

The template class complex.

Constructor & Destructor Documentation

◆ ComplexValueClass() [1/3]

template<typename T >
pargemslr::ComplexValueClass< T >::ComplexValueClass ( )
inline

The constructor of complex value class.

◆ ComplexValueClass() [2/3]

template<typename T >
pargemslr::ComplexValueClass< T >::ComplexValueClass ( real)
inline

The constructor of complex value class.

Parameters
[in]realThe real part, imag part is 0.0.

◆ ComplexValueClass() [3/3]

template<typename T >
pargemslr::ComplexValueClass< T >::ComplexValueClass ( real,
imag 
)
inline

The constructor of complex value class.

Parameters
[in]realThe real part.
[in]imagThe imag part.

Member Function Documentation

◆ Abs()

template<typename T >
T pargemslr::ComplexValueClass< T >::Abs ( ) const
inline

Get the 2-norm as absolute value.

Returns
Return the sqrt of norm as absolute value.

◆ Conj()

template<typename T >
ComplexValueClass<T> pargemslr::ComplexValueClass< T >::Conj ( ) const
inline

Get the conjugate.

Returns
Return the conjugate.

◆ Imag() [1/2]

template<typename T >
T& pargemslr::ComplexValueClass< T >::Imag ( )
inline

Get the imag part.

Returns
Return the imag part.

◆ Imag() [2/2]

template<typename T >
const T& pargemslr::ComplexValueClass< T >::Imag ( ) const
inline

Get the imag part.

Returns
Return the imag part.

◆ Norm()

template<typename T >
T pargemslr::ComplexValueClass< T >::Norm ( ) const
inline

Get the square of 2-norm. Note that std::complex use the this value as norm.

Returns
Return the norm.

◆ Norm2()

template<typename T >
T pargemslr::ComplexValueClass< T >::Norm2 ( ) const
inline

Get the 2-norm. Note that std::complex use the square of this value as norm.

Returns
Return the norm.

◆ operator*=() [1/2]

template<typename T >
ComplexValueClass<T>& pargemslr::ComplexValueClass< T >::operator*= ( const ComplexValueClass< T > &  val)
inline

*= operator with real value.

Parameters
[in]valThe other value.
Returns
Return the result.

◆ operator*=() [2/2]

template<typename T >
ComplexValueClass<T>& pargemslr::ComplexValueClass< T >::operator*= ( const T &  real)
inline

*= operator with real value.

Parameters
[in]realThe real value.
Returns
Return the result.

◆ operator+=() [1/2]

template<typename T >
ComplexValueClass<T>& pargemslr::ComplexValueClass< T >::operator+= ( const ComplexValueClass< T > &  val)
inline

+= operator with real value.

Parameters
[in]valThe other value.
Returns
Return the result.

◆ operator+=() [2/2]

template<typename T >
ComplexValueClass<T>& pargemslr::ComplexValueClass< T >::operator+= ( const T &  real)
inline

+= operator with real value.

Parameters
[in]realThe real value.
Returns
Return the result.

◆ operator-=() [1/2]

template<typename T >
ComplexValueClass<T>& pargemslr::ComplexValueClass< T >::operator-= ( const ComplexValueClass< T > &  val)
inline

-= operator with real value.

Parameters
[in]valThe other value.
Returns
Return the result.

◆ operator-=() [2/2]

template<typename T >
ComplexValueClass<T>& pargemslr::ComplexValueClass< T >::operator-= ( const T &  real)
inline

-= operator with real value.

Parameters
[in]realThe real value.
Returns
Return the result.

◆ operator/=() [1/2]

template<typename T >
ComplexValueClass<T>& pargemslr::ComplexValueClass< T >::operator/= ( const ComplexValueClass< T > &  val)
inline

/= operator with real value.

Parameters
[in]valThe other value.
Returns
Return the result.

◆ operator/=() [2/2]

template<typename T >
ComplexValueClass<T>& pargemslr::ComplexValueClass< T >::operator/= ( const T &  real)
inline

/= operator with real value.

Parameters
[in]realThe real value.
Returns
Return the result.

◆ operator=() [1/2]

template<typename T >
ComplexValueClass<T>& pargemslr::ComplexValueClass< T >::operator= ( const ComplexValueClass< T > &  val)
inline

= operator with real value.

Parameters
[in]valThe other value.
Returns
Return the result.

◆ operator=() [2/2]

template<typename T >
ComplexValueClass<T>& pargemslr::ComplexValueClass< T >::operator= ( const T &  real)
inline

Conver to real value, only keep the real part.

Note
This function is used to overcome some compiling issues, should not be called directly.
Some operations, for example, complexs(1.0,-1.0) == 1.0, will call this function.
Returns
Return the real part.

= operator with real value.

= operator with real value.

Parameters
[in]realThe real value.
Returns
Return the result.

◆ Real() [1/2]

template<typename T >
T& pargemslr::ComplexValueClass< T >::Real ( )
inline

Get the real part.

Returns
Return the real part.

◆ Real() [2/2]

template<typename T >
const T& pargemslr::ComplexValueClass< T >::Real ( ) const
inline

Get the real part.

Returns
Return the real part.

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