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

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

#include <vector_float.hpp>

Inheritance diagram for gsl::vector_float:
Inheritance graph
Collaboration diagram for gsl::vector_float:
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 float value_type
 A container must have a value_type. More...
 
typedef value_typereference
 A container must have a reference type. More...
 
typedef value_type const & const_reference
 A container must have a constant reference type. More...
 
typedef value_typepointer
 A container must have a pointer type. More...
 
typedef value_type 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_float ()
 The default constructor is only really useful for assigning to. More...
 
 vector_float (size_t const n)
 The default constructor creates a new vector_float with n elements. More...
 
 vector_float (gsl_vector_float *v)
 Could construct from a gsl_vector_float. More...
 
 vector_float (std::initializer_list< float > initializer_list)
 Could construct from a std::initializer_list in C++11. More...
 
 vector_float (vector_float const &v)
 The copy constructor. More...
 
 vector_float (vector_float &v)
 The copy constructor. More...
 
vector_floatoperator= (vector_float const &v)
 The assignment operator. More...
 
template<typename V >
 vector_float (V &v, size_t const stride=1)
 Construct from an object that implements data() and size(). More...
 
vector_float clone () const
 The clone function. More...
 
 ~vector_float ()
 The destructor only deletes the pointers if count reaches zero. More...
 
void wrap_gsl_vector_float_without_ownership (gsl_vector_float *v)
 This function is intended mainly for internal use. More...
 
bool operator== (vector_float const &v) const
 Two vector_float objects are identically equal if their elements are identical. More...
 
void reset ()
 Stop sharing ownership of the shared pointer. More...
 
 vector_float (vector_float &&v)
 Move constructor. More...
 
vector_floatoperator= (vector_float &&v)
 Move operator. More...
 
bool operator!= (vector_float const &v) const
 Two vector_float objects are different equal if their elements are not identical. More...
 
bool operator< (vector_float const &v) const
 A container needs to define an ordering for sorting. More...
 
bool operator> (vector_float const &v) const
 A container needs to define an ordering for sorting. More...
 
bool operator<= (vector_float const &v) const
 A container needs to define an ordering for sorting. More...
 
bool operator>= (vector_float const &v) const
 A container needs to define an ordering for sorting. More...
 
iterator begin ()
 Get iterator pointing to first vector_float element. More...
 
const_iterator begin () const
 Get iterator pointing to first vector_float element. More...
 
iterator end ()
 Get iterator pointing beyond last vector_float element. More...
 
const_iterator end () const
 Get iterator pointing beyond last vector_float element. More...
 
size_type size () const
 The size (number of elements) of the vector_float. More...
 
float * data ()
 Give access to the data block_float. More...
 
float const * data () const
 Give access to the data block_float. More...
 
size_type max_size () const
 The max size (number of elements) of the vector_float. More...
 
bool empty () const
 Find if the vector_float is empty. More...
 
void swap (vector_float &v)
 Swap two vector_float objects. More...
 
reverse_iterator rbegin ()
 Get iterator pointing to first vector_float element. More...
 
const_reverse_iterator rbegin () const
 Get iterator pointing to first vector_float element. More...
 
reverse_iterator rend ()
 Get iterator pointing beyond last vector_float element. More...
 
const_reverse_iterator rend () const
 Get iterator pointing beyond last vector_float element. More...
 
float & operator[] (size_t const n)
 Get element at position n by reference ([] operator). More...
 
float const & operator[] (size_t const n) const
 Get element at position n by reference ([] operator). More...
 
gsl_vector_float * get ()
 Get the gsl_vector_float. More...
 
gsl_vector_float const * get () const
 Get the gsl_vector_float. More...
 
bool unique () const
 Find if this is the only object sharing the gsl_vector_float. More...
 
size_t use_count () const
 Find how many vector_float objects share this pointer. More...
 
 operator bool () const
 Allow conversion to bool. More...
 
void set_zero ()
 C++ version of gsl_vector_float_set_zero(). More...
 
void set_all (float x)
 C++ version of gsl_vector_float_set_all(). More...
 
