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

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

#include <vector_uchar.hpp>

Inheritance diagram for gsl::vector_uchar:
Inheritance graph
Collaboration diagram for gsl::vector_uchar:
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 unsigned char 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_uchar ()
 The default constructor is only really useful for assigning to. More...
 
 vector_uchar (size_t const n)
 The default constructor creates a new vector_uchar with n elements. More...
 
 vector_uchar (gsl_vector_uchar *v)
 Could construct from a gsl_vector_uchar. More...
 
 vector_uchar (std::initializer_list< unsigned char > initializer_list)
 Could construct from a std::initializer_list in C++11. More...
 
 vector_uchar (vector_uchar const &v)
 The copy constructor. More...
 
 vector_uchar (vector_uchar &v)
 The copy constructor. More...
 
vector_ucharoperator= (vector_uchar const &v)
 The assignment operator. More...
 
template<typename V >
 vector_uchar (V &v, size_t const stride=1)
 Construct from an object that implements data() and size(). More...
 
vector_uchar clone () const
 The clone function. More...
 
 ~vector_uchar ()
 The destructor only deletes the pointers if count reaches zero. More...
 
void wrap_gsl_vector_uchar_without_ownership (gsl_vector_uchar *v)
 This function is intended mainly for internal use. More...
 
bool operator== (vector_uchar const &v) const
 Two vector_uchar objects are identically equal if their elements are identical. More...
 
void reset ()
 Stop sharing ownership of the shared pointer. More...
 
 vector_uchar (vector_uchar &&v)
 Move constructor. More...
 
vector_ucharoperator= (vector_uchar &&v)
 Move operator. More...
 
bool operator!= (vector_uchar const &v) const
 Two vector_uchar objects are different equal if their elements are not identical. More...
 
bool operator< (vector_uchar const &v) const
 A container needs to define an ordering for sorting. More...
 
bool operator> (vector_uchar const &v) const
 A container needs to define an ordering for sorting. More...
 
bool operator<= (vector_uchar const &v) const
 A container needs to define an ordering for sorting. More...
 
bool operator>= (vector_uchar const &v) const
 A container needs to define an ordering for sorting. More...
 
iterator begin ()
 Get iterator pointing to first vector_uchar element. More...
 
const_iterator begin () const
 Get iterator pointing to first vector_uchar element. More...
 
iterator end ()
 Get iterator pointing beyond last vector_uchar element. More...
 
const_iterator end () const
 Get iterator pointing beyond last vector_uchar element. More...
 
size_type size () const
 The size (number of elements) of the vector_uchar. More...
 
unsigned char * data ()
 Give access to the data block_uchar. More...
 
unsigned char const * data () const
 Give access to the data block_uchar. More...
 
size_type max_size () const
 The max size (number of elements) of the vector_uchar. More...
 
bool empty () const
 Find if the vector_uchar is empty. More...
 
void swap (vector_uchar &v)
 Swap two vector_uchar objects. More...
 
reverse_iterator rbegin ()
 Get iterator pointing to first vector_uchar element. More...
 
const_reverse_iterator rbegin () const
 Get iterator pointing to first vector_uchar element. More...
 
reverse_iterator rend ()
 Get iterator pointing beyond last vector_uchar element. More...
 
const_reverse_iterator rend () const
 Get iterator pointing beyond last vector_uchar element. More...
 
unsigned char & operator[] (size_t const n)
 Get element at position n by reference ([] operator). More...
 
unsigned char const & operator[] (size_t const n) const
 Get element at position n by reference ([] operator). More...
 
gsl_vector_uchar * get ()
 Get the gsl_vector_uchar. More...
 
gsl_vector_uchar const * get () const
 Get the gsl_vector_uchar. More...
 
bool unique () const
 Find if this is the only object sharing the gsl_vector_uchar. More...
 
size_t use_count () const
 Find how many vector_uchar objects share this pointer. More...
 
 operator bool () const
 Allow conversion to bool. More...
 
void set_zero ()
 C++ version of gsl_vector_uchar_set_zero(). More...
 
void set_all (unsigned char x)
 C++ version of gsl_vector_uchar_set_all(). More...
 
int set_basis (size_t i)
 C++ version of gsl_vector_uchar_set_basis(). More...
 
