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

This class can be used like a reference for complex_float objects so that we can iterate over a vector (for example) of them. More...

#include <complex_float.hpp>

Inheritance diagram for gsl::complex_float_ref:
Inheritance graph
Collaboration diagram for gsl::complex_float_ref:
Collaboration graph

Public Member Functions

 complex_float_ref (float *dat)
 We use this in constructing complex_float_ptr objects. More...
 
 operator gsl_complex_float () const
 Make sure this is convertible to gsl_complex_float. More...
 
 operator complex_float () const
 Make sure this is convertible to complex_float. More...
 
 complex_float_ref ()
 The default constructor is only really useful for assigning to. More...
 
 complex_float_ref (complex_float &z)
 Make sure we can construct from a complex_float. More...
 
complex_float_refoperator= (complex_float const &z)
 Assignment from complex_float. More...
 
void set_complex_float (float x, float y)
 C++ version of GSL_SET_COMPLEX(). More...
 
float real () const
 C++ version of GSL_REAL(). More...
 
float imag () const
 C++ version of GSL_IMAG(). More...
 
void set_real (float x)
 C++ version of GSL_SET_REAL(). More...
 
void set_imag (float y)
 C++ version of GSL_SET_IMAG(). More...
 

Protected Attributes

float * dat
 The data. More...
 

Detailed Description

This class can be used like a reference for complex_float objects so that we can iterate over a vector (for example) of them.

Definition at line 203 of file complex_float.hpp.

Constructor & Destructor Documentation

◆ complex_float_ref() [1/3]

gsl::complex_float_ref::complex_float_ref ( float *  dat)
inline

We use this in constructing complex_float_ptr objects.

Parameters
datA pointer to the data

Definition at line 214 of file complex_float.hpp.

◆ complex_float_ref() [2/3]

gsl::complex_float_ref::complex_float_ref ( )
inline

The default constructor is only really useful for assigning to.

Definition at line 233 of file complex_float.hpp.

◆ complex_float_ref() [3/3]

gsl::complex_float_ref::complex_float_ref ( complex_float z)
inline

Make sure we can construct from a complex_float.

Parameters
zThe complex_float to construct from

Definition at line 238 of file complex_float.hpp.

Member Function Documentation

◆ imag()

float gsl::complex_float_ref::imag ( ) const
inline

C++ version of GSL_IMAG().

Returns
The real part of this

Definition at line 264 of file complex_float.hpp.

◆ operator complex_float()

gsl::complex_float_ref::operator complex_float ( ) const
inline

Make sure this is convertible to complex_float.

This is not ideal because it copies twice. But it gets round the problem that a gsl_complex_float must contain constant data.

Returns
A complex_float

Definition at line 227 of file complex_float.hpp.

References dat.

◆ operator gsl_complex_float()

gsl::complex_float_ref::operator gsl_complex_float ( ) const
inline

Make sure this is convertible to gsl_complex_float.

This is not ideal because it copies twice. But it gets round the problem that a gsl_complex_float must contain constant data.

Returns
A gsl_complex_float

Definition at line 220 of file complex_float.hpp.

References dat.

◆ operator=()

complex_float_ref & gsl::complex_float_ref::operator= ( complex_float const &  z)
inline

Assignment from complex_float.

Parameters
zThe complex_float to assign from

Definition at line 246 of file complex_float.hpp.

References dat.

◆ real()

float gsl::complex_float_ref::real ( ) const
inline

C++ version of GSL_REAL().

Returns
The real part of this

Definition at line 259 of file complex_float.hpp.

◆ set_complex_float()

void gsl::complex_float_ref::set_complex_float ( float  x,
float  y 
)
inline

C++ version of GSL_SET_COMPLEX().

Parameters
xReal part
yImaginary part

Definition at line 254 of file complex_float.hpp.

◆ set_imag()

void gsl::complex_float_ref::set_imag ( float  y)
inline

C++ version of GSL_SET_IMAG().

Parameters
yThe new imaginary part

Definition at line 274 of file complex_float.hpp.

◆ set_real()

void gsl::complex_float_ref::set_real ( float  x)
inline

C++ version of GSL_SET_REAL().

Parameters
xThe new real part

Definition at line 269 of file complex_float.hpp.

Member Data Documentation

◆ dat

float* gsl::complex_float_ref::dat
protected

The data.

Never initialised or destroyed within the class. Always precisely two elements.

Definition at line 208 of file complex_float.hpp.

Referenced by operator complex_float(), operator gsl_complex_float(), and operator=().


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