int set_basis (size_t i)
 C++ version of gsl_vector_float_set_basis(). More...
 
int memcpy (vector_float const &src)
 C++ version of gsl_vector_float_memcpy(). More...
 
int reverse ()
 C++ version of gsl_vector_float_reverse(). More...
 
int swap_elements (size_t const i, size_t const j)
 C++ version of gsl_vector_float_swap_elements(). More...
 
float max () const
 C++ version of gsl_vector_float_max(). More...
 
float min () const
 C++ version of gsl_vector_float_min(). More...
 
void minmax (float *min_out, float *max_out) const
 C++ version of gsl_vector_float_minmax(). More...
 
void minmax (float &min_out, float &max_out) const
 C++ version of gsl_vector_float_minmax(). More...
 
size_t max_index () const
 C++ version of gsl_vector_float_max_index(). More...
 
size_t min_index () const
 C++ version of gsl_vector_float_min_index(). More...
 
void minmax_index (size_t *imin, size_t *imax) const
 C++ version of gsl_vector_float_minmax_index(). More...
 
int add (vector_float const &b)
 C++ version of gsl_vector_float_add(). More...
 
int sub (vector_float const &b)
 C++ version of gsl_vector_float_sub(). More...
 
int mul (vector_float const &b)
 C++ version of gsl_vector_float_mul(). More...
 
int div (vector_float const &b)
 C++ version of gsl_vector_float_div(). More...
 
int scale (float const x)
 C++ version of gsl_vector_float_scale(). More...
 
int add_constant (float const x)
 C++ version of gsl_vector_float_add_constant(). More...
 
int axpby (float const alpha, vector_float const &x, float const beta)
 C++ version of gsl_vector_float_axpby(). More...
 
float sum (vector_float const &a) const
 C++ version of gsl_vector_float_sum(). More...
 
int isnull () const
 C++ version of gsl_vector_float_isnull(). More...
 
int ispos () const
 C++ version of gsl_vector_float_ispos(). More...
 
int isneg () const
 C++ version of gsl_vector_float_isneg(). More...
 
int isnonneg () const
 C++ version of gsl_vector_float_isnonneg(). More...
 
float get (size_t const i) const
 C++ version of gsl_vector_float_get(). More...
 
void set (size_t const i, float x)
 C++ version of gsl_vector_float_set(). More...
 
float * ptr (size_t const i)
 C++ version of gsl_vector_float_ptr(). More...
 
float const * const_ptr (size_t const i) const
 C++ version of gsl_vector_float_const_ptr(). More...
 
int fread (FILE *stream)
 C++ version of gsl_vector_float_fread(). More...
 
int fwrite (FILE *stream) const
 C++ version of gsl_vector_float_fwrite(). More...
 
int fscanf (FILE *stream)
 C++ version of gsl_vector_float_fscanf(). More...
 
int fprintf (FILE *stream, char const *format) const
 C++ version of gsl_vector_float_fprintf(). More...
 
 vector_float (block_float &b, size_t const offset, size_t const n, size_t const stride=1)
 C++ version of gsl_vector_float_alloc_from_block(). More...
 
 vector_float (vector_float &v, size_t const offset, size_t const n, size_t const stride=1)
 C++ version of gsl_vector_float_alloc_from_vector(). More...
 
vector_float subvector (size_t i, size_t n)
 C++ version of gsl_vector_float_subvector(). More...
 
vector_float subvector_with_stride (size_t i, size_t stride, size_t n)
 C++ version of gsl_vector_float_subvector_with_stride(). More...
 
vector_float const const_subvector (size_t i, size_t n) const
 C++ version of gsl_vector_float_const_subvector(). More...
 
vector_float const const_subvector_with_stride (size_t i, size_t stride, size_t n) const
 C++ version of gsl_vector_float_const_subvector_with_stride(). More...
 

Static Public Member Functions

static vector_float calloc (size_t const n)
 C++ version of gsl_vector_float_calloc(). More...
 
static vector_float view_array (float *v, size_t n)
 C++ version of gsl_vector_float_view_array(). More...
 
static vector_float view_array_with_stride (float *base, size_t stride, size_t n)
 C++ version of gsl_vector_float_view_array_with_stride(). More...
 