int memcpy (vector_uchar const &src)
 C++ version of gsl_vector_uchar_memcpy(). More...
 
int reverse ()
 C++ version of gsl_vector_uchar_reverse(). More...
 
int swap_elements (size_t const i, size_t const j)
 C++ version of gsl_vector_uchar_swap_elements(). More...
 
unsigned char max () const
 C++ version of gsl_vector_uchar_max(). More...
 
unsigned char min () const
 C++ version of gsl_vector_uchar_min(). More...
 
void minmax (unsigned char *min_out, unsigned char *max_out) const
 C++ version of gsl_vector_uchar_minmax(). More...
 
void minmax (unsigned char &min_out, unsigned char &max_out) const
 C++ version of gsl_vector_uchar_minmax(). More...
 
size_t max_index () const
 C++ version of gsl_vector_uchar_max_index(). More...
 
size_t min_index () const
 C++ version of gsl_vector_uchar_min_index(). More...
 
void minmax_index (size_t *imin, size_t *imax) const
 C++ version of gsl_vector_uchar_minmax_index(). More...
 
int add (vector_uchar const &b)
 C++ version of gsl_vector_uchar_add(). More...
 
int sub (vector_uchar const &b)
 C++ version of gsl_vector_uchar_sub(). More...
 
int mul (vector_uchar const &b)
 C++ version of gsl_vector_uchar_mul(). More...
 
int div (vector_uchar const &b)
 C++ version of gsl_vector_uchar_div(). More...
 
int scale (unsigned char const x)
 C++ version of gsl_vector_uchar_scale(). More...
 
int add_constant (unsigned char const x)
 C++ version of gsl_vector_uchar_add_constant(). More...
 
int axpby (unsigned char const alpha, vector_uchar const &x, unsigned char const beta)
 C++ version of gsl_vector_uchar_axpby(). More...
 
unsigned char sum (vector_uchar const &a) const
 C++ version of gsl_vector_uchar_sum(). More...
 
int isnull () const
 C++ version of gsl_vector_uchar_isnull(). More...
 
int ispos () const
 C++ version of gsl_vector_uchar_ispos(). More...
 
int isneg () const
 C++ version of gsl_vector_uchar_isneg(). More...
 
int isnonneg () const
 C++ version of gsl_vector_uchar_isnonneg(). More...
 
unsigned char get (size_t const i) const
 C++ version of gsl_vector_uchar_get(). More...
 
void set (size_t const i, unsigned char x)
 C++ version of gsl_vector_uchar_set(). More...
 
unsigned char * ptr (size_t const i)
 C++ version of gsl_vector_uchar_ptr(). More...
 
unsigned char const * const_ptr (size_t const i) const
 C++ version of gsl_vector_uchar_const_ptr(). More...
 
int fread (FILE *stream)
 C++ version of gsl_vector_uchar_fread(). More...
 
int fwrite (FILE *stream) const
 C++ version of gsl_vector_uchar_fwrite(). More...
 
int fscanf (FILE *stream)
 C++ version of gsl_vector_uchar_fscanf(). More...
 
int fprintf (FILE *stream, char const *format) const
 C++ version of gsl_vector_uchar_fprintf(). More...
 
 vector_uchar (block_uchar &b, size_t const offset, size_t const n, size_t const stride=1)
 C++ version of gsl_vector_uchar_alloc_from_block(). More...
 
 vector_uchar (vector_uchar &v, size_t const offset, size_t const n, size_t const stride=1)
 C++ version of gsl_vector_uchar_alloc_from_vector(). More...
 
vector_uchar subvector (size_t i, size_t n)
 C++ version of gsl_vector_uchar_subvector(). More...
 
vector_uchar subvector_with_stride (size_t i, size_t stride, size_t n)
 C++ version of gsl_vector_uchar_subvector_with_stride(). More...
 
vector_uchar const const_subvector (size_t i, size_t n) const
 C++ version of gsl_vector_uchar_const_subvector(). More...
 
vector_uchar const const_subvector_with_stride (size_t i, size_t stride, size_t n) const
 C++ version of gsl_vector_uchar_const_subvector_with_stride(). More...
 

Static Public Member Functions

static vector_uchar calloc (size_t const n)
 C++ version of gsl_vector_uchar_calloc(). More...
 
