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

This class handles vector_complex objects as shared handles. More...

#include <vector_complex.hpp>

Inheritance diagram for gsl::vector_complex:
Inheritance graph
Collaboration diagram for gsl::vector_complex:
Collaboration graph

Classes

class  const_iterator_t
 A class template for the const iterators. More...
 
class  iterator_base
 The container must have iterator types. More...
 
class  iterator_t
 A class template for the two non-const iterators. More...
 

Public Types

typedef complex value_type
 A container must have a value_type. More...
 
typedef complex_ref reference
 A container must have a reference type. More...
 
typedef reference const const_reference
 A container must have a constant reference type. More...
 
typedef complex_ptr pointer
 A container must have a pointer type. More...
 
typedef complex_ptr const const_pointer
 A container must have a constant pointer type. More...
 
typedef const_iterator_t< false > const_iterator
 The const_iterator type. More...
 
typedef iterator_t< false > iterator
 The iterator type. More...
 
typedef const_iterator_t< true > const_reverse_iterator
 The const_reverse_t type. More...
 
typedef iterator_t< true > reverse_iterator
 The reverse_iterator type. More...
 
typedef const_iterator::difference_type difference_type
 A container must have a difference_type. More...
 
typedef size_t size_type
 A container must have a size_type. More...
 

Public Member Functions

 vector_complex ()
 The default constructor is only really useful for assigning to. More...
 
 vector_complex (size_t const n)
 The default constructor creates a new vector_complex with n elements. More...
 
 vector_complex (gsl_vector_complex *v)
 Could construct from a gsl_vector_complex. More...
 
 vector_complex (std::initializer_list< std::complex< double > > initializer_list)
 Could construct from a std::initializer_list in C++11. More...
 
 vector_complex (vector_complex const &v)
 The copy constructor. More...
 
vector_complexoperator= (vector_complex const &v)
 The assignment operator. More...
 
vector_complex clone () const
 The clone function. More...
 
 ~vector_complex ()
 The destructor only deletes the pointers if count reaches zero. More...
 
void wrap_gsl_vector_complex_without_ownership (gsl_vector_complex *v)
 This function is intended mainly for internal use. More...
 
bool operator== (vector_complex const &v) const
 Two vector_complex objects are identically equal if their elements are identical. More...
 
void reset ()
 Stop sharing ownership of the shared pointer. More...
 
 vector_complex (vector_complex &&v)
 Move constructor. More...
 
vector_complexoperator= (vector_complex &&v)
 Move operator. More...
 
bool operator!= (vector_complex const &v) const
 Two vector_complex objects are different equal if their elements are not identical. More...
 
bool operator< (vector_complex const &v) const
 A container needs to define an ordering for sorting. More...
 
bool operator> (vector_complex const &v) const
 A container needs to define an ordering for sorting. More...
 
bool operator<= (vector_complex const &v) const
 A container needs to define an ordering for sorting. More...
 
bool operator>= (vector_complex const &v) const
 A container needs to define an ordering for sorting. More...
 
iterator begin ()
 Get iterator pointing to first vector_complex element. More...
 
const_iterator begin () const
 Get iterator pointing to first vector_complex element. More...
 
iterator end ()
 Get iterator pointing beyond last vector_complex element. More...
 
const_iterator end () const
 Get iterator pointing beyond last vector_complex element. More...
 
size_type size () const
 The size (number of elements) of the vector_complex. More...
 
double * data ()
 Give access to the data block. More...
 
double const * data () const
 Give access to the data block. More...
 
size_type max_size () const
 The max size (number of elements) of the vector_complex. More...
 
bool empty () const
 Find if the vector_complex is empty. More...
 
void swap (vector_complex &v)
 Swap two vector_complex objects. More...
 
reverse_iterator rbegin ()
 Get iterator pointing to first vector_complex element. More...
 
const_reverse_iterator rbegin () const
 Get iterator pointing to first vector_complex element. More...
 
reverse_iterator rend ()
 Get iterator pointing beyond last vector_complex element. More...
 
const_reverse_iterator rend () const
 Get iterator pointing beyond last vector_complex element. More...
 
complex_ref operator[] (size_t const n)
 Get element at position n by reference ([] operator). More...
 
complex_ref const operator[] (size_t const n) const
 Get element at position n by reference ([] operator). More...
 
gsl_vector_complex * get ()
 Get the gsl_vector_complex. More...
 
gsl_vector_complex const * get () const
 Get the gsl_vector_complex. More...
 
bool unique () const
 Find if this is the only object sharing the gsl_vector_complex. More...
 
size_t use_count () const
 Find how many vector_complex objects share this pointer. More...
 
 operator bool () const
 Allow conversion to bool. More...
 
void set_zero ()
 C++ version of gsl_vector_complex_set_zero(). More...
 
void set_all (complex x)
 C++ version of gsl_vector_complex_set_all(). More...
 
int set_basis (size_t i)
 C++ version of gsl_vector_complex_set_basis(). More...
 
int memcpy (vector_complex const &src)
 C++ version of gsl_vector_complex_memcpy(). More...
 
int reverse ()
 C++ version of gsl_vector_complex_reverse(). More...
 
int swap_elements (size_t const i, size_t const j)
 C++ version of gsl_vector_complex_swap_elements(). More...
 
int add (vector_complex const &b)
 C++ version of gsl_vector_complex_add(). More...
 
int sub (vector_complex const &b)
 C++ version of gsl_vector_complex_sub(). More...
 
int mul (vector_complex const &b)
 C++ version of gsl_vector_complex_mul(). More...
 
int div (vector_complex const &b)
 C++ version of gsl_vector_complex_div(). More...
 
int scale (complex const x)
 C++ version of gsl_vector_complex_scale(). More...
 