static vector_float const const_view_array (float const *v, size_t n)
 C++ version of gsl_vector_float _const_view_array(). More...
 
static vector_float const const_view_array_with_stride (float const *base, size_t stride, size_t n)
 C++ version of gsl_vector_float_const_view_array_with_stride(). More...
 
template<typename ARRAY >
static vector_float view_array (ARRAY &v, size_t n=0)
 C++ version of gsl_vector_float_view_array(). More...
 
template<typename ARRAY >
static vector_float view_array_with_stride (ARRAY &base, size_t stride, size_t n=0)
 C++ version of gsl_vector_float_view_array_with_stride(). More...
 
template<typename ARRAY >
static vector_float const const_view_array (ARRAY const &v, size_t n=0)
 C++ version of gsl_vector_float _const_view_array(). More...
 
template<typename ARRAY >
static vector_float const const_view_array_with_stride (ARRAY const &base, size_t stride, size_t n=0)
 C++ version of gsl_vector_float_const_view_array_with_stride(). More...
 
static vector_float alloc_row_from_matrix (matrix_float &m, size_t const i)
 C++ version of gsl_vector_float_alloc_row_from_matrix(). More...
 
static vector_float alloc_col_from_matrix (matrix_float &m, size_t const j)
 C++ version of gsl_vector_float_alloc_col_from_matrix(). More...
 

Private Attributes

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

Detailed Description

This class handles vector_float objects as shared handles.

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

Note that vector_float_views are implemented as vector_float objects here.

If you want to use a std::vector<float> or similar object as if it were a gsl::vector_float object, use the constructor that takes a stride argument. But use it with caution. Changing the size of the original object does not change the size of the gsl::vector_float object; so it may be safer to create gsl::vector_float objects in this way as needed.

Definition at line 45 of file vector_float.hpp.

Member Typedef Documentation

◆ const_iterator

The const_iterator type.

Definition at line 1066 of file vector_float.hpp.

◆ const_pointer

A container must have a constant pointer type.

Definition at line 398 of file vector_float.hpp.

◆ const_reference

A container must have a constant reference type.

Definition at line 388 of file vector_float.hpp.

◆ const_reverse_iterator

The const_reverse_t type.

Definition at line 1074 of file vector_float.hpp.

◆ difference_type

A container must have a difference_type.

Definition at line 1083 of file vector_float.hpp.

◆ iterator

The iterator type.

Definition at line 1070 of file vector_float.hpp.

◆ pointer

A container must have a pointer type.

Definition at line 393 of file vector_float.hpp.

◆ reference

A container must have a reference type.

Definition at line 383 of file vector_float.hpp.

◆ reverse_iterator

The reverse_iterator type.

Definition at line 1078 of file vector_float.hpp.

◆ size_type

A container must have a size_type.

Definition at line 1088 of file vector_float.hpp.

◆ value_type

A container must have a value_type.

Definition at line 378 of file vector_float.hpp.

Constructor & Destructor Documentation

◆ vector_float() [1/10]

gsl::vector_float::vector_float ( )
inline

◆ vector_float() [2/10]

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

The default constructor creates a new vector_float with n elements.

Parameters
nThe number of elements in the vector_float

Definition at line 61 of file vector_float.hpp.

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

◆ vector_float() [3/10]

gsl::vector_float::vector_float ( gsl_vector_float *  v)
inlineexplicit

Could construct from a gsl_vector_float.

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

Parameters
vThe vector_float

Definition at line 99 of file vector_float.hpp.

References ccgsl_pointer, and count.

◆ vector_float() [4/10]

gsl::vector_float::vector_float ( std::initializer_list< float >  initializer_list)
inline

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

Parameters
initializer_listThe initializer_list.

Definition at line 111 of file vector_float.hpp.

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

◆ vector_float() [5/10]

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

The copy constructor.

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

Parameters
vThe vector_float to copy.

Definition at line 132 of file vector_float.hpp.

References count.

◆ vector_float() [6/10]

gsl::vector_float::vector_float ( vector_float v)
inline

