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

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

#include <vector_ushort.hpp>

Inheritance diagram for gsl::vector_ushort:
Inheritance graph
Collaboration diagram for gsl::vector_ushort:
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 short 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_ushort ()
 The default constructor is only really useful for assigning to. More...
 
 vector_ushort (size_t const n)
 The default constructor creates a new vector_ushort with n elements. More...
 
 vector_ushort (gsl_vector_ushort *v)
 Could construct from a gsl_vector_ushort. More...
 
 vector_ushort (std::initializer_list< unsigned short > initializer_list)
 Could construct from a std::initializer_list in C++11. More...
 
 vector_ushort (vector_ushort const &v)
 The copy constructor. More...
 
 vector_ushort (vector_ushort &v)
 The copy constructor. More...
 
vector_ushortoperator= (vector_ushort const &v)
 The assignment operator. More...
 
template<typename V >
 vector_ushort (V &v, size_t const stride=1)
 Construct from an object that implements data() and size(). More...
 
vector_ushort clone () const
 The clone function. More...
 
 ~vector_ushort ()
 The destructor only deletes the pointers if count reaches zero. More...
 
void wrap_gsl_vector_ushort_without_ownership (gsl_vector_ushort *v)
 This function is intended mainly for internal use. More...
 
bool operator== (vector_ushort const &v) const
 Two vector_ushort objects are identically equal if their elements are identical. More...
 
void reset ()
 Stop sharing ownership of the shared pointer. More...
 
 vector_ushort (vector_ushort &&v)
 Move constructor. More...
 
vector_ushortoperator= (vector_ushort &&v)
 Move operator. More...
 
bool operator!= (vector_ushort const &v) const
 Two vector_ushort objects are different equal if their elements are not identical. More...
 
bool operator< (vector_ushort const &v) const
 A container needs to define an ordering for sorting. More...
 
bool operator> (vector_ushort const &v) const
 A container needs to define an ordering for sorting. More...
 
bool operator<= (vector_ushort const &v) const
 A container needs to define an ordering for sorting. More...
 
bool operator>= (vector_ushort const &v) const
 A container needs to define an ordering for sorting. More...
 
iterator begin ()
 Get iterator pointing to first vector_ushort element. More...
 
const_iterator begin () const
 Get iterator pointing to first vector_ushort element. More...
 
iterator end ()
 Get iterator pointing beyond last vector_ushort element. More...
 
const_iterator end () const
 Get iterator pointing beyond last vector_ushort element. More...
 
size_type size () const
 The size (number of elements) of the vector_ushort. More...
 
unsigned short * data ()
 Give access to the data block_ushort. More...
 
unsigned short const * data () const
 Give access to the data block_ushort. More...
 
size_type max_size () const
 The max size (number of elements) of the vector_ushort. More...
 
bool empty () const
 Find if the vector_ushort is empty. More...
 
void swap (vector_ushort &v)
 Swap two vector_ushort objects. More...
 
reverse_iterator rbegin ()
 Get iterator pointing to first vector_ushort element. More...
 
const_reverse_iterator rbegin () const
 Get iterator pointing to first vector_ushort element. More...
 
reverse_iterator rend ()
 Get iterator pointing beyond last vector_ushort element. More...
 
const_reverse_iterator rend () const
 Get iterator pointing beyond last vector_ushort element. More...
 
unsigned short & operator[] (size_t const n)
 Get element at position n by reference ([] operator). More...
 
unsigned short const & operator[] (size_t const n) const
 Get element at position n by reference ([] operator). More...
 
gsl_vector_ushort * get ()
 Get the gsl_vector_ushort. More...
 
gsl_vector_ushort const * get () const
 Get the gsl_vector_ushort. More...
 
bool unique () const
 Find if this is the only object sharing the gsl_vector_ushort. More...
 
size_t use_count () const
 Find how many vector_ushort objects share this pointer. More...
 
 operator bool () const
 Allow conversion to bool. More...
 
void set_zero ()
 C++ version of gsl_vector_ushort_set_zero(). More...
 