int add_constant (complex const x)
 C++ version of gsl_vector_complex_add_constant(). More...
 
int axpby (complex const alpha, vector_complex const &x, complex const beta)
 C++ version of gsl_vector_complex_axpby(). More...
 
int isnull () const
 C++ version of gsl_vector_complex_isnull(). More...
 
int ispos () const
 C++ version of gsl_vector_complex_ispos(). More...
 
int isneg () const
 C++ version of gsl_vector_complex_isneg(). More...
 
int isnonneg () const
 C++ version of gsl_vector_complex_isnonneg(). More...
 
complex get (size_t const i) const
 C++ version of gsl_vector_complex_get(). More...
 
void set (size_t const i, complex x)
 C++ version of gsl_vector_complex_set(). More...
 
complex_ptr ptr (size_t const i)
 C++ version of gsl_vector_complex_ptr(). More...
 
complex_ptr const const_ptr (size_t const i)
 C++ version of gsl_vector_complex_const_ptr(). More...
 
int fread (FILE *stream)
 C++ version of gsl_vector_complex_fread(). More...
 
int fwrite (FILE *stream) const
 C++ version of gsl_vector_complex_fwrite(). More...
 
int fscanf (FILE *stream)
 C++ version of gsl_vector_complex_fscanf(). More...
 
int fprintf (FILE *stream, char const *format) const
 C++ version of gsl_vector_complex_fprintf(). More...
 
 vector_complex (block_complex &b, size_t const offset, size_t const n, size_t const stride=1)
 C++ version of gsl_vector_complex_alloc_from_block(). More...
 
 vector_complex (vector_complex &v, size_t const offset, size_t const n, size_t const stride=1)
 C++ version of gsl_vector_complex_alloc_from_vector(). More...
 
gsl::vector real ()
 C++ version of gsl_vector_complex_real(). More...
 
gsl::vector const const_real () const
 C++ version of gsl_vector_complex_const_real(). More...
 
gsl::vector const real () const
 Another C++ version of gsl_vector_complex_const_real(). More...
 
gsl::vector imag ()
 C++ version of gsl_vector_complex_imag(). More...
 
gsl::vector const const_imag () const
 C++ version of gsl_vector_complex_const_imag(). More...
 
gsl::vector const imag () const
 Another C++ version of gsl_vector_complex_const_imag(). More...
 
vector_complex subvector (size_t i, size_t n)
 C++ version of gsl_vector_complex_subvector(). More...
 
vector_complex subvector_with_stride (size_t i, size_t stride, size_t n)
 C++ version of gsl_vector_complex_subvector_with_stride(). More...
 
vector_complex const const_subvector (size_t i, size_t n) const
 C++ version of gsl_vector_complex_const_subvector(). More...
 
vector_complex const const_subvector_with_stride (size_t i, size_t stride, size_t n) const
 C++ version of gsl_vector_complex_const_subvector_with_stride(). More...
 

Static Public Member Functions

static vector_complex calloc (size_t const n)
 C++ version of gsl_vector_complex_calloc(). More...
 
static vector_complex view_array (double *v, size_t n)
 C++ version of gsl_vector_complex_view_array(). More...
 
static vector_complex view_array_with_stride (double *base, size_t stride, size_t n)
 C++ version of gsl_vector_complex_view_array_with_stride(). More...
 
static vector_complex const const_view_array (double const *v, size_t n)
 C++ version of gsl_vector_complex _const_view_array(). More...
 
static vector_complex const const_view_array_with_stride (double const *base, size_t stride, size_t n)
 C++ version of gsl_vector_complex_const_view_array_with_stride(). More...
 
template<typename ARRAY >
static vector_complex view_array (ARRAY &v, size_t n=0)
 C++ version of gsl_vector_complex_view_array(). More...
 
template<typename ARRAY >
static vector_complex view_array_with_stride (ARRAY &base, size_t stride, size_t n=0)
 C++ version of gsl_vector_complex_view_array_with_stride(). More...
 
template<typename ARRAY >
static vector_complex const const_view_array (ARRAY const &v, size_t n=0)
 C++ version of gsl_vector_complex _const_view_array(). More...
 
template<typename ARRAY >
static vector_complex const const_view_array_with_stride (ARRAY const &base, size_t stride, size_t n=0)
 C++ version of gsl_vector_complex_const_view_array_with_stride(). More...
 
static vector_complex alloc_row_from_matrix (matrix_complex &m, size_t const i)
 C++ version of gsl_vector_complex_alloc_row_from_matrix(). More...
 
static vector_complex alloc_col_from_matrix (matrix_complex &m, size_t const j)
 C++ version of gsl_vector_complex_alloc_col_from_matrix(). More...
 

Private Attributes

bool owns_data
 Used to allow a vector that does not own its data. More...
 
gsl_vector_complex * ccgsl_pointer
 The shared pointer. More...
 
size_t * count
 The shared reference count. More...
 

Detailed Description

This class handles vector_complex objects as shared handles.

It models a random access container so that STL functions work with vector_complex.

Note that vector_complex_views are implemented as vector_complex objects here.

Definition at line 46 of file vector_complex.hpp.

Member Typedef Documentation

◆ const_iterator

The const_iterator type.

Definition at line 1034 of file vector_complex.hpp.

◆ const_pointer

A container must have a constant pointer type.

Definition at line 369 of file vector_complex.hpp.

◆ const_reference

A container must have a constant reference type.

Definition at line 359 of file vector_complex.hpp.

◆ const_reverse_iterator

The const_reverse_t type.

Definition at line 1042 of file vector_complex.hpp.

◆ difference_type

A container must have a difference_type.

Definition at line 1051 of file vector_complex.hpp.

◆ iterator