The copy constructor.

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

Parameters
vThe vector_float to copy.

Definition at line 140 of file vector_float.hpp.

References count.

◆ vector_float() [7/10]

template<typename V >
gsl::vector_float::vector_float ( V &  v,
size_t const  stride = 1 
)
inline

Construct from an object that implements data() and size().

This is primarily intended to allow you to construct from a std::vector<float> or std::array<float,size_t> object. But it could be used to construct a subvector. This constructor shares the data with the original object. But the price of efficiency is safety. If you change the size of v the size of the gsl::vector_float does not change. Stride is normally set to 1 and allows us to define a constructor. But it can be set to another value to indicate, for example, that you only wish every second element to be included in this.

Parameters
vThe object that you want this to share data with.
strideThe stride.

Definition at line 176 of file vector_float.hpp.

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

◆ ~vector_float()

gsl::vector_float::~vector_float ( )
inline

The destructor only deletes the pointers if count reaches zero.

Definition at line 210 of file vector_float.hpp.

References ccgsl_pointer, count, and owns_data.

◆ vector_float() [8/10]

gsl::vector_float::vector_float ( vector_float &&  v)
inline

Move constructor.

Parameters
vThe vector_float to move.

Definition at line 270 of file vector_float.hpp.

References count.

◆ vector_float() [9/10]

gsl::vector_float::vector_float ( block_float b,
size_t const  offset,
size_t const  n,
size_t const  stride = 1 
)
inline

C++ version of gsl_vector_float_alloc_from_block().

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

Definition at line 1517 of file vector_float.hpp.

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

◆ vector_float() [10/10]

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

C++ version of gsl_vector_float_alloc_from_vector().

Parameters
vThe vector_float
offsetThe offset
nThe number of elements
strideThe stride

Definition at line 1534 of file vector_float.hpp.

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

Member Function Documentation

◆ add()

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

C++ version of gsl_vector_float_add().

Parameters
bvector_float to add to this
Returns
error code on failure

Definition at line 1392 of file vector_float.hpp.

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

◆ add_constant()

int gsl::vector_float::add_constant ( float const  x)
inline

C++ version of gsl_vector_float_add_constant().

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

Definition at line 1422 of file vector_float.hpp.

References get().

◆ alloc_col_from_matrix()

static vector_float gsl::vector_float::alloc_col_from_matrix ( matrix_float m,
size_t const  j 
)
static

C++ version of gsl_vector_float_alloc_col_from_matrix().

Parameters
mA matrix_float
jA column
Returns
A vector_float

◆ alloc_row_from_matrix()

static vector_float gsl::vector_float::alloc_row_from_matrix ( matrix_float m,
size_t const  i 
)
static

C++ version of gsl_vector_float_alloc_row_from_matrix().

Parameters
mA matrix_float
iA row
Returns
A vector_float

◆ axpby()

int gsl::vector_float::axpby ( float const  alpha,
vector_float const &  x,
float const  beta 
)
inline

C++ version of gsl_vector_float_axpby().

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

Definition at line 1430 of file vector_float.hpp.

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

◆ begin() [1/2]

iterator gsl::vector_float::begin ( )
inline

Get iterator pointing to first vector_float element.

Returns
iterator pointing to first vector_float element

Definition at line 1094 of file vector_float.hpp.

Referenced by vector_float().

◆ begin() [2/2]

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

Get iterator pointing to first vector_float element.

Returns
iterator pointing to first vector_float element

Definition at line 1101 of file vector_float.hpp.

◆ calloc()

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

C++ version of gsl_vector_float_calloc().

This constructs a vector_float object with entries initialised to zero.

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

Definition at line 1311 of file vector_float.hpp.

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

◆ clone()

vector_float gsl::vector_float::clone ( ) const
inline

The clone function.

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

Returns
a new copy of this.

Definition at line 199 of file vector_float.hpp.

References get(), and size().

◆ const_ptr()

float const * gsl::vector_float::const_ptr ( size_t const  i) const
inline

C++ version of gsl_vector_float_const_ptr().

Parameters
iindex of element to get
Returns
pointer to element

