ccgsl 2.7.2
C++wrappersforGnuScientificLibrary
gsl::complex_long_double Class Reference

This class handles complex_long_double numbers. More...

#include <complex_long_double.hpp>

Inheritance diagram for gsl::complex_long_double:
Inheritance graph
Collaboration diagram for gsl::complex_long_double:
Collaboration graph

Public Member Functions

 complex_long_double ()
 The default constructor is only really useful for assigning to. More...
 
 complex_long_double (long double *dat)
 Allow construction from raw data. More...
 
 complex_long_double (long double const real, long double const imag)
 Allow construction from real and imaginary values. More...
 
 complex_long_double (std::complex< long double > const &z)
 Allow construction from a std::complex<long double>. More...
 
 complex_long_double (gsl_complex_long_double const &z)
 Constructor from base class. More...
 
 operator std::complex< long double > () const
 Convert to std::complex<long double> More...
 
gsl_complex_long_double & get ()
 Get the base class object. More...
 
gsl_complex_long_double const & get () const
 Get the base class object. More...
 
void set_complex_long_double (long double x, long double y)
 C++ version of GSL_SET_COMPLEX(). More...
 
long double real () const
 C++ version of GSL_REAL(). More...
 
long double imag () const
 C++ version of GSL_IMAG(). More...
 
void set_real (long double x)
 C++ version of GSL_SET_REAL(). More...
 
void set_imag (long double y)
 C++ version of GSL_SET_IMAG(). More...
 
bool operator== (complex_long_double const &z) const
 A complex_long_double object must be less than comparable so that it can be used as a container value type. More...
 
bool operator!= (complex_long_double const &z) const
 A complex_long_double object must be less than comparable so that it can be used as a container value type. More...
 
bool operator< (complex_long_double const &z) const
 A complex_long_double object must be less than comparable so that it can be used as a container value type. More...
 
bool operator> (complex_long_double const &z) const
 A complex_long_double object must be less than comparable so that it can be used as a container value type. More...
 
bool operator<= (complex_long_double const &z) const
 A complex_long_double object must be less than comparable so that it can be used as a container value type. More...
 
bool operator>= (complex_long_double const &z) const
 A complex_long_double object must be less than comparable so that it can be used as a container value type. More...
 

Static Public Member Functions

static complex_long_double rect (long double x, long double y)
 C++ version of gsl_complex_long_double_rect(). More...
 
static complex_long_double polar (long double r, long double theta)
 C++ version of gsl_complex_long_double_rect(). More...
 

Friends

class complex_long_double_ptr
 
class complex_long_double_ref
 
class vector_complex_long_double
 
class matrix_complex_long_double
 

Detailed Description

This class handles complex_long_double numbers.

There is an ambiguity in translating gsl_complex_long_double to C++: gsl_complex_long_double is a struct and so should be represented by a C++ class. But gsl_complex_long_double is also used like a namespace and so it would be nice to have a C++ namespace gsl:: complex_long_double. However, we cannot have both. The compromise is to use static complex_long_double class functions. But, since we cannot use

using namespace gsl::complex_long_double
This class handles complex_long_double numbers.

and similar namespace operations with gsl::complex_long_double, we also define a namespace gsl::cpx_long_double with the same functions, again defined inline for efficiency.

Definition at line 42 of file complex_long_double.hpp.

Constructor & Destructor Documentation

◆ complex_long_double() [1/5]

gsl::complex_long_double::complex_long_double ( )
inline

The default constructor is only really useful for assigning to.

Definition at line 52 of file complex_long_double.hpp.

◆ complex_long_double() [2/5]

gsl::complex_long_double::complex_long_double ( long double *  dat)
inlineexplicit

Allow construction from raw data.

This is mainly for use by the container classes.

Parameters
datRaw data

Definition at line 57 of file complex_long_double.hpp.

◆ complex_long_double() [3/5]

gsl::complex_long_double::complex_long_double ( long double const  real,
long double const  imag 
)
inline

Allow construction from real and imaginary values.

Parameters
realThe real part.
imagThe imaginary part.

Definition at line 65 of file complex_long_double.hpp.

References imag(), and real().

◆ complex_long_double() [4/5]

gsl::complex_long_double::complex_long_double ( std::complex< long double > const &  z)
inline

Allow construction from a std::complex<long double>.

Parameters
zThe std::complex

Definition at line 73 of file complex_long_double.hpp.

◆ complex_long_double() [5/5]

gsl::complex_long_double::complex_long_double ( gsl_complex_long_double const &  z)
inline

Constructor from base class.

Parameters
zA gsl_complex_long_double

Definition at line 84 of file complex_long_double.hpp.

Member Function Documentation

◆ get() [1/2]

gsl_complex_long_double & gsl::complex_long_double::get ( )
inline

Get the base class object.

Returns
the base class object.

Definition at line 106 of file complex_long_double.hpp.

◆ get() [2/2]

gsl_complex_long_double const & gsl::complex_long_double::get ( ) const
inline

Get the base class object.