The iterator type.

Definition at line 1038 of file vector_complex.hpp.

◆ pointer

A container must have a pointer type.

Definition at line 364 of file vector_complex.hpp.

◆ reference

A container must have a reference type.

Definition at line 354 of file vector_complex.hpp.

◆ reverse_iterator

The reverse_iterator type.

Definition at line 1046 of file vector_complex.hpp.

◆ size_type

A container must have a size_type.

Definition at line 1056 of file vector_complex.hpp.

◆ value_type

A container must have a value_type.

Definition at line 349 of file vector_complex.hpp.

Constructor & Destructor Documentation

◆ vector_complex() [1/8]

gsl::vector_complex::vector_complex ( )
inline

◆ vector_complex() [2/8]

gsl::vector_complex::vector_complex ( size_t const  n)
inlineexplicit

The default constructor creates a new vector_complex with n elements.

Parameters
nThe number of elements in the vector_complex

Definition at line 62 of file vector_complex.hpp.

References ccgsl_pointer, count, and gsl::rstat::n().

◆ vector_complex() [3/8]

gsl::vector_complex::vector_complex ( gsl_vector_complex *  v)
inlineexplicit

Could construct from a gsl_vector_complex.

This is not usually a good idea. In this case you should not use gsl_vector_complex_free() to deallocate the memory.

Parameters
vThe vector_complex

Definition at line 102 of file vector_complex.hpp.

References ccgsl_pointer, and count.

◆ vector_complex() [4/8]

gsl::vector_complex::vector_complex ( std::initializer_list< std::complex< double > >  initializer_list)
inline

Could construct from a std::initializer_list in C++11.

Parameters
initializer_listThe initializer_list.

Definition at line 114 of file vector_complex.hpp.

References begin(), ccgsl_pointer, count, and gsl::rstat::n().

◆ vector_complex() [5/8]

gsl::vector_complex::vector_complex ( vector_complex const &  v)
inline

The copy constructor.

This shares the vector_complex. Use clone() if you want a full copy.

Parameters
vThe vector_complex to copy.

Definition at line 138 of file vector_complex.hpp.

References count.

◆ ~vector_complex()

gsl::vector_complex::~vector_complex ( )
inline

The destructor only deletes the pointers if count reaches zero.

Definition at line 180 of file vector_complex.hpp.

References ccgsl_pointer, count, and owns_data.

◆ vector_complex() [6/8]

gsl::vector_complex::vector_complex ( vector_complex &&  v)
inline

Move constructor.

Parameters
vThe vector_complex to move.

Definition at line 240 of file vector_complex.hpp.

References count.

◆ vector_complex() [7/8]

gsl::vector_complex::vector_complex ( block_complex b,
size_t const  offset,
size_t const  n,
size_t const  stride = 1 
)
inline

C++ version of gsl_vector_complex_alloc_from_block().

Parameters
bThe vector_complex
offsetThe offset within the vector_complex
nThe number of elements
strideThe stride

Definition at line 1440 of file vector_complex.hpp.

References gsl::sf::mathieu::b(), ccgsl_pointer, count, and gsl::rstat::n().

◆ vector_complex() [8/8]

gsl::vector_complex::vector_complex ( vector_complex v,
size_t const  offset,
size_t const  n,
size_t const  stride = 1 
)
inline

C++ version of gsl_vector_complex_alloc_from_vector().

Parameters
vThe vector_complex
offsetThe offset
nThe number of elements
strideThe stride

Definition at line 1457 of file vector_complex.hpp.

References ccgsl_pointer, count, get(), and gsl::rstat::n().

Member Function Documentation

◆ add()

int gsl::vector_complex::add ( vector_complex const &  b)
inline

C++ version of gsl_vector_complex_add().

Parameters
bvector_complex to add to this
Returns
error code on failure

Definition at line 1315 of file vector_complex.hpp.

References gsl::sf::mathieu::b(), and get().

◆ add_constant()

int gsl::vector_complex::add_constant ( complex const  x)
inline

C++ version of gsl_vector_complex_add_constant().

Parameters
xconstant to add to each element of this
Returns
error code on failure

Definition at line 1345 of file vector_complex.hpp.

References get().

◆ alloc_col_from_matrix()

static vector_complex gsl::vector_complex::alloc_col_from_matrix ( matrix_complex m,
size_t const  j 
)
static

C++ version of gsl_vector_complex_alloc_col_from_matrix().

Parameters
mA matrix
jA column
Returns
A vector_complex

◆ alloc_row_from_matrix()

static vector_complex gsl::vector_complex::alloc_row_from_matrix ( matrix_complex m,
size_t const  i 
)
static

C++ version of gsl_vector_complex_alloc_row_from_matrix().

Parameters
mA matrix_complex
iA row
Returns
A vector_complex

◆ axpby()

int gsl::vector_complex::axpby ( complex const  alpha,
vector_complex const &  x,
complex const  beta 
)
inline

C++ version of gsl_vector_complex_axpby().

Parameters
alphaconstant to multiply x by
xanother matrix
betaconstant to multiply this by
Returns
alpha * x + beta * this

Definition at line 1353 of file vector_complex.hpp.

References gsl::ran::beta(), and get().

◆ begin() [1/2]

iterator gsl::vector_complex::begin ( )
inline

Get iterator pointing to first vector_complex element.

Returns
iterator pointing to first vector_complex element

Definition at line 1062 of file vector_complex.hpp.

Referenced by vector_complex().

◆ begin() [2/2]

const_iterator gsl::vector_complex::begin ( ) const
inline

Get iterator pointing to first vector_complex element.

Returns
iterator pointing to first vector_complex element

Definition at line 1069 of file vector_complex.hpp.

◆ calloc()