Definition at line 1483 of file vector_float.hpp.

References get().

◆ const_subvector()

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

C++ version of gsl_vector_float_const_subvector().

Parameters
iThe offset
nThe size
Returns
A subvector

Definition at line 1662 of file vector_float.hpp.

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

◆ const_subvector_with_stride()

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

C++ version of gsl_vector_float_const_subvector_with_stride().

Parameters
iThe offset
strideThe stride
nThe size
Returns
A subvector

Definition at line 1676 of file vector_float.hpp.

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

◆ const_view_array() [1/2]

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

C++ version of gsl_vector_float _const_view_array().

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

Definition at line 1758 of file vector_float.hpp.

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

◆ const_view_array() [2/2]

static vector_float const gsl::vector_float::const_view_array ( float const *  v,
size_t  n 
)
inlinestatic

C++ version of gsl_vector_float _const_view_array().

Parameters
vAn array of type float
nThe size of the vector_float
Returns
A vector_float

Definition at line 1577 of file vector_float.hpp.

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

◆ const_view_array_with_stride() [1/2]

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

C++ version of gsl_vector_float_const_view_array_with_stride().

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

Definition at line 1777 of file vector_float.hpp.

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

◆ const_view_array_with_stride() [2/2]

static vector_float const gsl::vector_float::const_view_array_with_stride ( float const *  base,
size_t  stride,
size_t  n 
)
inlinestatic

C++ version of gsl_vector_float_const_view_array_with_stride().

Parameters
baseAn array of type float
strideThe stride
nThe size of the vector_float
Returns
A vector_float

Definition at line 1591 of file vector_float.hpp.

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

Referenced by gsl::vector_complex_float::const_imag(), gsl::vector_complex_float::const_real(), gsl::vector_complex_float::imag(), and gsl::vector_complex_float::real().

◆ data() [1/2]

float * gsl::vector_float::data ( )
inline

Give access to the data block_float.

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_float stride is not 1. However, new vector_float objects are always initialised to have a stride of 1.

Returns
The data block_float.

Definition at line 1134 of file vector_float.hpp.

References ccgsl_pointer.

Referenced by gsl::fft::halfcomplex_float::unpack(), and gsl::fft::real_float::unpack().

◆ data() [2/2]

float const * gsl::vector_float::data ( ) const
inline

Give access to the data block_float.

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_float stride is not 1. However, new vector_float objects are always initialised to have a stride of 1.

Returns
The data block_float.

Definition at line 1148 of file vector_float.hpp.

References ccgsl_pointer.

◆ div()

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

C++ version of gsl_vector_float_div().

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

Definition at line 1410 of file vector_float.hpp.

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

◆ empty()

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

Find if the vector_float is empty.

Returns
true if has size zero; otherwise false

Definition at line 1167 of file vector_float.hpp.

References ccgsl_pointer.

◆ end() [1/2]

iterator gsl::vector_float::end ( )
inline

Get iterator pointing beyond last vector_float element.

Returns
iterator pointing beyond last vector_float element

Definition at line 1109 of file vector_float.hpp.

References ccgsl_pointer, and size().

◆ end() [2/2]

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

Get iterator pointing beyond last vector_float element.

Returns
iterator pointing beyond last vector_float element

Definition at line 1117 of file vector_float.hpp.

References ccgsl_pointer, and size().

◆ fprintf()

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

C++ version of gsl_vector_float_fprintf().

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

Definition at line 1508 of file vector_float.hpp.

References get().

◆ fread()

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

C++ version of gsl_vector_float_fread().

Parameters
streamA C file stream
Returns
error code on failure

Definition at line 1489 of file vector_float.hpp.

References get().

◆ fscanf()

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

C++ version of gsl_vector_float_fscanf().

Parameters
streamA C file stream
Returns
error code on failure

Definition at line 1501 of file vector_float.hpp.

References get().

◆ fwrite()

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

C++ version of gsl_vector_float_fwrite().

Parameters
streamA C file stream
Returns
error code on failure

Definition at line 1495 of file vector_float.hpp.

References get().

◆ get() [1/3]

◆ get() [2/3]