static vector_uchar view_array (unsigned char *v, size_t n)
 C++ version of gsl_vector_uchar_view_array(). More...
 
static vector_uchar view_array_with_stride (unsigned char *base, size_t stride, size_t n)
 C++ version of gsl_vector_uchar_view_array_with_stride(). More...
 
static vector_uchar const const_view_array (unsigned char const *v, size_t n)
 C++ version of gsl_vector_uchar _const_view_array(). More...
 
static vector_uchar const const_view_array_with_stride (unsigned char const *base, size_t stride, size_t n)
 C++ version of gsl_vector_uchar_const_view_array_with_stride(). More...
 
template<typename ARRAY >
static vector_uchar view_array (ARRAY &v, size_t n=0)
 C++ version of gsl_vector_uchar_view_array(). More...
 
template<typename ARRAY >
static vector_uchar view_array_with_stride (ARRAY &base, size_t stride, size_t n=0)
 C++ version of gsl_vector_uchar_view_array_with_stride(). More...
 
template<typename ARRAY >
static vector_uchar const const_view_array (ARRAY const &v, size_t n=0)
 C++ version of gsl_vector_uchar _const_view_array(). More...
 
template<typename ARRAY >
static vector_uchar const const_view_array_with_stride (ARRAY const &base, size_t stride, size_t n=0)
 C++ version of gsl_vector_uchar_const_view_array_with_stride(). More...
 
static vector_uchar alloc_row_from_matrix (matrix_uchar &m, size_t const i)
 C++ version of gsl_vector_uchar_alloc_row_from_matrix(). More...
 
static vector_uchar alloc_col_from_matrix (matrix_uchar &m, size_t const j)
 C++ version of gsl_vector_uchar_alloc_col_from_matrix(). More...
 

Private Attributes

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

Detailed Description

This class handles vector_uchar objects as shared handles.

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

Note that vector_uchar_views are implemented as vector_uchar objects here.

If you want to use a std::vector<unsigned char> or similar object as if it were a gsl::vector_uchar 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_uchar object; so it may be safer to create gsl::vector_uchar objects in this way as needed.

Definition at line 45 of file vector_uchar.hpp.

Member Typedef Documentation

◆ const_iterator

The const_iterator type.

Definition at line 1062 of file vector_uchar.hpp.

◆ const_pointer

A container must have a constant pointer type.

Definition at line 394 of file vector_uchar.hpp.

◆ const_reference

A container must have a constant reference type.

Definition at line 384 of file vector_uchar.hpp.

◆ const_reverse_iterator

The const_reverse_t type.

Definition at line 1070 of file vector_uchar.hpp.

◆ difference_type

A container must have a difference_type.

Definition at line 1079 of file vector_uchar.hpp.

◆ iterator

The iterator type.

Definition at line 1066 of file vector_uchar.hpp.

◆ pointer

A container must have a pointer type.

Definition at line 389 of file vector_uchar.hpp.

◆ reference

A container must have a reference type.

Definition at line 379 of file vector_uchar.hpp.

◆ reverse_iterator

The reverse_iterator type.

Definition at line 1074 of file vector_uchar.hpp.

◆ size_type

A container must have a size_type.

Definition at line 1084 of file vector_uchar.hpp.

◆ value_type

typedef unsigned char gsl::vector_uchar::value_type

A container must have a value_type.

Definition at line 374 of file vector_uchar.hpp.

Constructor & Destructor Documentation

◆ vector_uchar() [1/10]

gsl::vector_uchar::vector_uchar ( )
inline

The default constructor is only really useful for assigning to.

Definition at line 50 of file vector_uchar.hpp.

References ccgsl_pointer, and count.

◆ vector_uchar() [2/10]

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

The default constructor creates a new vector_uchar with n elements.

Parameters
nThe number of elements in the vector_uchar

Definition at line 60 of file vector_uchar.hpp.

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

◆ vector_uchar() [3/10]

gsl::vector_uchar::vector_uchar ( gsl_vector_uchar *  v)
inlineexplicit

Could construct from a gsl_vector_uchar.

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

Parameters
vThe vector_uchar

Definition at line 98 of file vector_uchar.hpp.

◆ vector_uchar() [4/10]

gsl::vector_uchar::vector_uchar ( std::initializer_list< unsigned char >  initializer_list)
inline

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