static vector_complex gsl::vector_complex::calloc ( size_t const  n)
inlinestatic

C++ version of gsl_vector_complex_calloc().

This constructs a vector_complex object with entries initialised to zero.

Parameters
nThe size of the vector_complex
Returns
A vector_complex initialised to zero

Definition at line 1275 of file vector_complex.hpp.

References gsl::rstat::n(), and vector_complex().

◆ clone()

vector_complex gsl::vector_complex::clone ( ) const
inline

The clone function.

Use this if you want a copy of the vector_complex that does not share the underlying data.

Returns
a new copy of this.

Definition at line 169 of file vector_complex.hpp.

References get(), and size().

◆ const_imag()

gsl::vector const gsl::vector_complex::const_imag ( ) const
inline

C++ version of gsl_vector_complex_const_imag().

Note that this is a view: if the complex_vector from which the return value is constructed is deleted then the return value should not be used.

Returns
The imaginary parts of each element

Definition at line 1505 of file vector_complex.hpp.

References CCGSL_MTY, gsl::vector::const_view_array_with_stride(), data(), and size().

◆ const_ptr()

complex_ptr const gsl::vector_complex::const_ptr ( size_t const  i)
inline

C++ version of gsl_vector_complex_const_ptr().

Parameters
iindex of element to get
Returns
pointer to element

Definition at line 1403 of file vector_complex.hpp.

References CCGSL_MTY, ccgsl_pointer, and gsl::exception::GSL_EINVAL.

◆ const_real()

gsl::vector const gsl::vector_complex::const_real ( ) const
inline

C++ version of gsl_vector_complex_const_real().

Note that this is a view: if the complex_vector from which the return value is constructed is deleted then the return value should not be used.

Returns
The real parts of each element

Definition at line 1481 of file vector_complex.hpp.

References CCGSL_MTY, gsl::vector::const_view_array_with_stride(), data(), and size().

◆ const_subvector()

vector_complex const gsl::vector_complex::const_subvector ( size_t  i,
size_t  n 
) const
inline

C++ version of gsl_vector_complex_const_subvector().

Parameters
iThe offset
nThe size
Returns
A subvector

Definition at line 1633 of file vector_complex.hpp.

References get(), gsl::rstat::n(), and vector_complex().

◆ const_subvector_with_stride()

vector_complex const gsl::vector_complex::const_subvector_with_stride ( size_t  i,
size_t  stride,
size_t  n 
) const
inline

C++ version of gsl_vector_complex_const_subvector_with_stride().

Parameters
iThe offset
strideThe stride
nThe size
Returns
A subvector

Definition at line 1647 of file vector_complex.hpp.

References get(), gsl::rstat::n(), and vector_complex().

◆ const_view_array() [1/2]

template<typename ARRAY >
static vector_complex const gsl::vector_complex::const_view_array ( ARRAY const &  v,
size_t  n = 0 
)
inlinestatic

C++ version of gsl_vector_complex _const_view_array().

Parameters
vAn array of type complex
nThe size of the vector_complex: the default gives access to the whole array
Returns
A vector_complex

Definition at line 1729 of file vector_complex.hpp.

References gsl::exception::GSL_EBADLEN, gsl::rstat::n(), and vector_complex().

◆ const_view_array() [2/2]

static vector_complex const gsl::vector_complex::const_view_array ( double const *  v,
size_t  n 
)
inlinestatic

C++ version of gsl_vector_complex _const_view_array().

Parameters
vAn array of type complex
nThe size of the vector_complex
Returns
A vector_complex

Definition at line 1548 of file vector_complex.hpp.

References gsl::rstat::n(), and vector_complex().

◆ const_view_array_with_stride() [1/2]

template<typename ARRAY >
static vector_complex const gsl::vector_complex::const_view_array_with_stride ( ARRAY const &  base,
size_t  stride,
size_t  n = 0 
)
inlinestatic

C++ version of gsl_vector_complex_const_view_array_with_stride().

Parameters
baseAn array of type complex
strideThe stride
nThe size of the vector_complex: the default gives access to the whole array
Returns
A vector_complex

Definition at line 1748 of file vector_complex.hpp.

References gsl::exception::GSL_EBADLEN, gsl::rstat::n(), and vector_complex().

◆ const_view_array_with_stride() [2/2]

static vector_complex const gsl::vector_complex::const_view_array_with_stride ( double const *  base,
size_t  stride,
size_t  n 
)
inlinestatic

C++ version of gsl_vector_complex_const_view_array_with_stride().

Parameters
baseAn array of type complex
strideThe stride
nThe size of the vector_complex
Returns
A vector_complex

Definition at line 1562 of file vector_complex.hpp.

References gsl::rstat::n(), and vector_complex().

◆ data() [1/2]

double * gsl::vector_complex::data ( )
inline

Give access to the data block.

The data() and size() functions mimic the functions of std::array<T> and std::vector<T>. This function can throw an exception or produce a GSL error if the vector stride is not 1. However, new vector objects are always initialised to have a stride of 1.

Returns
The data block.

Definition at line 1102 of file vector_complex.hpp.

References ccgsl_pointer.

Referenced by gsl::fft::complex::radix2::backward(), gsl::fft::complex::backward(), const_imag(), const_real(), gsl::fft::complex::radix2::dif_backward(), gsl::fft::complex::radix2::dif_forward(), gsl::fft::complex::radix2::dif_inverse(), gsl::fft::complex::radix2::dif_transform(), gsl::fft::complex::radix2::forward(), gsl::fft::complex::forward(), imag(), gsl::fft::complex::radix2::inverse(), gsl::fft::complex::inverse(), real(), gsl::fft::complex::radix2::transform(), gsl::fft::complex::transform(), gsl::fft::halfcomplex::unpack(), and gsl::fft::real::unpack().