gsl_vector_float const * gsl::vector_float::get ( ) const
inline

Get the gsl_vector_float.

Returns
the gsl_vector_float

Definition at line 1282 of file vector_float.hpp.

References ccgsl_pointer.

◆ get() [3/3]

float gsl::vector_float::get ( size_t const  i) const
inline

C++ version of gsl_vector_float_get().

Parameters
iindex of element to get
Returns
value of element

Definition at line 1465 of file vector_float.hpp.

References get().

Referenced by get().

◆ isneg()

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

C++ version of gsl_vector_float_isneg().

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

Definition at line 1454 of file vector_float.hpp.

References get().

◆ isnonneg()

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

C++ version of gsl_vector_float_isnonneg().

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

Definition at line 1459 of file vector_float.hpp.

References get().

◆ isnull()

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

C++ version of gsl_vector_float_isnull().

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

Definition at line 1444 of file vector_float.hpp.

References get().

◆ ispos()

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

C++ version of gsl_vector_float_ispos().

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

Definition at line 1449 of file vector_float.hpp.

References get().

◆ max()

float gsl::vector_float::max ( ) const
inline

C++ version of gsl_vector_float_max().

Returns
maximum element of vector_float

Definition at line 1350 of file vector_float.hpp.

References get().

◆ max_index()

size_t gsl::vector_float::max_index ( ) const
inline

C++ version of gsl_vector_float_max_index().

Returns
index of maximum value of vector_float

Definition at line 1374 of file vector_float.hpp.

References get().

◆ max_size()

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

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

Identical to size but required for a container.

Returns
The size of the vector_float

Definition at line 1161 of file vector_float.hpp.

References ccgsl_pointer.

◆ memcpy()

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

C++ version of gsl_vector_float_memcpy().

Parameters
srcsource vector_float
Returns
error code on failure

Definition at line 1332 of file vector_float.hpp.

References get().

◆ min()

float gsl::vector_float::min ( ) const
inline

C++ version of gsl_vector_float_min().

Returns
minimum element of vector_float

Definition at line 1355 of file vector_float.hpp.

References get().

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

◆ min_index()

size_t gsl::vector_float::min_index ( ) const
inline

C++ version of gsl_vector_float_min_index().

Returns
index of minimum value of vector_float

Definition at line 1379 of file vector_float.hpp.

References get().

◆ minmax() [1/2]

void gsl::vector_float::minmax ( float &  min_out,
float &  max_out 
) const
inline

C++ version of gsl_vector_float_minmax().

Parameters
min_outminimum element of vector_float
max_outmaximum element of vector_float

Definition at line 1368 of file vector_float.hpp.

References get().

◆ minmax() [2/2]

void gsl::vector_float::minmax ( float *  min_out,
float *  max_out 
) const
inline

C++ version of gsl_vector_float_minmax().

Parameters
min_outminimum element of vector_float
max_outmaximum element of vector_float

Definition at line 1361 of file vector_float.hpp.

References get().

◆ minmax_index()

void gsl::vector_float::minmax_index ( size_t *  imin,
size_t *  imax 
) const
inline

C++ version of gsl_vector_float_minmax_index().

Parameters
iminindex of minimum value of vector_float
imaxindex of maximum value of vector_float

Definition at line 1385 of file vector_float.hpp.

References get().

◆ mul()

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

C++ version of gsl_vector_float_mul().

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

Definition at line 1404 of file vector_float.hpp.

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

◆ operator bool()

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

Allow conversion to bool.

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

Definition at line 1302 of file vector_float.hpp.

References ccgsl_pointer.

◆ operator!=()

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

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

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

Definition at line 292 of file vector_float.hpp.

References operator==().

◆ operator<()