void set_all (unsigned short x)
 C++ version of gsl_vector_ushort_set_all(). More...
 
int set_basis (size_t i)
 C++ version of gsl_vector_ushort_set_basis(). More...
 
int memcpy (vector_ushort const &src)
 C++ version of gsl_vector_ushort_memcpy(). More...
 
int reverse ()
 C++ version of gsl_vector_ushort_reverse(). More...
 
int swap_elements (size_t const i, size_t const j)
 C++ version of gsl_vector_ushort_swap_elements(). More...
 
unsigned short max () const
 C++ version of gsl_vector_ushort_max(). More...
 
unsigned short min () const
 C++ version of gsl_vector_ushort_min(). More...
 
void minmax (unsigned short *min_out, unsigned short *max_out) const
 C++ version of gsl_vector_ushort_minmax(). More...
 
void minmax (unsigned short &min_out, unsigned short &max_out) const
 C++ version of gsl_vector_ushort_minmax(). More...
 
size_t max_index () const
 C++ version of gsl_vector_ushort_max_index(). More...
 
size_t min_index () const
 C++ version of gsl_vector_ushort_min_index(). More...
 
void minmax_index (size_t *imin, size_t *imax) const
 C++ version of gsl_vector_ushort_minmax_index(). More...
 
int add (vector_ushort const &b)
 C++ version of gsl_vector_ushort_add(). More...
 
int sub (vector_ushort const &b)
 C++ version of gsl_vector_ushort_sub(). More...
 
int mul (vector_ushort const &b)
 C++ version of gsl_vector_ushort_mul(). More...
 
int div (vector_ushort const &b)
 C++ version of gsl_vector_ushort_div(). More...
 
int scale (unsigned short const x)
 C++ version of gsl_vector_ushort_scale(). More...
 
int add_constant (unsigned short const x)
 C++ version of gsl_vector_ushort_add_constant(). More...
 
int axpby (unsigned short const alpha, vector_ushort const &x, unsigned short const beta)
 C++ version of gsl_vector_ushort_axpby(). More...
 
unsigned short sum (vector_ushort const &a) const
 C++ version of gsl_vector_ushort_sum(). More...
 
int isnull () const
 C++ version of gsl_vector_ushort_isnull(). More...
 
int ispos () const
 C++ version of gsl_vector_ushort_ispos(). More...
 
int isneg () const
 C++ version of gsl_vector_ushort_isneg(). More...
 
int isnonneg () const
 C++ version of gsl_vector_ushort_isnonneg(). More...
 
unsigned short get (size_t const i) const
 C++ version of gsl_vector_ushort_get(). More...
 
void set (size_t const i, unsigned short x)
 C++ version of gsl_vector_ushort_set(). More...
 
unsigned short * ptr (size_t const i)
 C++ version of gsl_vector_ushort_ptr(). More...
 
unsigned short const * const_ptr (size_t const i) const
 C++ version of gsl_vector_ushort_const_ptr(). More...
 
int fread (FILE *stream)
 C++ version of gsl_vector_ushort_fread(). More...
 
int fwrite (FILE *stream) const
 C++ version of gsl_vector_ushort_fwrite(). More...
 
int fscanf (FILE *stream)
 C++ version of gsl_vector_ushort_fscanf(). More...
 
int fprintf (FILE *stream, char const *format) const
 C++ version of gsl_vector_ushort_fprintf(). More...
 
 vector_ushort (block_ushort &b, size_t const offset, size_t const n, size_t const stride=1)
 C++ version of gsl_vector_ushort_alloc_from_block(). More...
 
 vector_ushort (vector_ushort &v, size_t const offset, size_t const n, size_t const stride=1)
 C++ version of gsl_vector_ushort_alloc_from_vector(). More...
 
vector_ushort subvector (size_t i, size_t n)
 C++ version of gsl_vector_ushort_subvector(). More...
 
vector_ushort subvector_with_stride (size_t i, size_t stride, size_t n)
 C++ version of gsl_vector_ushort_subvector_with_stride(). More...
 