◆ data() [2/2]

double const * gsl::vector_complex::data ( ) const
inline

Give access to the data block.

The data() and size() functions mimic the functions of std::array<T> and std::vector<T>. This function can throw an exception or produce a GSL error if the vector stride is not 1. However, new vector objects are always initialised to have a stride of 1.

Returns
The data block.

Definition at line 1116 of file vector_complex.hpp.

References ccgsl_pointer.

◆ div()

int gsl::vector_complex::div ( vector_complex const &  b)
inline

C++ version of gsl_vector_complex_div().

Parameters
bvector_complex to dividev this by elementwise
Returns
error code on failure

Definition at line 1333 of file vector_complex.hpp.

References gsl::sf::mathieu::b(), and get().

◆ empty()

bool gsl::vector_complex::empty ( ) const
inline

Find if the vector_complex is empty.

Returns
true if has size zero; otherwise false

Definition at line 1135 of file vector_complex.hpp.

References ccgsl_pointer.

◆ end() [1/2]

iterator gsl::vector_complex::end ( )
inline

Get iterator pointing beyond last vector_complex element.

Returns
iterator pointing beyond last vector_complex element

Definition at line 1077 of file vector_complex.hpp.

References ccgsl_pointer, and size().

◆ end() [2/2]

const_iterator gsl::vector_complex::end ( ) const
inline

Get iterator pointing beyond last vector_complex element.

Returns
iterator pointing beyond last vector_complex element

Definition at line 1085 of file vector_complex.hpp.

References ccgsl_pointer, and size().

◆ fprintf()

int gsl::vector_complex::fprintf ( FILE *  stream,
char const *  format 
) const
inline

C++ version of gsl_vector_complex_fprintf().

Parameters
streamA C file stream
formatd, e, f or g
Returns
error code on failure

Definition at line 1431 of file vector_complex.hpp.

References get().

◆ fread()

int gsl::vector_complex::fread ( FILE *  stream)
inline

C++ version of gsl_vector_complex_fread().

Parameters
streamA C file stream
Returns
error code on failure

Definition at line 1412 of file vector_complex.hpp.

References get().

◆ fscanf()

int gsl::vector_complex::fscanf ( FILE *  stream)
inline

C++ version of gsl_vector_complex_fscanf().

Parameters
streamA C file stream
Returns
error code on failure

Definition at line 1424 of file vector_complex.hpp.

References get().

◆ fwrite()

int gsl::vector_complex::fwrite ( FILE *  stream) const
inline

C++ version of gsl_vector_complex_fwrite().

Parameters
streamA C file stream
Returns
error code on failure

Definition at line 1418 of file vector_complex.hpp.

References get().

◆ get() [1/3]

gsl_vector_complex * gsl::vector_complex::get ( )
inline

Get the gsl_vector_complex.

Returns
the gsl_vector_complex

Definition at line 1241 of file vector_complex.hpp.

References ccgsl_pointer.

Referenced by add(), add_constant(), axpby(), clone(), gsl::linalg::complex_cholesky_solve(), gsl::linalg::complex_cholesky_svx(), gsl::linalg::complex_householder_hm(), gsl::linalg::complex_householder_hv(), gsl::linalg::complex_householder_left(), gsl::linalg::complex_householder_mh(), gsl::linalg::complex_householder_transform(), gsl::linalg::complex_LU_refine(), gsl::linalg::complex_LU_solve(), gsl::linalg::complex_LU_svx(), gsl::linalg::complex_QR_decomp(), gsl::linalg::complex_QR_lssolve(), gsl::linalg::complex_QR_lssolve_r(), gsl::linalg::complex_QR_QHvec(), gsl::linalg::complex_QR_QHvec_r(), gsl::linalg::complex_QR_Qvec(), gsl::linalg::complex_QR_solve(), gsl::linalg::complex_QR_solve_r(), gsl::linalg::complex_QR_svx(), gsl::linalg::complex_QR_unpack(), const_subvector(), const_subvector_with_stride(), gsl::matrix_complex::const_view_vector(), gsl::matrix_complex::const_view_vector_with_tda(), div(), gsl::blas::dzasum(), gsl::blas::dznrm2(), fprintf(), fread(), fscanf(), fwrite(), gsl::eigen::gen(), gsl::eigen::gen_QZ(), gsl::eigen::genv(), gsl::eigen::genv_QZ(), gsl::eigen::genv_sort(), gsl::matrix_complex::get_col(), gsl::matrix_complex::get_row(), gsl::linalg::hermtd_decomp(), gsl::linalg::hermtd_unpack(), isneg(), isnonneg(), isnull(), ispos(), gsl::blas::izamax(), memcpy(), mul(), reverse(), scale(), gsl::spmatrix_complex_double::scale_columns(), gsl::matrix_complex::scale_columns(), gsl::spmatrix_complex_double::scale_rows(), gsl::matrix_complex::scale_rows(), set(), set_all(), set_basis(), gsl::matrix_complex::set_col(), gsl::matrix_complex::set_row(), set_zero(), sub(), subvector(), subvector_with_stride(), swap_elements(), vector_complex(), gsl::permute::vector_complex_forward(), gsl::permute::vector_complex_inverse(), gsl::matrix_complex::view_vector(), gsl::matrix_complex::view_vector_with_tda(), gsl::blas::zaxpy(), gsl::blas::zcopy(), gsl::blas::zdotc(), gsl::blas::zdotu(), gsl::blas::zdscal(), gsl::blas::zgemv(), gsl::blas::zgerc(), gsl::blas::zgeru(), gsl::blas::zhemv(), gsl::blas::zher(), gsl::blas::zher2(), gsl::blas::zscal(), gsl::blas::zswap(), gsl::blas::ztrmv(), and gsl::blas::ztrsv().