bool gsl::vector_float::operator< ( vector_float 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_float is nonnegative.

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

Definition at line 304 of file vector_float.hpp.

References ccgsl_pointer, min(), and size().

Referenced by operator<=().

◆ operator<=()

bool gsl::vector_float::operator<= ( vector_float 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_float is nonnegative.

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

Definition at line 358 of file vector_float.hpp.

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

◆ operator=() [1/2]

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

Move operator.

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

Definition at line 280 of file vector_float.hpp.

References vector_float().

◆ operator=() [2/2]

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

The assignment operator.

This makes a shared copy.

Parameters
vThe vector_float to copy

Definition at line 149 of file vector_float.hpp.

References ccgsl_pointer, count, and owns_data.

◆ operator==()

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

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

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

Definition at line 249 of file vector_float.hpp.

References ccgsl_pointer.

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

◆ operator>()

bool gsl::vector_float::operator> ( vector_float 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_float is nonnegative.

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

Definition at line 331 of file vector_float.hpp.

References ccgsl_pointer, min(), and size().

Referenced by operator>=().

◆ operator>=()

bool gsl::vector_float::operator>= ( vector_float 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_float is nonnegative.

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

Definition at line 370 of file vector_float.hpp.

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

◆ operator[]() [1/2]

float & gsl::vector_float::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 float

Definition at line 1217 of file vector_float.hpp.

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

◆ operator[]() [2/2]

float const & gsl::vector_float::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 float

Definition at line 1240 of file vector_float.hpp.

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

◆ ptr()

float * gsl::vector_float::ptr ( size_t const  i)
inline

C++ version of gsl_vector_float_ptr().

Parameters
iindex of element to get
Returns
pointer to element

Definition at line 1477 of file vector_float.hpp.

References get().

◆ rbegin() [1/2]

reverse_iterator gsl::vector_float::rbegin ( )
inline

Get iterator pointing to first vector_float element.

Returns
iterator pointing to first vector_float element

Definition at line 1184 of file vector_float.hpp.

References ccgsl_pointer, and size().

◆ rbegin() [2/2]

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

Get iterator pointing to first vector_float element.

Returns
iterator pointing to first vector_float element

Definition at line 1192 of file vector_float.hpp.

References ccgsl_pointer, and size().

◆ rend() [1/2]

reverse_iterator gsl::vector_float::rend ( )
inline

Get iterator pointing beyond last vector_float element.

Returns
iterator pointing beyond last vector_float element

Definition at line 1201 of file vector_float.hpp.

◆ rend() [2/2]

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

Get iterator pointing beyond last vector_float element.

Returns
iterator pointing beyond last vector_float element

Definition at line 1208 of file vector_float.hpp.

◆ reset()

void gsl::vector_float::reset ( )
inline

Stop sharing ownership of the shared pointer.

Definition at line 264 of file vector_float.hpp.

References vector_float().

◆ reverse()

int gsl::vector_float::reverse ( )
inline

C++ version of gsl_vector_float_reverse().

Returns
error code on failure

Definition at line 1337 of file vector_float.hpp.

References get().

◆ scale()

int gsl::vector_float::scale ( float const  x)
inline

C++ version of gsl_vector_float_scale().

Parameters
xconstant to multiply this by
Returns
error code on failure

Definition at line 1416 of file vector_float.hpp.

References get().

◆ set()

void gsl::vector_float::set ( size_t const  i,
float  x 
)
inline

C++ version of gsl_vector_float_set().

Parameters
iindex to set
xnew value for element

Definition at line 1471 of file vector_float.hpp.

References get().

◆ set_all()

void gsl::vector_float::set_all ( float  x)
inline

C++ version of gsl_vector_float_set_all().

Parameters
xThe value to which all elements are set

Definition at line 1320 of file vector_float.hpp.

References get().

◆ set_basis()

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

C++ version of gsl_vector_float_set_basis().

Creates a basis vector_float with one nonzero element.

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

Definition at line 1326 of file vector_float.hpp.

References get().

◆ set_zero()

void gsl::vector_float::set_zero ( )
inline

C++ version of gsl_vector_float_set_zero().

Definition at line 1315 of file vector_float.hpp.

References get().

◆ size()

size_type gsl::vector_float::size ( ) const
inline

The size (number of elements) of the vector_float.

Returns
The size of the vector_float

Definition at line 1126 of file vector_float.hpp.

References ccgsl_pointer.

Referenced by clone(), end(), operator<(), operator>(), operator[](), rbegin(), gsl::fft::halfcomplex_float::unpack(), and gsl::fft::real_float::unpack().

◆ sub()

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

C++ version of gsl_vector_float_sub().

Parameters
bvector_float to subtract from this
Returns
error code on failure

Definition at line 1398 of file vector_float.hpp.

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

◆ subvector()

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

C++ version of gsl_vector_float_subvector().

Parameters
iThe offset
nThe size
Returns
A subvector

Definition at line 1635 of file vector_float.hpp.

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

◆ subvector_with_stride()

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

C++ version of gsl_vector_float_subvector_with_stride().

Parameters
iThe offset
strideThe stride
nThe size
Returns
A subvector

Definition at line 1649 of file vector_float.hpp.

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

◆ sum()

float gsl::vector_float::sum ( vector_float const &  a) const
inline

C++ version of gsl_vector_float_sum().

Parameters
aThe vector
Returns
The sum of the elements

Definition at line 1439 of file vector_float.hpp.

References gsl::sf::mathieu::a().

◆ swap()

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

Swap two vector_float objects.

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

Parameters
vThe vector_float to swap with this.

Definition at line 1174 of file vector_float.hpp.

References ccgsl_pointer, and count.

◆ swap_elements()

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

C++ version of gsl_vector_float_swap_elements().

Parameters
ifirst element
jsecond element
Returns
error code on failure

Definition at line 1344 of file vector_float.hpp.

References get().

◆ unique()

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

Find if this is the only object sharing the gsl_vector_float.

Returns
true or falses according as this is the only vector_float object sharing the gsl_vector_float

Definition at line 1288 of file vector_float.hpp.

References count.

◆ use_count()

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

Find how many vector_float objects share this pointer.

Returns
the number of vector_float objects that share this pointer

Definition at line 1293 of file vector_float.hpp.

References count.

◆ view_array() [1/2]

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

C++ version of gsl_vector_float_view_array().

Parameters
vAn array of float
nThe size of the vector_float: the default gives access to the whole array
Returns
A vector_float

Definition at line 1721 of file vector_float.hpp.

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

◆ view_array() [2/2]

static vector_float gsl::vector_float::view_array ( float *  v,
size_t  n 
)
inlinestatic

C++ version of gsl_vector_float_view_array().

Parameters
vAn array of type float
nThe size of the vector_float
Returns
A vector_float

Definition at line 1550 of file vector_float.hpp.

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

◆ view_array_with_stride() [1/2]

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

C++ version of gsl_vector_float_view_array_with_stride().

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

Definition at line 1740 of file vector_float.hpp.

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

◆ view_array_with_stride() [2/2]

static vector_float gsl::vector_float::view_array_with_stride ( float *  base,
size_t  stride,
size_t  n 
)
inlinestatic

C++ version of gsl_vector_float_view_array_with_stride().

Parameters
baseAn array of type float
strideThe stride
nThe size of the vector_float
Returns
A vector_float

Definition at line 1564 of file vector_float.hpp.

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

Referenced by gsl::vector_complex_float::imag(), and gsl::vector_complex_float::real().

◆ wrap_gsl_vector_float_without_ownership()

void gsl::vector_float::wrap_gsl_vector_float_without_ownership ( gsl_vector_float *  v)
inline

This function is intended mainly for internal use.

It allows this to point to a gsl_vector_float 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_float* argument to one that takes a gsl_vector_float* argument.

Parameters
vThe gsl_vector_float

Definition at line 229 of file vector_float.hpp.

References ccgsl_pointer, count, and owns_data.

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

Member Data Documentation

◆ ccgsl_pointer

◆ count

size_t* gsl::vector_float::count
private

The shared reference count.

Definition at line 1270 of file vector_float.hpp.

Referenced by operator=(), swap(), unique(), use_count(), vector_float(), wrap_gsl_vector_float_without_ownership(), and ~vector_float().

◆ owns_data

bool gsl::vector_float::owns_data
private

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

Definition at line 1262 of file vector_float.hpp.

Referenced by operator=(), vector_float(), wrap_gsl_vector_float_without_ownership(), and ~vector_float().


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