Parameters
initializer_listThe initializer_list.

Definition at line 109 of file vector_uchar.hpp.

References gsl::rstat::n().

◆ vector_uchar() [5/10]

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

The copy constructor.

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

Parameters
vThe vector_uchar to copy.

Definition at line 130 of file vector_uchar.hpp.

◆ vector_uchar() [6/10]

gsl::vector_uchar::vector_uchar ( vector_uchar v)
inline

The copy constructor.

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

Parameters
vThe vector_uchar to copy.

Definition at line 137 of file vector_uchar.hpp.

◆ vector_uchar() [7/10]

template<typename V >
gsl::vector_uchar::vector_uchar ( 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<unsigned char> or std::array<unsigned char,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_uchar 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 173 of file vector_uchar.hpp.

References gsl::rstat::n().

◆ ~vector_uchar()

gsl::vector_uchar::~vector_uchar ( )
inline

The destructor only deletes the pointers if count reaches zero.

Definition at line 207 of file vector_uchar.hpp.

◆ vector_uchar() [8/10]

gsl::vector_uchar::vector_uchar ( vector_uchar &&  v)
inline

Move constructor.

Parameters
vThe vector_uchar to move.

Definition at line 267 of file vector_uchar.hpp.

◆ vector_uchar() [9/10]

gsl::vector_uchar::vector_uchar ( block_uchar b,
size_t const  offset,
size_t const  n,
size_t const  stride = 1 
)
inline

C++ version of gsl_vector_uchar_alloc_from_block().

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

Definition at line 1513 of file vector_uchar.hpp.

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

◆ vector_uchar() [10/10]

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

C++ version of gsl_vector_uchar_alloc_from_vector().

Parameters
vThe vector_uchar
offsetThe offset
nThe number of elements
strideThe stride

Definition at line 1530 of file vector_uchar.hpp.

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

Member Function Documentation

◆ add()

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

C++ version of gsl_vector_uchar_add().

Parameters
bvector_uchar to add to this
Returns
error code on failure

Definition at line 1388 of file vector_uchar.hpp.

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

◆ add_constant()

int gsl::vector_uchar::add_constant ( unsigned char const  x)
inline

C++ version of gsl_vector_uchar_add_constant().

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

Definition at line 1418 of file vector_uchar.hpp.

References gsl::rstat::quantile::get().

◆ alloc_col_from_matrix()

static vector_uchar gsl::vector_uchar::alloc_col_from_matrix ( matrix_uchar m,
size_t const  j 
)
static

C++ version of gsl_vector_uchar_alloc_col_from_matrix().

Parameters
mA matrix_uchar
jA column
Returns
A vector_uchar

◆ alloc_row_from_matrix()

static vector_uchar gsl::vector_uchar::alloc_row_from_matrix ( matrix_uchar m,
size_t const  i 
)
static

C++ version of gsl_vector_uchar_alloc_row_from_matrix().

Parameters
mA matrix_uchar
iA row
Returns
A vector_uchar

◆ axpby()

int gsl::vector_uchar::axpby ( unsigned char const  alpha,
vector_uchar const &  x,
unsigned char const  beta 
)
inline

C++ version of gsl_vector_uchar_axpby().

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

Definition at line 1426 of file vector_uchar.hpp.

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

◆ begin() [1/2]

iterator gsl::vector_uchar::begin ( )
inline

Get iterator pointing to first vector_uchar element.

Returns
iterator pointing to first vector_uchar element

Definition at line 1090 of file vector_uchar.hpp.

◆ begin() [2/2]

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

Get iterator pointing to first vector_uchar element.

Returns
iterator pointing to first vector_uchar element

Definition at line 1097 of file vector_uchar.hpp.

◆ calloc()

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

C++ version of gsl_vector_uchar_calloc().

This constructs a vector_uchar object with entries initialised to zero.

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

Definition at line 1307 of file vector_uchar.hpp.

References gsl::rstat::n().

◆ clone()

vector_uchar gsl::vector_uchar::clone ( ) const
inline

The clone function.

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

Returns
a new copy of this.

Definition at line 196 of file vector_uchar.hpp.

References get(), gsl::rstat::quantile::get(), and gsl::cheb::size().

◆ const_ptr()

unsigned char const * gsl::vector_uchar::const_ptr ( size_t const  i) const
inline

C++ version of gsl_vector_uchar_const_ptr().

Parameters
iindex of element to get
Returns
pointer to element

Definition at line 1479 of file vector_uchar.hpp.

References gsl::rstat::quantile::get().

◆ const_subvector()

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

C++ version of gsl_vector_uchar_const_subvector().

Parameters
iThe offset
nThe size
Returns
A subvector

Definition at line 1658 of file vector_uchar.hpp.

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

◆ const_subvector_with_stride()

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

C++ version of gsl_vector_uchar_const_subvector_with_stride().

Parameters
iThe offset
strideThe stride
nThe size
Returns
A subvector

Definition at line 1672 of file vector_uchar.hpp.

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

◆ const_view_array() [1/2]

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

C++ version of gsl_vector_uchar _const_view_array().

Parameters
vAn array of type unsigned char
nThe size of the vector_uchar: the default gives access to the whole array
Returns
A vector_uchar

Definition at line 1754 of file vector_uchar.hpp.

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

◆ const_view_array() [2/2]

static vector_uchar const gsl::vector_uchar::const_view_array ( unsigned char const *  v,
size_t  n 
)
inlinestatic

C++ version of gsl_vector_uchar _const_view_array().

Parameters
vAn array of type unsigned char
nThe size of the vector_uchar
Returns
A vector_uchar

Definition at line 1573 of file vector_uchar.hpp.

References gsl::rstat::n().

◆ const_view_array_with_stride() [1/2]

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

C++ version of gsl_vector_uchar_const_view_array_with_stride().

Parameters
baseAn array of type unsigned char
strideThe stride
nThe size of the vector_uchar: the default gives access to the whole array
Returns
A vector_uchar

Definition at line 1773 of file vector_uchar.hpp.

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

◆ const_view_array_with_stride() [2/2]

static vector_uchar const gsl::vector_uchar::const_view_array_with_stride ( unsigned char const *  base,
size_t  stride,
size_t  n 
)
inlinestatic

C++ version of gsl_vector_uchar_const_view_array_with_stride().

Parameters
baseAn array of type unsigned char
strideThe stride
nThe size of the vector_uchar
Returns
A vector_uchar

Definition at line 1587 of file vector_uchar.hpp.

References gsl::rstat::n().

◆ data() [1/2]

unsigned char * gsl::vector_uchar::data ( )
inline

Give access to the data block_uchar.

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

Returns
The data block_uchar.

Definition at line 1130 of file vector_uchar.hpp.

◆ data() [2/2]

unsigned char const * gsl::vector_uchar::data ( ) const
inline

Give access to the data block_uchar.

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

Returns
The data block_uchar.

Definition at line 1144 of file vector_uchar.hpp.

◆ div()

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

C++ version of gsl_vector_uchar_div().

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

Definition at line 1406 of file vector_uchar.hpp.

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

◆ empty()

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

Find if the vector_uchar is empty.

Returns
true if has size zero; otherwise false

Definition at line 1163 of file vector_uchar.hpp.

◆ end() [1/2]

iterator gsl::vector_uchar::end ( )
inline

Get iterator pointing beyond last vector_uchar element.

Returns
iterator pointing beyond last vector_uchar element

Definition at line 1105 of file vector_uchar.hpp.

References gsl::cheb::size().

◆ end() [2/2]

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

Get iterator pointing beyond last vector_uchar element.

Returns
iterator pointing beyond last vector_uchar element

Definition at line 1113 of file vector_uchar.hpp.

References gsl::cheb::size().

◆ fprintf()

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

C++ version of gsl_vector_uchar_fprintf().

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

Definition at line 1504 of file vector_uchar.hpp.

References gsl::rstat::quantile::get().

◆ fread()

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

C++ version of gsl_vector_uchar_fread().

Parameters
streamA C file stream
Returns
error code on failure

Definition at line 1485 of file vector_uchar.hpp.

References gsl::rstat::quantile::get().

◆ fscanf()

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

C++ version of gsl_vector_uchar_fscanf().

Parameters
streamA C file stream
Returns
error code on failure

Definition at line 1497 of file vector_uchar.hpp.

References gsl::rstat::quantile::get().

◆ fwrite()

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

C++ version of gsl_vector_uchar_fwrite().

Parameters
streamA C file stream
Returns
error code on failure

Definition at line 1491 of file vector_uchar.hpp.

References gsl::rstat::quantile::get().

◆ get() [1/3]

◆ get() [2/3]

gsl_vector_uchar const * gsl::vector_uchar::get ( ) const
inline

Get the gsl_vector_uchar.

Returns
the gsl_vector_uchar

Definition at line 1278 of file vector_uchar.hpp.

◆ get() [3/3]

unsigned char gsl::vector_uchar::get ( size_t const  i) const
inline

C++ version of gsl_vector_uchar_get().

Parameters
iindex of element to get
Returns
value of element

Definition at line 1461 of file vector_uchar.hpp.

References get().

Referenced by get().

◆ isneg()

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

C++ version of gsl_vector_uchar_isneg().

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

Definition at line 1450 of file vector_uchar.hpp.

References gsl::rstat::quantile::get().

◆ isnonneg()

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

C++ version of gsl_vector_uchar_isnonneg().

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

Definition at line 1455 of file vector_uchar.hpp.

References gsl::rstat::quantile::get().

◆ isnull()

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

C++ version of gsl_vector_uchar_isnull().

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

Definition at line 1440 of file vector_uchar.hpp.

References gsl::rstat::quantile::get().

◆ ispos()

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

C++ version of gsl_vector_uchar_ispos().

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

Definition at line 1445 of file vector_uchar.hpp.

References gsl::rstat::quantile::get().

◆ max()

unsigned char gsl::vector_uchar::max ( ) const
inline

C++ version of gsl_vector_uchar_max().

Returns
maximum element of vector_uchar

Definition at line 1346 of file vector_uchar.hpp.

References gsl::rstat::quantile::get().

◆ max_index()

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

C++ version of gsl_vector_uchar_max_index().

Returns
index of maximum value of vector_uchar

Definition at line 1370 of file vector_uchar.hpp.

References gsl::rstat::quantile::get().

◆ max_size()

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

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

Identical to size but required for a container.

Returns
The size of the vector_uchar

Definition at line 1157 of file vector_uchar.hpp.

◆ memcpy()

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

C++ version of gsl_vector_uchar_memcpy().

Parameters
srcsource vector_uchar
Returns
error code on failure

Definition at line 1328 of file vector_uchar.hpp.

References get(), and gsl::rstat::quantile::get().

◆ min()

unsigned char gsl::vector_uchar::min ( ) const
inline

C++ version of gsl_vector_uchar_min().

Returns
minimum element of vector_uchar

Definition at line 1351 of file vector_uchar.hpp.

References gsl::rstat::quantile::get().

◆ min_index()

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

C++ version of gsl_vector_uchar_min_index().

Returns
index of minimum value of vector_uchar

Definition at line 1375 of file vector_uchar.hpp.

References gsl::rstat::quantile::get().

◆ minmax() [1/2]

void gsl::vector_uchar::minmax ( unsigned char &  min_out,
unsigned char &  max_out 
) const
inline

C++ version of gsl_vector_uchar_minmax().

Parameters
min_outminimum element of vector_uchar
max_outmaximum element of vector_uchar

Definition at line 1364 of file vector_uchar.hpp.

References gsl::rstat::quantile::get().

◆ minmax() [2/2]

void gsl::vector_uchar::minmax ( unsigned char *  min_out,
unsigned char *  max_out 
) const
inline

C++ version of gsl_vector_uchar_minmax().

Parameters
min_outminimum element of vector_uchar
max_outmaximum element of vector_uchar

Definition at line 1357 of file vector_uchar.hpp.

References gsl::rstat::quantile::get().

◆ minmax_index()

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

C++ version of gsl_vector_uchar_minmax_index().

Parameters
iminindex of minimum value of vector_uchar
imaxindex of maximum value of vector_uchar

Definition at line 1381 of file vector_uchar.hpp.

References gsl::rstat::quantile::get().

◆ mul()

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

C++ version of gsl_vector_uchar_mul().

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

Definition at line 1400 of file vector_uchar.hpp.

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

◆ operator bool()

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

Allow conversion to bool.

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

Definition at line 1298 of file vector_uchar.hpp.

◆ operator!=()

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

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

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

Definition at line 288 of file vector_uchar.hpp.

◆ operator<()

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

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

Definition at line 300 of file vector_uchar.hpp.

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

◆ operator<=()

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

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

Definition at line 354 of file vector_uchar.hpp.

◆ operator=() [1/2]

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

Move operator.

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

Definition at line 276 of file vector_uchar.hpp.

References swap().

◆ operator=() [2/2]

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

The assignment operator.

This makes a shared copy.

Parameters
vThe vector_uchar to copy

Definition at line 146 of file vector_uchar.hpp.

References ccgsl_pointer, count, and owns_data.

◆ operator==()

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

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

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

Definition at line 246 of file vector_uchar.hpp.

References ccgsl_pointer.

◆ operator>()

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

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

Definition at line 327 of file vector_uchar.hpp.

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

◆ operator>=()

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

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

Definition at line 366 of file vector_uchar.hpp.

◆ operator[]() [1/2]

unsigned char & gsl::vector_uchar::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 unsigned char

Definition at line 1213 of file vector_uchar.hpp.

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

◆ operator[]() [2/2]

unsigned char const & gsl::vector_uchar::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 unsigned char

Definition at line 1236 of file vector_uchar.hpp.

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

◆ ptr()

unsigned char * gsl::vector_uchar::ptr ( size_t const  i)
inline

C++ version of gsl_vector_uchar_ptr().

Parameters
iindex of element to get
Returns
pointer to element

Definition at line 1473 of file vector_uchar.hpp.

References gsl::rstat::quantile::get().

◆ rbegin() [1/2]

reverse_iterator gsl::vector_uchar::rbegin ( )
inline

Get iterator pointing to first vector_uchar element.

Returns
iterator pointing to first vector_uchar element

Definition at line 1180 of file vector_uchar.hpp.

References gsl::cheb::size().

◆ rbegin() [2/2]

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

Get iterator pointing to first vector_uchar element.

Returns
iterator pointing to first vector_uchar element

Definition at line 1188 of file vector_uchar.hpp.

References gsl::cheb::size().

◆ rend() [1/2]

reverse_iterator gsl::vector_uchar::rend ( )
inline

Get iterator pointing beyond last vector_uchar element.

Returns
iterator pointing beyond last vector_uchar element

Definition at line 1197 of file vector_uchar.hpp.

◆ rend() [2/2]

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

Get iterator pointing beyond last vector_uchar element.

Returns
iterator pointing beyond last vector_uchar element

Definition at line 1204 of file vector_uchar.hpp.

◆ reset()

void gsl::vector_uchar::reset ( )
inline

Stop sharing ownership of the shared pointer.

Definition at line 261 of file vector_uchar.hpp.

References swap().

◆ reverse()

int gsl::vector_uchar::reverse ( )
inline

C++ version of gsl_vector_uchar_reverse().

Returns
error code on failure

Definition at line 1333 of file vector_uchar.hpp.

References gsl::rstat::quantile::get().

◆ scale()

int gsl::vector_uchar::scale ( unsigned char const  x)
inline

C++ version of gsl_vector_uchar_scale().

Parameters
xconstant to multiply this by
Returns
error code on failure

Definition at line 1412 of file vector_uchar.hpp.

References gsl::rstat::quantile::get().

◆ set()

void gsl::vector_uchar::set ( size_t const  i,
unsigned char  x 
)
inline

C++ version of gsl_vector_uchar_set().

Parameters
iindex to set
xnew value for element

Definition at line 1467 of file vector_uchar.hpp.

References gsl::rstat::quantile::get().

◆ set_all()

void gsl::vector_uchar::set_all ( unsigned char  x)
inline

C++ version of gsl_vector_uchar_set_all().

Parameters
xThe value to which all elements are set

Definition at line 1316 of file vector_uchar.hpp.

References gsl::rstat::quantile::get().

◆ set_basis()

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

C++ version of gsl_vector_uchar_set_basis().

Creates a basis vector_uchar with one nonzero element.

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

Definition at line 1322 of file vector_uchar.hpp.

References gsl::rstat::quantile::get().

◆ set_zero()

void gsl::vector_uchar::set_zero ( )
inline

C++ version of gsl_vector_uchar_set_zero().

Definition at line 1311 of file vector_uchar.hpp.

References gsl::rstat::quantile::get().

◆ size()

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

The size (number of elements) of the vector_uchar.

Returns
The size of the vector_uchar

Definition at line 1122 of file vector_uchar.hpp.

◆ sub()

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

C++ version of gsl_vector_uchar_sub().

Parameters
bvector_uchar to subtract from this
Returns
error code on failure

Definition at line 1394 of file vector_uchar.hpp.

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

◆ subvector()

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

C++ version of gsl_vector_uchar_subvector().

Parameters
iThe offset
nThe size
Returns
A subvector

Definition at line 1631 of file vector_uchar.hpp.

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

◆ subvector_with_stride()

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

C++ version of gsl_vector_uchar_subvector_with_stride().

Parameters
iThe offset
strideThe stride
nThe size
Returns
A subvector

Definition at line 1645 of file vector_uchar.hpp.

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

◆ sum()

unsigned char gsl::vector_uchar::sum ( vector_uchar const &  a) const
inline

C++ version of gsl_vector_uchar_sum().

Parameters
aThe vector
Returns
The sum of the elements

Definition at line 1435 of file vector_uchar.hpp.

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

◆ swap()

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

Swap two vector_uchar objects.

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

Parameters
vThe vector_uchar to swap with this.

Definition at line 1170 of file vector_uchar.hpp.

References ccgsl_pointer, and count.

Referenced by operator=(), and reset().

◆ swap_elements()

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

C++ version of gsl_vector_uchar_swap_elements().

Parameters
ifirst element
jsecond element
Returns
error code on failure

Definition at line 1340 of file vector_uchar.hpp.

References gsl::rstat::quantile::get().

◆ unique()

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

Find if this is the only object sharing the gsl_vector_uchar.

Returns
true or falses according as this is the only vector_uchar object sharing the gsl_vector_uchar

Definition at line 1284 of file vector_uchar.hpp.

◆ use_count()

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

Find how many vector_uchar objects share this pointer.

Returns
the number of vector_uchar objects that share this pointer

Definition at line 1289 of file vector_uchar.hpp.

◆ view_array() [1/2]

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

C++ version of gsl_vector_uchar_view_array().

Parameters
vAn array of unsigned char
nThe size of the vector_uchar: the default gives access to the whole array
Returns
A vector_uchar

Definition at line 1717 of file vector_uchar.hpp.

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

◆ view_array() [2/2]

static vector_uchar gsl::vector_uchar::view_array ( unsigned char *  v,
size_t  n 
)
inlinestatic

C++ version of gsl_vector_uchar_view_array().

Parameters
vAn array of type unsigned char
nThe size of the vector_uchar
Returns
A vector_uchar

Definition at line 1546 of file vector_uchar.hpp.

References gsl::rstat::n().

◆ view_array_with_stride() [1/2]

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

C++ version of gsl_vector_uchar_view_array_with_stride().

Parameters
baseAn array of type unsigned char
strideThe stride
nThe size of the vector_uchar: the default gives access to the whole array
Returns
A vector_uchar

Definition at line 1736 of file vector_uchar.hpp.

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

◆ view_array_with_stride() [2/2]

static vector_uchar gsl::vector_uchar::view_array_with_stride ( unsigned char *  base,
size_t  stride,
size_t  n 
)
inlinestatic

C++ version of gsl_vector_uchar_view_array_with_stride().

Parameters
baseAn array of type unsigned char
strideThe stride
nThe size of the vector_uchar
Returns
A vector_uchar

Definition at line 1560 of file vector_uchar.hpp.

References gsl::rstat::n().

◆ wrap_gsl_vector_uchar_without_ownership()

void gsl::vector_uchar::wrap_gsl_vector_uchar_without_ownership ( gsl_vector_uchar *  v)
inline

This function is intended mainly for internal use.

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

Parameters
vThe gsl_vector_uchar

Definition at line 226 of file vector_uchar.hpp.

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

Member Data Documentation

◆ ccgsl_pointer

◆ count

size_t* gsl::vector_uchar::count
private

The shared reference count.

Definition at line 1266 of file vector_uchar.hpp.

Referenced by operator=(), swap(), and vector_uchar().

◆ owns_data

bool gsl::vector_uchar::owns_data
private

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

Definition at line 1258 of file vector_uchar.hpp.

Referenced by operator=().


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