◆ get() [2/3]

gsl_vector_complex const * gsl::vector_complex::get ( ) const
inline

Get the gsl_vector_complex.

Returns
the gsl_vector_complex

Definition at line 1246 of file vector_complex.hpp.

References ccgsl_pointer.

◆ get() [3/3]

complex gsl::vector_complex::get ( size_t const  i) const
inline

C++ version of gsl_vector_complex_get().

Parameters
iindex of element to get
Returns
value of element

Definition at line 1382 of file vector_complex.hpp.

References get().

Referenced by get().

◆ imag() [1/2]

gsl::vector gsl::vector_complex::imag ( )
inline

C++ version of gsl_vector_complex_imag().

Note that this is a view: if the complex_vector from which the return value is constructed is deleted then the return value should not be used.

Returns
The imaginary parts of each element

Definition at line 1497 of file vector_complex.hpp.

References CCGSL_MTY, data(), size(), and gsl::vector::view_array_with_stride().

◆ imag() [2/2]

gsl::vector const gsl::vector_complex::imag ( ) const
inline

Another C++ version of gsl_vector_complex_const_imag().

Note that this is a view: if the complex_vector from which the return value is constructed is deleted then the return value should not be used.

Returns
The imaginary parts of each element

Definition at line 1513 of file vector_complex.hpp.

References CCGSL_MTY, gsl::vector::const_view_array_with_stride(), data(), and size().

◆ isneg()

int gsl::vector_complex::isneg ( ) const
inline

C++ version of gsl_vector_complex_isneg().

Returns
+1 or 0 according as elements are all negative or not

Definition at line 1371 of file vector_complex.hpp.

References get().

◆ isnonneg()

int gsl::vector_complex::isnonneg ( ) const
inline

C++ version of gsl_vector_complex_isnonneg().

Returns
+1 or 0 according as elements are all nonnegative or not

Definition at line 1376 of file vector_complex.hpp.

References get().

◆ isnull()

int gsl::vector_complex::isnull ( ) const
inline

C++ version of gsl_vector_complex_isnull().

Returns
+1 or 0 according as elements are all zero or not

Definition at line 1361 of file vector_complex.hpp.

References get().

◆ ispos()

int gsl::vector_complex::ispos ( ) const
inline

C++ version of gsl_vector_complex_ispos().

Returns
+1 or 0 according as elements are all positive or not

Definition at line 1366 of file vector_complex.hpp.

References get().

◆ max_size()

size_type gsl::vector_complex::max_size ( ) const
inline

The max size (number of elements) of the vector_complex.

Identical to size but required for a container.

Returns
The size of the vector_complex

Definition at line 1129 of file vector_complex.hpp.

References ccgsl_pointer.

◆ memcpy()

int gsl::vector_complex::memcpy ( vector_complex const &  src)
inline

C++ version of gsl_vector_complex_memcpy().

Parameters
srcsource vector_complex
Returns
error code on failure

Definition at line 1296 of file vector_complex.hpp.

References get().

◆ mul()

int gsl::vector_complex::mul ( vector_complex const &  b)
inline

C++ version of gsl_vector_complex_mul().

Parameters
bvector_complex to multiply elementwise with this
Returns
error code on failure

Definition at line 1327 of file vector_complex.hpp.

References gsl::sf::mathieu::b(), and get().

◆ operator bool()

gsl::vector_complex::operator bool ( ) const
inlineexplicit

Allow conversion to bool.

Returns
true or false according as this contains a pointer to a gsl_vector_complex

Definition at line 1266 of file vector_complex.hpp.

References ccgsl_pointer.

◆ operator!=()

bool gsl::vector_complex::operator!= ( vector_complex const &  v) const
inline

Two vector_complex objects are different equal if their elements are not identical.

Parameters
vThe vector_complex to be compared with this
Returns
false or true according as this and v have identical elements or not

Definition at line 263 of file vector_complex.hpp.

References operator==().

◆ operator<()

bool gsl::vector_complex::operator< ( vector_complex const &  v) const
inline

A container needs to define an ordering for sorting.

This uses standard lexicographical ordering and so is not useful, for example, for checking, that a vector_complex is nonnegative.

Parameters
vThe vector_complex to be compared with this
Returns
false or true according as this is less than v lexicographically

Definition at line 275 of file vector_complex.hpp.

References ccgsl_pointer, gsl::movstat::min(), and size().

Referenced by operator<=().

◆ operator<=()

bool gsl::vector_complex::operator<= ( vector_complex const &  v) const
inline

A container needs to define an ordering for sorting.

This uses standard lexicographical ordering and so is not useful, for example, for checking, that a vector_complex is nonnegative.

Parameters
vThe vector_complex to be compared with this
Returns
false or true according as this is less than or equal to v lexicographically

Definition at line 329 of file vector_complex.hpp.

References operator<(), and operator==().

◆ operator=() [1/2]

vector_complex & gsl::vector_complex::operator= ( vector_complex &&  v)
inline

Move operator.

Parameters
vThe vector_complex to move.
Returns
A reference to this.

Definition at line 251 of file vector_complex.hpp.

References vector_complex().

◆ operator=() [2/2]

vector_complex & gsl::vector_complex::operator= ( vector_complex const &  v)
inline

The assignment operator.

This makes a shared copy.

Parameters
vThe vector_complex to copy

Definition at line 148 of file vector_complex.hpp.

References ccgsl_pointer, count, and owns_data.

◆ operator==()

bool gsl::vector_complex::operator== ( vector_complex const &  v) const
inline

Two vector_complex objects are identically equal if their elements are identical.