Returns
the base class object.

Definition at line 111 of file complex_long_double.hpp.

◆ imag()

long double gsl::complex_long_double::imag ( ) const
inline

C++ version of GSL_IMAG().

Returns
The real part of this

Definition at line 142 of file complex_long_double.hpp.

Referenced by complex_long_double().

◆ operator std::complex< long double >()

gsl::complex_long_double::operator std::complex< long double > ( ) const
inlineexplicit

Convert to std::complex<long double>

Returns
std::complex<long double> version of this (by copying).

Definition at line 93 of file complex_long_double.hpp.

◆ operator!=()

bool gsl::complex_long_double::operator!= ( complex_long_double const &  z) const
inline

A complex_long_double object must be less than comparable so that it can be used as a container value type.

This is the inequality operator.

Parameters
zAnother complex_long_double
Returns
false or true according as this equals z

Definition at line 166 of file complex_long_double.hpp.

◆ operator<()

bool gsl::complex_long_double::operator< ( complex_long_double const &  z) const
inline

A complex_long_double object must be less than comparable so that it can be used as a container value type.

This is the (lexicographic) less than operator.

Parameters
zAnother complex_long_double
Returns
true or false according as this is less than z

Definition at line 173 of file complex_long_double.hpp.

◆ operator<=()

bool gsl::complex_long_double::operator<= ( complex_long_double const &  z) const
inline

A complex_long_double object must be less than comparable so that it can be used as a container value type.

This is the (lexicographic) less than or equal to operator.

Parameters
zAnother complex_long_double
Returns
true or false according as this is less than or equal to z

Definition at line 189 of file complex_long_double.hpp.

◆ operator==()

bool gsl::complex_long_double::operator== ( complex_long_double const &  z) const
inline

A complex_long_double object must be less than comparable so that it can be used as a container value type.

This is the equality operator.

Parameters
zAnother complex_long_double
Returns
true or false according as this equals z

Definition at line 159 of file complex_long_double.hpp.

◆ operator>()

bool gsl::complex_long_double::operator> ( complex_long_double const &  z) const
inline

A complex_long_double object must be less than comparable so that it can be used as a container value type.

This is the (lexicographic) greater than operator.

Parameters
zAnother complex_long_double
Returns
true or false according as this is greater than than z

Definition at line 181 of file complex_long_double.hpp.

◆ operator>=()

bool gsl::complex_long_double::operator>= ( complex_long_double const &  z) const
inline

A complex_long_double object must be less than comparable so that it can be used as a container value type.

This is the (lexicographic) greater than or equal to operator.

Parameters
zAnother complex_long_double
Returns
true or false according as this is greater than or equal to z

Definition at line 196 of file complex_long_double.hpp.

◆ polar()

static complex_long_double gsl::complex_long_double::polar ( long double  r,
long double  theta 
)
inlinestatic

C++ version of gsl_complex_long_double_rect().

Parameters
rThe magnitude
thetaThe argument
Returns
complex_long_double

Definition at line 125 of file complex_long_double.hpp.

References gsl::cpx::cos(), and gsl::cpx::sin().

Referenced by gsl::cpx_long_double::polar().

◆ real()

long double gsl::complex_long_double::real ( ) const
inline

C++ version of GSL_REAL().

Returns
The real part of this

Definition at line 137 of file complex_long_double.hpp.

Referenced by complex_long_double().

◆ rect()

static complex_long_double gsl::complex_long_double::rect ( long double  x,
long double  y 
)
inlinestatic

C++ version of gsl_complex_long_double_rect().

Parameters
xReal part
yImaginary part
Returns
complex_long_double

Definition at line 118 of file complex_long_double.hpp.

Referenced by gsl::cpx_long_double::rect().

◆ set_complex_long_double()

void gsl::complex_long_double::set_complex_long_double ( long double  x,
long double  y 
)
inline

C++ version of GSL_SET_COMPLEX().

Parameters
xReal part
yImaginary part

Definition at line 132 of file complex_long_double.hpp.

◆ set_imag()

void gsl::complex_long_double::set_imag ( long double  y)
inline

C++ version of GSL_SET_IMAG().

Parameters
yThe new imaginary part

Definition at line 152 of file complex_long_double.hpp.

◆ set_real()

void gsl::complex_long_double::set_real ( long double  x)
inline

C++ version of GSL_SET_REAL().

Parameters
xThe new real part

Definition at line 147 of file complex_long_double.hpp.

Friends And Related Function Documentation

◆ complex_long_double_ptr

friend class complex_long_double_ptr
friend

Definition at line 43 of file complex_long_double.hpp.

◆ complex_long_double_ref

friend class complex_long_double_ref
friend

Definition at line 44 of file complex_long_double.hpp.

◆ matrix_complex_long_double

friend class matrix_complex_long_double
friend

Definition at line 46 of file complex_long_double.hpp.

◆ vector_complex_long_double

friend class vector_complex_long_double
friend

Definition at line 45 of file complex_long_double.hpp.


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