vector_ushort const const_subvector (size_t i, size_t n) const
 C++ version of gsl_vector_ushort_const_subvector(). More...
 
vector_ushort const const_subvector_with_stride (size_t i, size_t stride, size_t n) const
 C++ version of gsl_vector_ushort_const_subvector_with_stride(). More...
 

Static Public Member Functions

static vector_ushort calloc (size_t const n)
 C++ version of gsl_vector_ushort_calloc(). More...
 
static vector_ushort view_array (unsigned short *v, size_t n)
 C++ version of gsl_vector_ushort_view_array(). More...
 
static vector_ushort view_array_with_stride (unsigned short *base, size_t stride, size_t n)
 C++ version of gsl_vector_ushort_view_array_with_stride(). More...
 
static vector_ushort const const_view_array (unsigned short const *v, size_t n)
 C++ version of gsl_vector_ushort _const_view_array(). More...
 
static vector_ushort const const_view_array_with_stride (unsigned short const *base, size_t stride, size_t n)
 C++ version of gsl_vector_ushort_const_view_array_with_stride(). More...
 
template<typename ARRAY >
static vector_ushort view_array (ARRAY &v, size_t n=0)
 C++ version of gsl_vector_ushort_view_array(). More...
 
template<typename ARRAY >
static vector_ushort view_array_with_stride (ARRAY &base, size_t stride, size_t n=0)
 C++ version of gsl_vector_ushort_view_array_with_stride(). More...
 
template<typename ARRAY >
static vector_ushort const const_view_array (ARRAY const &v, size_t n=0)
 C++ version of gsl_vector_ushort _const_view_array(). More...
 
template<typename ARRAY >
static vector_ushort const const_view_array_with_stride (ARRAY const &base, size_t stride, size_t n=0)
 C++ version of gsl_vector_ushort_const_view_array_with_stride(). More...
 
static vector_ushort alloc_row_from_matrix (matrix_ushort &m, size_t const i)
 C++ version of gsl_vector_ushort_alloc_row_from_matrix(). More...
 
static vector_ushort alloc_col_from_matrix (matrix_ushort &m, size_t const j)
 C++ version of gsl_vector_ushort_alloc_col_from_matrix(). More...
 

Private Attributes

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

Detailed Description

This class handles vector_ushort objects as shared handles.

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

Note that vector_ushort_views are implemented as vector_ushort objects here.

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

Definition at line 45 of file vector_ushort.hpp.

Member Typedef Documentation

◆ const_iterator

The const_iterator type.

Definition at line 1065 of file vector_ushort.hpp.

◆ const_pointer

A container must have a constant pointer type.

Definition at line 397 of file vector_ushort.hpp.

◆ const_reference

A container must have a constant reference type.

Definition at line 387 of file vector_ushort.hpp.

◆ const_reverse_iterator

The const_reverse_t type.

Definition at line 1073 of file vector_ushort.hpp.

◆ difference_type

A container must have a difference_type.

Definition at line 1082 of file vector_ushort.hpp.

◆ iterator

The iterator type.

Definition at line 1069 of file vector_ushort.hpp.

◆ pointer

A container must have a pointer type.

Definition at line 392 of file vector_ushort.hpp.

◆ reference

A container must have a reference type.

Definition at line 382 of file vector_ushort.hpp.

◆ reverse_iterator

The reverse_iterator type.

Definition at line 1077 of file vector_ushort.hpp.

◆ size_type

A container must have a size_type.

Definition at line 1087 of file vector_ushort.hpp.

◆ value_type

typedef unsigned short gsl::vector_ushort::value_type

A container must have a value_type.

Definition at line 377 of file vector_ushort.hpp.

Constructor & Destructor Documentation

◆ vector_ushort() [1/10]

gsl::vector_ushort::vector_ushort ( )
inline

The default constructor is only really useful for assigning to.

Definition at line 50 of file vector_ushort.hpp.

References ccgsl_pointer, count, and owns_data.

◆ vector_ushort() [2/10]

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

The default constructor creates a new vector_ushort with n elements.