Parameters
vThe vector_complex to be compared with this
Returns
true or false according as this and v have identical elements or not

Definition at line 218 of file vector_complex.hpp.

References CCGSL_MTY, and ccgsl_pointer.

Referenced by operator!=(), operator<=(), and operator>=().

◆ operator>()

bool gsl::vector_complex::operator> ( vector_complex const &  v) const
inline

A container needs to define an ordering for sorting.

This uses standard lexicographical ordering and so is not useful, for example, for checking, that a vector_complex is nonnegative.

Parameters
vThe vector_complex to be compared with this
Returns
false or true according as this is greater than v lexicographically

Definition at line 302 of file vector_complex.hpp.

References ccgsl_pointer, gsl::movstat::min(), and size().

Referenced by operator>=().

◆ operator>=()

bool gsl::vector_complex::operator>= ( vector_complex const &  v) const
inline

A container needs to define an ordering for sorting.

This uses standard lexicographical ordering and so is not useful, for example, for checking, that a vector_complex is nonnegative.

Parameters
vThe vector_complex to be compared with this
Returns
false or true according as this is no less than v lexicographically

Definition at line 341 of file vector_complex.hpp.

References operator==(), and operator>().

◆ operator[]() [1/2]

complex_ref gsl::vector_complex::operator[] ( size_t const  n)
inline

Get element at position n by reference ([] operator).

Parameters
nThe position of the element
Returns
a reference to a complex

Definition at line 1185 of file vector_complex.hpp.

References CCGSL_MTY, ccgsl_pointer, gsl::exception::GSL_EFAILED, gsl::rstat::n(), and size().

◆ operator[]() [2/2]

complex_ref const gsl::vector_complex::operator[] ( size_t const  n) const
inline

Get element at position n by reference ([] operator).

Parameters
nThe position of the element
Returns
a reference to a complex

Definition at line 1206 of file vector_complex.hpp.

References ccgsl_pointer, gsl::exception::GSL_EFAILED, gsl::rstat::n(), and size().

◆ ptr()

complex_ptr gsl::vector_complex::ptr ( size_t const  i)
inline

C++ version of gsl_vector_complex_ptr().

Parameters
iindex of element to get
Returns
pointer to element

Definition at line 1394 of file vector_complex.hpp.

References CCGSL_MTY, ccgsl_pointer, and gsl::exception::GSL_EINVAL.

◆ rbegin() [1/2]

reverse_iterator gsl::vector_complex::rbegin ( )
inline

Get iterator pointing to first vector_complex element.

Returns
iterator pointing to first vector_complex element

Definition at line 1152 of file vector_complex.hpp.

References ccgsl_pointer, and size().

◆ rbegin() [2/2]

const_reverse_iterator gsl::vector_complex::rbegin ( ) const
inline

Get iterator pointing to first vector_complex element.

Returns
iterator pointing to first vector_complex element

Definition at line 1160 of file vector_complex.hpp.

References ccgsl_pointer, and size().

◆ real() [1/2]

gsl::vector gsl::vector_complex::real ( )
inline

C++ version of gsl_vector_complex_real().

Note that this is a view: if the complex_vector from which the return value is constructed is deleted then the return value should not be used.

Returns
The real parts of each element

Definition at line 1473 of file vector_complex.hpp.

References CCGSL_MTY, data(), size(), and gsl::vector::view_array_with_stride().

◆ real() [2/2]

gsl::vector const gsl::vector_complex::real ( ) const
inline

Another C++ version of gsl_vector_complex_const_real().

Note that this is a view: if the complex_vector from which the return value is constructed is deleted then the return value should not be used.

Returns
The real parts of each element

Definition at line 1489 of file vector_complex.hpp.

References CCGSL_MTY, gsl::vector::const_view_array_with_stride(), data(), and size().

◆ rend() [1/2]

reverse_iterator gsl::vector_complex::rend ( )
inline

Get iterator pointing beyond last vector_complex element.

Returns
iterator pointing beyond last vector_complex element

Definition at line 1169 of file vector_complex.hpp.

◆ rend() [2/2]

const_reverse_iterator gsl::vector_complex::rend ( ) const
inline

Get iterator pointing beyond last vector_complex element.

Returns
iterator pointing beyond last vector_complex element

Definition at line 1176 of file vector_complex.hpp.

◆ reset()

void gsl::vector_complex::reset ( )
inline

Stop sharing ownership of the shared pointer.

Definition at line 234 of file vector_complex.hpp.

References vector_complex().

◆ reverse()

int gsl::vector_complex::reverse ( )
inline

C++ version of gsl_vector_complex_reverse().

Returns
error code on failure

Definition at line 1301 of file vector_complex.hpp.

References get().

◆ scale()

int gsl::vector_complex::scale ( complex const  x)
inline

C++ version of gsl_vector_complex_scale().

Parameters
xconstant to multiply this by
Returns
error code on failure

Definition at line 1339 of file vector_complex.hpp.

References get().

◆ set()

void gsl::vector_complex::set ( size_t const  i,
complex  x 
)
inline

C++ version of gsl_vector_complex_set().

Parameters
iindex to set
xnew value for element

Definition at line 1388 of file vector_complex.hpp.

References get().

◆ set_all()

void gsl::vector_complex::set_all ( complex  x)
inline

C++ version of gsl_vector_complex_set_all().

Parameters
xThe value to which all elements are set

Definition at line 1284 of file vector_complex.hpp.

References get().

◆ set_basis()

int gsl::vector_complex::set_basis ( size_t  i)
inline

C++ version of gsl_vector_complex_set_basis().

Creates a basis vector_complex with one nonzero element.

Parameters
iThe element to be set to 1.
Returns
error code on failure

Definition at line 1290 of file vector_complex.hpp.

