ComplexLess< T > Class Template Reference

Public Member Functions

bool operator() (const complex< T > &x, const complex< T > &y) const
 Comparison in terms of magnitude of complex number. More...
 
bool operator() (const complex< T > &x, const complex< T > &y) const
 Comparison. Are the values identical or not? More...
 
bool operator() (const complex< T > &x, const complex< T > &y) const
 Comparison. Are the values identical or not? More...
 

Detailed Description

template<class T>
class ComplexLess< T >

Function-type-object to perform comparison of complex data types Needed to sort the complex eigenvalues into order based on the size of the real part.

Member Function Documentation

◆ operator()() [1/3]

template<class T >
bool ComplexLess< T >::operator() ( const complex< T > &  x,
const complex< T > &  y 
) const
inline

Comparison in terms of magnitude of complex number.

62  {
63  //Return the order in terms of magnitude if they are not equal
64  //Include a tolerance to avoid processor specific ordering
65  if(std::abs(std::abs(x) - std::abs(y)) > 1.0e-10 )
66  {return std::abs(x) < std::abs(y);}
67  //Otherwise sort on real part, again with a tolerance
68  else if(std::abs(x.real() - y.real()) > 1.0e-10)
69  {return x.real() < y.real();}
70  //Otherwise sort on imaginary part
71  else
72  {return x.imag() < y.imag();}
73  }
AnnoyingScalar abs(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:135
Scalar * y
Definition: level1_cplx_impl.h:128
list x
Definition: plotDoE.py:28

References abs(), plotDoE::x, and y.

◆ operator()() [2/3]

template<class T >
bool ComplexLess< T >::operator() ( const complex< T > &  x,
const complex< T > &  y 
) const
inline

Comparison. Are the values identical or not?

52  {
53  return x.real() < y.real();
54  }

References plotDoE::x, and y.

◆ operator()() [3/3]

template<class T >
bool ComplexLess< T >::operator() ( const complex< T > &  x,
const complex< T > &  y 
) const
inline

Comparison. Are the values identical or not?

51  {
52  return x.real() < y.real();
53  }

References plotDoE::x, and y.


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