Parameters
nThe number of elements in the vector_ushort

Definition at line 61 of file vector_ushort.hpp.

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

◆ vector_ushort() [3/10]

gsl::vector_ushort::vector_ushort ( gsl_vector_ushort *  v)
inlineexplicit

Could construct from a gsl_vector_ushort.

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

Parameters
vThe vector_ushort

Definition at line 99 of file vector_ushort.hpp.

◆ vector_ushort() [4/10]

gsl::vector_ushort::vector_ushort ( std::initializer_list< unsigned short >  initializer_list)
inline

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

Parameters
initializer_listThe initializer_list.

Definition at line 110 of file vector_ushort.hpp.

References gsl::rstat::n().

◆ vector_ushort() [5/10]

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

The copy constructor.

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

Parameters
vThe vector_ushort to copy.

Definition at line 131 of file vector_ushort.hpp.

◆ vector_ushort() [6/10]

gsl::vector_ushort::vector_ushort ( vector_ushort v)
inline

The copy constructor.

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

Parameters
vThe vector_ushort to copy.

Definition at line 139 of file vector_ushort.hpp.

◆ vector_ushort() [7/10]

template<typename V >
gsl::vector_ushort::vector_ushort ( 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 short> or std::array<unsigned short,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_ushort 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 175 of file vector_ushort.hpp.

References gsl::rstat::n().

◆ ~vector_ushort()

gsl::vector_ushort::~vector_ushort ( )
inline

The destructor only deletes the pointers if count reaches zero.

Definition at line 209 of file vector_ushort.hpp.

◆ vector_ushort() [8/10]

gsl::vector_ushort::vector_ushort ( vector_ushort &&  v)
inline

Move constructor.

Parameters
vThe vector_ushort to move.

Definition at line 269 of file vector_ushort.hpp.

◆ vector_ushort() [9/10]

gsl::vector_ushort::vector_ushort ( block_ushort b,
size_t const  offset,
size_t const  n,
size_t const  stride = 1 
)
inline

C++ version of gsl_vector_ushort_alloc_from_block().

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

Definition at line 1516 of file vector_ushort.hpp.

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

◆ vector_ushort() [10/10]

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

C++ version of gsl_vector_ushort_alloc_from_vector().

Parameters
vThe vector_ushort
offsetThe offset
nThe number of elements
strideThe stride

Definition at line 1533 of file vector_ushort.hpp.

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

Member Function Documentation

◆ add()

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

C++ version of gsl_vector_ushort_add().

Parameters
bvector_ushort to add to this
Returns
error code on failure

Definition at line 1391 of file vector_ushort.hpp.

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

◆ add_constant()

int gsl::vector_ushort::add_constant ( unsigned short const  x)
inline

C++ version of gsl_vector_ushort_add_constant().

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

Definition at line 1421 of file vector_ushort.hpp.

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

◆ alloc_col_from_matrix()

static vector_ushort gsl::vector_ushort::alloc_col_from_matrix ( matrix_ushort m,
size_t const  j 
)
static

C++ version of gsl_vector_ushort_alloc_col_from_matrix().

Parameters
mA matrix_ushort
jA column
Returns
A vector_ushort

◆ alloc_row_from_matrix()

static vector_ushort gsl::vector_ushort::alloc_row_from_matrix ( matrix_ushort m,
size_t const  i 
)
static

C++ version of gsl_vector_ushort_alloc_row_from_matrix().

Parameters
mA matrix_ushort
iA row
Returns
A vector_ushort

◆ axpby()

int gsl::vector_ushort::axpby ( unsigned short const  alpha,
vector_ushort const &  x,
unsigned short const  beta 
)
inline

C++ version of gsl_vector_ushort_axpby().

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

Definition at line 1429 of file vector_ushort.hpp.

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

◆ begin() [1/2]

iterator gsl::vector_ushort::begin ( )
inline

Get iterator pointing to first vector_ushort element.

Returns
iterator pointing to first vector_ushort element

Definition at line 1093 of file vector_ushort.hpp.

◆ begin() [2/2]

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

Get iterator pointing to first vector_ushort element.

Returns
iterator pointing to first vector_ushort element

Definition at line 1100 of file vector_ushort.hpp.

◆ calloc()

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

C++ version of gsl_vector_ushort_calloc().

This constructs a vector_ushort object with entries initialised to zero.

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

Definition at line 1310 of file vector_ushort.hpp.

References gsl::rstat::n().

◆ clone()

vector_ushort gsl::vector_ushort::clone ( ) const
inline

The clone function.

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

Returns
a new copy of this.

Definition at line 198 of file vector_ushort.hpp.

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

◆ const_ptr()

unsigned short const * gsl::vector_ushort::const_ptr ( size_t const  i) const
inline

C++ version of gsl_vector_ushort_const_ptr().

Parameters
iindex of element to get
Returns
pointer to element

Definition at line 1482 of file vector_ushort.hpp.

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

◆ const_subvector()

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

C++ version of gsl_vector_ushort_const_subvector().

Parameters
iThe offset
nThe size
Returns
A subvector

Definition at line 1661 of file vector_ushort.hpp.

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

◆ const_subvector_with_stride()

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

C++ version of gsl_vector_ushort_const_subvector_with_stride().

Parameters
iThe offset
strideThe stride
nThe size
Returns
A subvector

Definition at line 1675 of file vector_ushort.hpp.

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

◆ const_view_array() [1/2]

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

C++ version of gsl_vector_ushort _const_view_array().

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

Definition at line 1757 of file vector_ushort.hpp.

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

◆ const_view_array() [2/2]

static vector_ushort const gsl::vector_ushort::const_view_array ( unsigned short const *  v,
size_t  n 
)
inlinestatic

C++ version of gsl_vector_ushort _const_view_array().

Parameters
vAn array of type unsigned short
nThe size of the vector_ushort
Returns
A vector_ushort

Definition at line 1576 of file vector_ushort.hpp.

References gsl::rstat::n().

◆ const_view_array_with_stride() [1/2]

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

C++ version of gsl_vector_ushort_const_view_array_with_stride().

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

Definition at line 1776 of file vector_ushort.hpp.

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

◆ const_view_array_with_stride() [2/2]

static vector_ushort const gsl::vector_ushort::const_view_array_with_stride ( unsigned short const *  base,
size_t  stride,
size_t  n 
)
inlinestatic

C++ version of gsl_vector_ushort_const_view_array_with_stride().

Parameters
baseAn array of type unsigned short
strideThe stride
nThe size of the vector_ushort
Returns
A vector_ushort

Definition at line 1590 of file vector_ushort.hpp.

References gsl::rstat::n().

◆ data() [1/2]

unsigned short * gsl::vector_ushort::data ( )
inline

Give access to the data block_ushort.

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

Returns
The data block_ushort.

Definition at line 1133 of file vector_ushort.hpp.

◆ data() [2/2]

unsigned short const * gsl::vector_ushort::data ( ) const
inline

Give access to the data block_ushort.

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

Returns
The data block_ushort.

Definition at line 1147 of file vector_ushort.hpp.

◆ div()

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

C++ version of gsl_vector_ushort_div().

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

Definition at line 1409 of file vector_ushort.hpp.

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

◆ empty()

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

Find if the vector_ushort is empty.

Returns
true if has size zero; otherwise false

Definition at line 1166 of file vector_ushort.hpp.

◆ end() [1/2]

iterator gsl::vector_ushort::end ( )
inline

Get iterator pointing beyond last vector_ushort element.

Returns
iterator pointing beyond last vector_ushort element

Definition at line 1108 of file vector_ushort.hpp.

References gsl::cheb::size().

◆ end() [2/2]

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

Get iterator pointing beyond last vector_ushort element.

Returns
iterator pointing beyond last vector_ushort element

Definition at line 1116 of file vector_ushort.hpp.

References gsl::cheb::size().

◆ fprintf()

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

C++ version of gsl_vector_ushort_fprintf().

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

Definition at line 1507 of file vector_ushort.hpp.

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

◆ fread()

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

C++ version of gsl_vector_ushort_fread().

Parameters
streamA C file stream
Returns
error code on failure

Definition at line 1488 of file vector_ushort.hpp.

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

◆ fscanf()

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

C++ version of gsl_vector_ushort_fscanf().

Parameters
streamA C file stream
Returns
error code on failure

Definition at line 1500 of file vector_ushort.hpp.

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

◆ fwrite()

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

C++ version of gsl_vector_ushort_fwrite().

Parameters
streamA C file stream
Returns
error code on failure

Definition at line 1494 of file vector_ushort.hpp.

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

◆ get() [1/3]

◆ get() [2/3]

gsl_vector_ushort const * gsl::vector_ushort::get ( ) const
inline

Get the gsl_vector_ushort.

Returns
the gsl_vector_ushort

Definition at line 1281 of file vector_ushort.hpp.

◆ get() [3/3]

unsigned short gsl::vector_ushort::get ( size_t const  i) const
inline

C++ version of gsl_vector_ushort_get().

Parameters
iindex of element to get
Returns
value of element

Definition at line 1464 of file vector_ushort.hpp.

References get().

Referenced by get().

◆ isneg()

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

C++ version of gsl_vector_ushort_isneg().

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

Definition at line 1453 of file vector_ushort.hpp.

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

◆ isnonneg()

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

C++ version of gsl_vector_ushort_isnonneg().

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

Definition at line 1458 of file vector_ushort.hpp.

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

◆ isnull()

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

C++ version of gsl_vector_ushort_isnull().

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

Definition at line 1443 of file vector_ushort.hpp.

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

◆ ispos()

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

C++ version of gsl_vector_ushort_ispos().

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

Definition at line 1448 of file vector_ushort.hpp.

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

◆ max()

unsigned short gsl::vector_ushort::max ( ) const
inline

C++ version of gsl_vector_ushort_max().

Returns
maximum element of vector_ushort

Definition at line 1349 of file vector_ushort.hpp.

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

◆ max_index()

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

C++ version of gsl_vector_ushort_max_index().

Returns
index of maximum value of vector_ushort

Definition at line 1373 of file vector_ushort.hpp.

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

◆ max_size()

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

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

Identical to size but required for a container.

Returns
The size of the vector_ushort

Definition at line 1160 of file vector_ushort.hpp.

◆ memcpy()

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

C++ version of gsl_vector_ushort_memcpy().

Parameters
srcsource vector_ushort
Returns
error code on failure

Definition at line 1331 of file vector_ushort.hpp.

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

◆ min()

unsigned short gsl::vector_ushort::min ( ) const
inline

C++ version of gsl_vector_ushort_min().

Returns
minimum element of vector_ushort

Definition at line 1354 of file vector_ushort.hpp.

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

◆ min_index()

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

C++ version of gsl_vector_ushort_min_index().

Returns
index of minimum value of vector_ushort

Definition at line 1378 of file vector_ushort.hpp.

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

◆ minmax() [1/2]

void gsl::vector_ushort::minmax ( unsigned short &  min_out,
unsigned short &  max_out 
) const
inline

C++ version of gsl_vector_ushort_minmax().

Parameters
min_outminimum element of vector_ushort
max_outmaximum element of vector_ushort

Definition at line 1367 of file vector_ushort.hpp.

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

◆ minmax() [2/2]

void gsl::vector_ushort::minmax ( unsigned short *  min_out,
unsigned short *  max_out 
) const
inline

C++ version of gsl_vector_ushort_minmax().

Parameters
min_outminimum element of vector_ushort
max_outmaximum element of vector_ushort

Definition at line 1360 of file vector_ushort.hpp.

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

◆ minmax_index()

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

C++ version of gsl_vector_ushort_minmax_index().

Parameters
iminindex of minimum value of vector_ushort
imaxindex of maximum value of vector_ushort

Definition at line 1384 of file vector_ushort.hpp.

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

◆ mul()

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

C++ version of gsl_vector_ushort_mul().

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

Definition at line 1403 of file vector_ushort.hpp.

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

◆ operator bool()

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

Allow conversion to bool.

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

Definition at line 1301 of file vector_ushort.hpp.

◆ operator!=()

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

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

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

Definition at line 291 of file vector_ushort.hpp.

◆ operator<()

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

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

Definition at line 303 of file vector_ushort.hpp.

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

◆ operator<=()

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

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

Definition at line 357 of file vector_ushort.hpp.

◆ operator=() [1/2]

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

Move operator.

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

Definition at line 279 of file vector_ushort.hpp.

References swap().

◆ operator=() [2/2]

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

The assignment operator.

This makes a shared copy.

Parameters
vThe vector_ushort to copy

Definition at line 148 of file vector_ushort.hpp.

References ccgsl_pointer, count, and owns_data.

◆ operator==()

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

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

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

Definition at line 248 of file vector_ushort.hpp.

References ccgsl_pointer.

◆ operator>()

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

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

Definition at line 330 of file vector_ushort.hpp.

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

◆ operator>=()

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

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

Definition at line 369 of file vector_ushort.hpp.

◆ operator[]() [1/2]

unsigned short & gsl::vector_ushort::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 short

Definition at line 1216 of file vector_ushort.hpp.

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

◆ operator[]() [2/2]

unsigned short const & gsl::vector_ushort::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 short

Definition at line 1239 of file vector_ushort.hpp.

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

◆ ptr()

unsigned short * gsl::vector_ushort::ptr ( size_t const  i)
inline

C++ version of gsl_vector_ushort_ptr().

Parameters
iindex of element to get
Returns
pointer to element

Definition at line 1476 of file vector_ushort.hpp.

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

◆ rbegin() [1/2]

reverse_iterator gsl::vector_ushort::rbegin ( )
inline

Get iterator pointing to first vector_ushort element.

Returns
iterator pointing to first vector_ushort element

Definition at line 1183 of file vector_ushort.hpp.

References gsl::cheb::size().

◆ rbegin() [2/2]

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

Get iterator pointing to first vector_ushort element.

Returns
iterator pointing to first vector_ushort element

Definition at line 1191 of file vector_ushort.hpp.

References gsl::cheb::size().

◆ rend() [1/2]

reverse_iterator gsl::vector_ushort::rend ( )
inline

Get iterator pointing beyond last vector_ushort element.

Returns
iterator pointing beyond last vector_ushort element

Definition at line 1200 of file vector_ushort.hpp.

◆ rend() [2/2]

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

Get iterator pointing beyond last vector_ushort element.

Returns
iterator pointing beyond last vector_ushort element

Definition at line 1207 of file vector_ushort.hpp.

◆ reset()

void gsl::vector_ushort::reset ( )
inline

Stop sharing ownership of the shared pointer.

Definition at line 263 of file vector_ushort.hpp.

References swap().

◆ reverse()

int gsl::vector_ushort::reverse ( )
inline

C++ version of gsl_vector_ushort_reverse().

Returns
error code on failure

Definition at line 1336 of file vector_ushort.hpp.

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

◆ scale()

int gsl::vector_ushort::scale ( unsigned short const  x)
inline

C++ version of gsl_vector_ushort_scale().

Parameters
xconstant to multiply this by
Returns
error code on failure

Definition at line 1415 of file vector_ushort.hpp.

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

◆ set()

void gsl::vector_ushort::set ( size_t const  i,
unsigned short  x 
)
inline

C++ version of gsl_vector_ushort_set().

Parameters
iindex to set
xnew value for element

Definition at line 1470 of file vector_ushort.hpp.

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

◆ set_all()

void gsl::vector_ushort::set_all ( unsigned short  x)
inline

C++ version of gsl_vector_ushort_set_all().

Parameters
xThe value to which all elements are set

Definition at line 1319 of file vector_ushort.hpp.

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

◆ set_basis()

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

C++ version of gsl_vector_ushort_set_basis().

Creates a basis vector_ushort with one nonzero element.

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

Definition at line 1325 of file vector_ushort.hpp.

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

◆ set_zero()

void gsl::vector_ushort::set_zero ( )
inline

C++ version of gsl_vector_ushort_set_zero().

Definition at line 1314 of file vector_ushort.hpp.

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

◆ size()

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

The size (number of elements) of the vector_ushort.

Returns
The size of the vector_ushort

Definition at line 1125 of file vector_ushort.hpp.

◆ sub()

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

C++ version of gsl_vector_ushort_sub().

Parameters
bvector_ushort to subtract from this
Returns
error code on failure

Definition at line 1397 of file vector_ushort.hpp.

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

◆ subvector()

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

C++ version of gsl_vector_ushort_subvector().

Parameters
iThe offset
nThe size
Returns
A subvector

Definition at line 1634 of file vector_ushort.hpp.

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

◆ subvector_with_stride()

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

C++ version of gsl_vector_ushort_subvector_with_stride().

Parameters
iThe offset
strideThe stride
nThe size
Returns
A subvector

Definition at line 1648 of file vector_ushort.hpp.

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

◆ sum()

unsigned short gsl::vector_ushort::sum ( vector_ushort const &  a) const
inline

C++ version of gsl_vector_ushort_sum().

Parameters
aThe vector
Returns
The sum of the elements

Definition at line 1438 of file vector_ushort.hpp.

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

◆ swap()

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

Swap two vector_ushort objects.

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

Parameters
vThe vector_ushort to swap with this.

Definition at line 1173 of file vector_ushort.hpp.

References ccgsl_pointer, and count.

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

◆ swap_elements()

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

C++ version of gsl_vector_ushort_swap_elements().

Parameters
ifirst element
jsecond element
Returns
error code on failure

Definition at line 1343 of file vector_ushort.hpp.

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

◆ unique()

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

Find if this is the only object sharing the gsl_vector_ushort.

Returns
true or falses according as this is the only vector_ushort object sharing the gsl_vector_ushort

Definition at line 1287 of file vector_ushort.hpp.

◆ use_count()

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

Find how many vector_ushort objects share this pointer.

Returns
the number of vector_ushort objects that share this pointer

Definition at line 1292 of file vector_ushort.hpp.

◆ view_array() [1/2]

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

C++ version of gsl_vector_ushort_view_array().

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

Definition at line 1720 of file vector_ushort.hpp.

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

◆ view_array() [2/2]

static vector_ushort gsl::vector_ushort::view_array ( unsigned short *  v,
size_t  n 
)
inlinestatic

C++ version of gsl_vector_ushort_view_array().

Parameters
vAn array of type unsigned short
nThe size of the vector_ushort
Returns
A vector_ushort

Definition at line 1549 of file vector_ushort.hpp.

References gsl::rstat::n().

◆ view_array_with_stride() [1/2]

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

C++ version of gsl_vector_ushort_view_array_with_stride().

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

Definition at line 1739 of file vector_ushort.hpp.

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

◆ view_array_with_stride() [2/2]

static vector_ushort gsl::vector_ushort::view_array_with_stride ( unsigned short *  base,
size_t  stride,
size_t  n 
)
inlinestatic

C++ version of gsl_vector_ushort_view_array_with_stride().

Parameters
baseAn array of type unsigned short
strideThe stride
nThe size of the vector_ushort
Returns
A vector_ushort

Definition at line 1563 of file vector_ushort.hpp.

References gsl::rstat::n().

◆ wrap_gsl_vector_ushort_without_ownership()

void gsl::vector_ushort::wrap_gsl_vector_ushort_without_ownership ( gsl_vector_ushort *  v)
inline

This function is intended mainly for internal use.

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

Parameters
vThe gsl_vector_ushort

Definition at line 228 of file vector_ushort.hpp.

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

Member Data Documentation

◆ ccgsl_pointer

◆ count

size_t* gsl::vector_ushort::count
private

The shared reference count.

Definition at line 1269 of file vector_ushort.hpp.

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

◆ owns_data

bool gsl::vector_ushort::owns_data
private

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

Definition at line 1261 of file vector_ushort.hpp.

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


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