References get().

◆ set_zero()

void gsl::vector_complex::set_zero ( )
inline

C++ version of gsl_vector_complex_set_zero().

Definition at line 1279 of file vector_complex.hpp.

References get().

◆ size()

◆ sub()

int gsl::vector_complex::sub ( vector_complex const &  b)
inline

C++ version of gsl_vector_complex_sub().

Parameters
bvector_complex to subtract from this
Returns
error code on failure

Definition at line 1321 of file vector_complex.hpp.

References gsl::sf::mathieu::b(), and get().

◆ subvector()

vector_complex gsl::vector_complex::subvector ( size_t  i,
size_t  n 
)
inline

C++ version of gsl_vector_complex_subvector().

Parameters
iThe offset
nThe size
Returns
A subvector

Definition at line 1606 of file vector_complex.hpp.

References get(), gsl::rstat::n(), and vector_complex().

◆ subvector_with_stride()

vector_complex gsl::vector_complex::subvector_with_stride ( size_t  i,
size_t  stride,
size_t  n 
)
inline

C++ version of gsl_vector_complex_subvector_with_stride().

Parameters
iThe offset
strideThe stride
nThe size
Returns
A subvector

Definition at line 1620 of file vector_complex.hpp.

References get(), gsl::rstat::n(), and vector_complex().

◆ swap()

void gsl::vector_complex::swap ( vector_complex v)
inline

Swap two vector_complex objects.

This works even if the vector_complex objects have different sizes because it swaps pointers.

Parameters
vThe vector_complex to swap with this.

Definition at line 1142 of file vector_complex.hpp.

References ccgsl_pointer, and count.

◆ swap_elements()

int gsl::vector_complex::swap_elements ( size_t const  i,
size_t const  j 
)
inline

C++ version of gsl_vector_complex_swap_elements().

Parameters
ifirst element
jsecond element
Returns
error code on failure

Definition at line 1308 of file vector_complex.hpp.

References get().

◆ unique()

bool gsl::vector_complex::unique ( ) const
inline

Find if this is the only object sharing the gsl_vector_complex.

Returns
true or falses according as this is the only vector_complex object sharing the gsl_vector_complex

Definition at line 1252 of file vector_complex.hpp.

References count.

◆ use_count()

size_t gsl::vector_complex::use_count ( ) const
inline

Find how many vector_complex objects share this pointer.

Returns
the number of vector_complex objects that share this pointer

Definition at line 1257 of file vector_complex.hpp.

References count.

◆ view_array() [1/2]

template<typename ARRAY >
static vector_complex gsl::vector_complex::view_array ( ARRAY &  v,
size_t  n = 0 
)
inlinestatic

C++ version of gsl_vector_complex_view_array().

Parameters
vAn array of complex
nThe size of the vector_complex: the default gives access to the whole array
Returns
A vector_complex

Definition at line 1692 of file vector_complex.hpp.

References gsl::exception::GSL_EBADLEN, gsl::rstat::n(), and vector_complex().

◆ view_array() [2/2]

static vector_complex gsl::vector_complex::view_array ( double *  v,
size_t  n 
)
inlinestatic

C++ version of gsl_vector_complex_view_array().

Parameters
vAn array of type complex
nThe size of the vector_complex
Returns
A vector_complex

Definition at line 1521 of file vector_complex.hpp.

References gsl::rstat::n(), and vector_complex().

◆ view_array_with_stride() [1/2]

template<typename ARRAY >
static vector_complex gsl::vector_complex::view_array_with_stride ( ARRAY &  base,
size_t  stride,
size_t  n = 0 
)
inlinestatic

C++ version of gsl_vector_complex_view_array_with_stride().

Parameters
baseAn array of type complex
strideThe stride
nThe size of the vector_complex: the default gives access to the whole array
Returns
A vector_complex

Definition at line 1711 of file vector_complex.hpp.

References gsl::exception::GSL_EBADLEN, gsl::rstat::n(), and vector_complex().

◆ view_array_with_stride() [2/2]

static vector_complex gsl::vector_complex::view_array_with_stride ( double *  base,
size_t  stride,
size_t  n 
)
inlinestatic

C++ version of gsl_vector_complex_view_array_with_stride().

Parameters
baseAn array of type complex
strideThe stride
nThe size of the vector_complex
Returns
A vector_complex

Definition at line 1535 of file vector_complex.hpp.

References gsl::rstat::n(), and vector_complex().

◆ wrap_gsl_vector_complex_without_ownership()

void gsl::vector_complex::wrap_gsl_vector_complex_without_ownership ( gsl_vector_complex *  v)
inline

This function is intended mainly for internal use.

It allows this to point to a gsl_vector_complex without the possibility deleting it when this is no longer in scope. It is the responsibility of the programmer to delete v. The function is used internally for converting a function that takes a gsl::vector_complex* argument to one that takes a gsl_vector_complex* argument.

Parameters
vThe gsl_vector_complex

Definition at line 198 of file vector_complex.hpp.

References ccgsl_pointer, count, and owns_data.

Referenced by gsl::matrix_complex::operator[]().

Member Data Documentation

◆ ccgsl_pointer

◆ count

size_t* gsl::vector_complex::count
private

The shared reference count.

Definition at line 1234 of file vector_complex.hpp.

Referenced by operator=(), swap(), unique(), use_count(), vector_complex(), wrap_gsl_vector_complex_without_ownership(), and ~vector_complex().

◆ owns_data

bool gsl::vector_complex::owns_data
private

Used to allow a vector that does not own its data.

Definition at line 1226 of file vector_complex.hpp.

Referenced by operator=(), vector_complex(), wrap_gsl_vector_complex_without_ownership(), and ~vector_complex().


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