19#ifndef CCGSL_VECTOR_UINT_HPP
20#define CCGSL_VECTOR_UINT_HPP
22#include<gsl/gsl_vector_uint.h>
65 try {
count =
new size_t; }
catch( std::bad_alloc& e ){
79 if(
n > 0 )
ccgsl_pointer = gsl_vector_uint_alloc(
static_cast<size_t>(
n ) );
81 gsl_error(
"failed tring to make a vector of negative length",
85 try {
count =
new size_t; }
catch( std::bad_alloc& e ){
99 explicit vector_uint( gsl_vector_uint* v ) : owns_data(true){
105#ifdef __GXX_EXPERIMENTAL_CXX0X__
110 vector_uint( std::initializer_list<unsigned int> initializer_list ){
111 size_t const n = initializer_list.size();
112 ccgsl_pointer = gsl_vector_uint_alloc(
n );
114 try { count =
new size_t; }
catch( std::bad_alloc& e ){
116 if(
n > 0 ) gsl_vector_uint_free( ccgsl_pointer );
117 else delete ccgsl_pointer;
123 for(
auto x : initializer_list ){ *p = x; ++p; }
132 ccgsl_pointer( v.ccgsl_pointer ), count( v.count ){
133 if( count != 0 ) ++*count;
140 ccgsl_pointer( v.ccgsl_pointer ), count( v.count ){
141 if( count != 0 ) ++*count;
150 if( count == 0 or --*count == 0 ){
151 if( ccgsl_pointer != 0 ){
152 if( ccgsl_pointer->size > 0 ) gsl_vector_uint_free( ccgsl_pointer );
153 else delete ccgsl_pointer; }
160 if( count != 0 ) ++*count;
175 template<
typename V>
vector_uint( V& v,
size_t const stride = 1 ) : owns_data(true){
176 size_t const n = v.size() / stride;
177 ccgsl_pointer =
static_cast<gsl_vector_uint*
>( malloc(
sizeof( gsl_vector_uint ) ) );
178 ccgsl_pointer->size =
n;
179 ccgsl_pointer->stride = stride;
180 ccgsl_pointer->data = v.data();
181 ccgsl_pointer->block = 0;
182 ccgsl_pointer->owner = 0;
184 try { count =
new size_t; }
catch( std::bad_alloc& e ){
186 if(
n > 0 ) gsl_vector_uint_free( ccgsl_pointer );
187 else delete ccgsl_pointer;
201 gsl_vector_uint_memcpy( copy.
get(),
get() );
210 if( count != 0 and --*count == 0 ){
212 if( ccgsl_pointer != 0 and owns_data ){
213 if( ccgsl_pointer->size > 0 ) gsl_vector_uint_free( ccgsl_pointer );
214 else delete ccgsl_pointer; }
229 if( count != 0 and --*count == 0 ){
231 if( ccgsl_pointer != 0 ){
232 if( ccgsl_pointer->size != 0 ) gsl_vector_uint_free( ccgsl_pointer );
233 else delete ccgsl_pointer; }
236 if(0 == count) count =
new size_t;
252 if( (ccgsl_pointer == 0) != (v.
ccgsl_pointer == 0 ) )
return false;
254 if( ccgsl_pointer->size != v.
ccgsl_pointer->size )
return false;
256 for(
size_t i = 0; i < ccgsl_pointer->size; ++i )
257 if( gsl_vector_uint_get( ccgsl_pointer, i ) != gsl_vector_uint_get( v.
ccgsl_pointer, i ) )
return false;
264#ifdef __GXX_EXPERIMENTAL_CXX0X__
270 ccgsl_pointer( v.ccgsl_pointer ), count( nullptr ){
271 std::swap( count, v.count );
272 v.ccgsl_pointer =
nullptr;
309 size_t const size = ccgsl_pointer->size;
312 for(
size_t i = 0; i <
min; ++i ){
313 unsigned int const t = gsl_vector_uint_get( ccgsl_pointer, i );
314 unsigned int const u =gsl_vector_uint_get( v.
ccgsl_pointer, i );
315 if( t < u )
return true;
316 if( u < t )
return false;
319 return size < v_size;
332 if( ccgsl_pointer == 0 )
return false;
336 size_t const size = ccgsl_pointer->size;
339 for(
size_t i = 0; i <
min; ++i ){
340 unsigned int const t = gsl_vector_uint_get( ccgsl_pointer, i );
341 unsigned int const u =gsl_vector_uint_get( v.
ccgsl_pointer, i );
342 if( t > u )
return true;
343 if( u > t )
return false;
346 return size > v_size;
358 return operator<( v ) or operator==( v );
370 return operator>( v ) or operator==( v );
404 template<
typename container,
typename content,
bool reverse_t>
class iterator_base {
436 static content something = 0;
441 }
else if( v->ccgsl_pointer == 0 ){
467 }
else if( v->ccgsl_pointer == 0 ){
491 static content something = 0;
496 }
else if( v->ccgsl_pointer == 0 ){
511 return *(v->ccgsl_pointer->data + p * v->ccgsl_pointer->stride);
521 if( v == 0 or i.
v == 0 ){
524 }
else if( v->ccgsl_pointer == 0 or i.
v->ccgsl_pointer == 0 ){
529 if( v->ccgsl_pointer != i.
v->ccgsl_pointer ){
530 gsl_error(
"trying to take difference of iterators for different vector_uint objects", __FILE__, __LINE__,
552 return not this->operator==( i );
563 if( v == 0 or i.
v == 0 ){
568 if( v->ccgsl_pointer != i.
v->ccgsl_pointer ){
569 gsl_error(
"trying to take difference of iterators for different vector_uint objects", __FILE__, __LINE__,
585 }
else if( v->ccgsl_pointer == 0 ){
602 }
else if( v->ccgsl_pointer == 0 ){
619 }
else if( v->ccgsl_pointer == 0 ){
767 if( this->v == 0 or i.
v == 0 ){
770 }
else if( this->v->ccgsl_pointer == 0 or i.
v->
ccgsl_pointer == 0 ){
776 gsl_error(
"trying to take difference of iterators for different vector_uint objects", __FILE__, __LINE__,
796 return not this->operator==( i );
805 if( this->v == 0 or i.
v == 0 ){
811 gsl_error(
"trying to take difference of iterators for different vector_uint objects", __FILE__, __LINE__,
836 :
public iterator_base<vector_uint const,unsigned int,reverse_t>{
953 if( this->v == 0 or i.
v == 0 ){
956 }
else if( this->v->ccgsl_pointer == 0 or i.
v->
ccgsl_pointer == 0 ){
962 gsl_error(
"trying to take difference of iterators for different vector_uint objects", __FILE__, __LINE__,
994 return not this->operator==( i );
1003 if( this->v == 0 or i.
v == 0 ){
1009 gsl_error(
"trying to take difference of iterators for different vector_uint objects", __FILE__, __LINE__,
1029 return not this->operator==( i );
1038 if( this->v == 0 or i.
v == 0 ){
1044 gsl_error(
"trying to take difference of iterators for different vector_uint objects", __FILE__, __LINE__,
1109 if( ccgsl_pointer == 0 )
return iterator(
this, 0 );
1134 if( ccgsl_pointer == 0 ) gsl_error(
"null vector_uint", __FILE__, __LINE__, GSL_EFAULT );
1135#ifndef GSL_RANGE_CHECK_OFF
1136 if( ccgsl_pointer->stride != 1 )
1137 gsl_error(
"vector_uint does not have stride of size 1", __FILE__, __LINE__, GSL_EBADLEN );
1139 return ccgsl_pointer->data; }
1148 if( ccgsl_pointer == 0 ) gsl_error(
"null vector_uint", __FILE__, __LINE__, GSL_EFAULT );
1149#ifndef GSL_RANGE_CHECK_OFF
1150 if( ccgsl_pointer->stride != 1 )
1151 gsl_error(
"vector_uint does not have stride of size 1", __FILE__, __LINE__, GSL_EBADLEN );
1153 return ccgsl_pointer->data; }
1166 bool empty()
const {
return ccgsl_pointer == 0 or ccgsl_pointer->size == 0; }
1175 std::swap( count, v.
count );
1218 static unsigned int something = 0;
1220 if( ccgsl_pointer == 0 ){
1224#ifndef GSL_RANGE_CHECK_OFF
1232 return *(ccgsl_pointer->data +
n * ccgsl_pointer->stride);
1241 static unsigned int something = 0;
1243 if( ccgsl_pointer == 0 ){
1247#ifndef GSL_RANGE_CHECK_OFF
1255 return *(ccgsl_pointer->data +
n * ccgsl_pointer->stride);
1276 gsl_vector_uint*
get() {
return ccgsl_pointer; }
1281 gsl_vector_uint
const*
get()
const {
return ccgsl_pointer; }
1287 bool unique()
const {
return count != 0 and *count == 1; }
1292 size_t use_count()
const {
return count == 0 ? 0 : *count; }
1298#ifdef __GXX_EXPERIMENTAL_CXX0X__
1301 operator bool()
const {
return ccgsl_pointer != 0; }
1319 void set_all(
unsigned int x ){ gsl_vector_uint_set_all(
get(), x ); }
1344 return gsl_vector_uint_swap_elements(
get(), i, j ); }
1349 unsigned int max()
const {
return gsl_vector_uint_max(
get() ); }
1354 unsigned int min()
const {
return gsl_vector_uint_min(
get() ); }
1360 void minmax(
unsigned int* min_out,
unsigned int* max_out )
const {
1361 gsl_vector_uint_minmax(
get(), min_out, max_out ); }
1367 void minmax(
unsigned int& min_out,
unsigned int& max_out )
const {
1368 gsl_vector_uint_minmax(
get(), &min_out, &max_out ); }
1385 gsl_vector_uint_minmax_index(
get(), imin, imax ); }
1415 int scale(
unsigned int const x ){
return gsl_vector_uint_scale(
get(), x ); }
1421 int add_constant(
unsigned int const x ){
return gsl_vector_uint_add_constant(
get(), x ); }
1430 unsigned int const beta ){
1431 return gsl_vector_uint_axpby( alpha, x.
get(),
beta,
get() ); }
1442 int isnull()
const {
return gsl_vector_uint_isnull(
get() ); }
1447 int ispos()
const {
return gsl_vector_uint_ispos(
get() ); }
1452 int isneg()
const {
return gsl_vector_uint_isneg(
get() ); }
1463 unsigned int get(
size_t const i )
const {
return gsl_vector_uint_get(
get(), i ); }
1469 void set(
size_t const i,
unsigned int x ){ gsl_vector_uint_set(
get(), i, x ); }
1475 unsigned int*
ptr(
size_t const i ){
return gsl_vector_uint_ptr(
get(), i ); }
1481 unsigned int const*
const_ptr(
size_t const i )
const {
return gsl_vector_uint_const_ptr(
get(), i ); }
1487 int fread( FILE* stream ){
return gsl_vector_uint_fread( stream,
get() ); }
1493 int fwrite( FILE* stream )
const {
return gsl_vector_uint_fwrite( stream,
get() ); }
1499 int fscanf( FILE* stream ){
return gsl_vector_uint_fscanf( stream,
get() ); }
1506 int fprintf( FILE* stream,
char const* format )
const {
1507 return gsl_vector_uint_fprintf( stream,
get(), format ); }
1516 ccgsl_pointer = gsl_vector_uint_alloc_from_block(
b.get(), offset,
n, stride );
1518 try { count =
new size_t; }
catch( std::bad_alloc& e ){
1520 gsl_vector_uint_free( ccgsl_pointer );
1533 ccgsl_pointer = gsl_vector_uint_alloc_from_vector( v.
get(), offset,
n, stride );
1535 try { count =
new size_t; }
catch( std::bad_alloc& e ){
1537 gsl_vector_uint_free( ccgsl_pointer );
1549 gsl_vector_uint* w =
static_cast<gsl_vector_uint*
>( malloc(
sizeof( gsl_vector_uint ) ) );
1550 *w = gsl_vector_uint_view_array( v,
n ).vector;
1563 gsl_vector_uint* w =
static_cast<gsl_vector_uint*
>( malloc(
sizeof( gsl_vector_uint ) ) );
1564 *w = gsl_vector_uint_view_array_with_stride( base, stride,
n ).vector;
1576 gsl_vector_uint* w =
static_cast<gsl_vector_uint *
>( malloc(
sizeof( gsl_vector_uint ) ) );
1577 *w = gsl_vector_uint_const_view_array( v,
n ).vector;
1590 gsl_vector_uint* w =
static_cast<gsl_vector_uint*
>( malloc(
sizeof( gsl_vector_uint ) ) );
1591 *w = gsl_vector_uint_const_view_array_with_stride( base, stride,
n ).vector;
1603 static vector_uint const view_array(
unsigned int const* v,
size_t n ){
1604 gsl_vector_uint* w =
static_cast<gsl_vector_uint*
>( malloc(
sizeof( gsl_vector_uint ) ) );
1605 *w = gsl_vector_uint_const_view_array( v,
n ).vector;
1619 static vector_uint
const view_array_with_stride(
unsigned int const* base,
size_t stride,
size_t n ){
1620 gsl_vector_uint* w =
static_cast<gsl_vector_uint*
>( malloc(
sizeof( gsl_vector_uint ) ) );
1621 *w = gsl_vector_uint_const_view_array_with_stride( base, stride,
n ).vector;
1622 return vector_uint( w );
1634 gsl_vector_uint* w =
static_cast<gsl_vector_uint*
>( malloc(
sizeof( gsl_vector_uint ) ) );
1635 *w = gsl_vector_uint_subvector(
get(), i,
n ).vector;
1648 gsl_vector_uint* w =
static_cast<gsl_vector_uint*
>( malloc(
sizeof( gsl_vector_uint ) ) );
1649 *w = gsl_vector_uint_subvector_with_stride(
get(), i, stride,
n ).vector;
1661 gsl_vector_uint* w =
static_cast<gsl_vector_uint*
>( malloc(
sizeof( gsl_vector_uint ) ) );
1662 *w = gsl_vector_uint_const_subvector(
get(), i,
n ).vector;
1675 gsl_vector_uint* w =
static_cast<gsl_vector_uint*
>( malloc(
sizeof( gsl_vector_uint ) ) );
1676 *w = gsl_vector_uint_const_subvector_with_stride(
get(), i, stride,
n ).vector;
1688 vector_uint const subvector(
size_t i,
size_t n )
const {
1689 gsl_vector_uint* w =
static_cast<gsl_vector_uint*
>( malloc(
sizeof( gsl_vector_uint ) ) );
1690 *w = gsl_vector_uint_const_subvector(
get(), i,
n ).vector;
1704 vector_uint
const subvector_with_stride(
size_t i,
size_t stride,
size_t n )
const {
1705 gsl_vector_uint* w =
static_cast<gsl_vector_uint*
>( malloc(
sizeof( gsl_vector_uint ) ) );
1706 *w = gsl_vector_uint_const_subvector_with_stride(
get(), i, stride,
n ).vector;
1707 return vector_uint( w );
1718 template<
typename ARRAY>
1724 gsl_vector_uint* w =
static_cast<gsl_vector_uint*
>( malloc(
sizeof( gsl_vector_uint ) ) );
1725 *w = gsl_vector_uint_view_array( v.data(),
n ).vector;
1737 template<
typename ARRAY>
1740 n = base.size()/stride;
1741 if((
n-1)*stride > base.size())
1743 gsl_vector_uint* w =
static_cast<gsl_vector_uint*
>( malloc(
sizeof( gsl_vector_uint ) ) );
1744 *w = gsl_vector_uint_view_array_with_stride( base.data(), stride,
n ).vector;
1755 template<
typename ARRAY>
1761 gsl_vector_uint* w =
static_cast<gsl_vector_uint *
>( malloc(
sizeof( gsl_vector_uint ) ) );
1762 *w = gsl_vector_uint_const_view_array( v.data(),
n ).vector;
1774 template<
typename ARRAY>
1777 n = base.size()/stride;
1778 if((
n-1)*stride > base.size())
1780 gsl_vector_uint* w =
static_cast<gsl_vector_uint*
>( malloc(
sizeof( gsl_vector_uint ) ) );
1781 *w = gsl_vector_uint_const_view_array_with_stride( base.data(), stride,
n ).vector;
1793 template<
typename ARRAY>
1794 static vector_uint const view_array( ARRAY
const& v,
size_t n=0 ){
1799 gsl_vector_uint* w =
static_cast<gsl_vector_uint*
>( malloc(
sizeof( gsl_vector_uint ) ) );
1800 *w = gsl_vector_uint_const_view_array( v.data(),
n ).vector;
1814 template<
typename ARRAY>
1815 static vector_uint
const view_array_with_stride( ARRAY
const& base,
size_t stride,
size_t n ){
1817 n = base.size()/stride;
1818 if((
n-1)*stride > base.size())
1820 gsl_vector_uint* w =
static_cast<gsl_vector_uint*
>( malloc(
sizeof( gsl_vector_uint ) ) );
1821 *w = gsl_vector_uint_const_view_array_with_stride( base.data(), stride,
n ).vector;
1822 return vector_uint( w );
This class handles vector_uints as shared handles.
@ GSL_EDOM
input domain error, e.g sqrt(-1)
@ GSL_EFAILED
generic failure
@ GSL_EINVAL
invalid argument supplied by user
@ GSL_EBADLEN
matrix, vector lengths are not conformant
@ GSL_EFAULT
invalid pointer
This class handles matrix_uint objects as shared handles.
A class template for the const iterators.
const_iterator_t(vector_uint const *v, difference_type position)
This constructor allows vector_uint to create non-default iterators.
difference_type operator-(const_iterator_t< reverse_t > const &i) const
The - operator: find distance between two iterators.
iterator_base< vector_uintconst, unsignedint, reverse_t >::difference_type difference_type
Difference type.
bool operator!=(const_iterator_t< reverse_t > const &i) const
Comparison with const iterator.
const_iterator_t< reverse_t > & operator-=(difference_type const n)
The -= operator.
const_iterator_t< reverse_t > & operator++()
The prefix ++ operator.
bool operator<(const_iterator_t< reverse_t > const &i) const
Comparison with const iterator.
const_iterator_t< reverse_t > operator+(difference_type const n) const
The + operator.
const_iterator_t< reverse_t > & operator=(const_iterator_t< reverse_t > const &i)
We can assign one output iterator from another.
const_iterator_t< reverse_t > & operator+=(difference_type const n)
The += operator.
bool operator<(iterator_t< reverse_t > const &i) const
Comparison with non-const iterator.
difference_type operator-(iterator_t< reverse_t > const &i) const
The - operator: find distance between two iterators.
bool operator==(iterator_t< reverse_t > const &i) const
Comparison with non-const iterator.
const_iterator_t()
The default constructor.
const_iterator_t< reverse_t > & operator--()
The prefix – operator.
const_iterator_t< reverse_t > operator-(difference_type const n) const
The - operator: subtract distance from iterator.
const_iterator_t< reverse_t > operator++(int)
The postfix ++ operator.
const_iterator_t< reverse_t > operator--(int)
The postfix – operator.
bool operator==(const_iterator_t< reverse_t > const &i) const
Comparison with const iterator.
const_iterator_t(iterator_t< reverse_t > const &i)
A copy constructor.
bool operator!=(iterator_t< reverse_t > const &i) const
Comparison with non-const iterator.
The container must have iterator types.
iterator_base(container *v, difference_type position)
This constructor allows vector_uint to create non-default iterators.
difference_type operator-(iterator_base< container, content, reverse_t > const &i) const
The - operator: find distance between two iterators.
reference operator[](difference_type const n) const
Get element at i + n by reference ([] operator).
ptrdiff_t difference_type
An iterator must have a difference_type.
value_type * pointer
An iterator must have a pointer typea.
bool operator==(iterator_base< container, content, reverse_t > const &i) const
The == operator.
reference operator*() const
Dereference the pointer.
unsigned int value_type
An iterator must have a value type.
iterator_base()
The iterator is default constructible.
bool operator<(iterator_base< container, content, reverse_t > const &i) const
The < operator is used to compare iterators.
value_type & reference
An iterator must have a reference type.
bool operator!=(iterator_base< container, content, reverse_t > const &i) const
The != operator.
void increment()
Increment the iterator.
std::random_access_iterator_tag iterator_category
An iterator must have an iterator category.
container * v
Store a pointer to a vector_uint we can iterate over: 0 if no vector_uint.
difference_type position
Mark position of iterator within vector_uint.
void decrement()
Decrement the iterator.
pointer operator->() const
Dereference the pointer.
void shift(difference_type const n)
Shift iterator n places.
A class template for the two non-const iterators.
iterator_t< reverse_t > operator+(difference_type const n) const
The + operator.
bool operator!=(const_iterator_t< reverse_t > const &i) const
Comparison with const iterator.
iterator_base< vector_uint, unsignedint, reverse_t >::difference_type difference_type
Difference type.
iterator_t< reverse_t > & operator--()
The prefix – operator.
difference_type operator-(iterator_t< reverse_t > const &i) const
The - operator: find distance between two iterators.
iterator_t< reverse_t > & operator-=(difference_type const n)
The -= operator.
iterator_t< reverse_t > & operator++()
The prefix ++ operator.
iterator_t()
The default constructor.
bool operator==(const_iterator_t< reverse_t > const &i) const
Comparison with const iterator.
iterator_t< reverse_t > operator++(int)
The postfix ++ operator.
iterator_t(vector_uint *v, difference_type position)
This constructor allows vector_uint to create non-default iterators.
iterator_t< reverse_t > operator-(difference_type const n) const
The - operator: subtract distance from iterator.
iterator_t< reverse_t > & operator+=(difference_type const n)
The += operator.
difference_type operator-(const_iterator_t< reverse_t > const &i) const
The - operator: find distance between two iterators.
iterator_t< reverse_t > & operator=(iterator_t< reverse_t > const &i)
We can assign one output iterator from another.
bool operator<(const_iterator_t< reverse_t > const &i) const
Comparison with const iterator.
iterator_t< reverse_t > operator--(int)
The postfix – operator.
This class handles vector_uint objects as shared handles.
const_iterator end() const
Get iterator pointing beyond last vector_uint element.
unsigned int const & operator[](size_t const n) const
Get element at position n by reference ([] operator).
bool operator!=(vector_uint const &v) const
Two vector_uint objects are different equal if their elements are not identical.
int div(vector_uint const &b)
C++ version of gsl_vector_uint_div().
int add(vector_uint const &b)
C++ version of gsl_vector_uint_add().
unsigned int & operator[](size_t const n)
Get element at position n by reference ([] operator).
vector_uint(std::initializer_list< unsigned int > initializer_list)
Could construct from a std::initializer_list in C++11.
unsigned int max() const
C++ version of gsl_vector_uint_max().
vector_uint & operator=(vector_uint const &v)
The assignment operator.
int axpby(unsigned int const alpha, vector_uint const &x, unsigned int const beta)
C++ version of gsl_vector_uint_axpby().
void minmax_index(size_t *imin, size_t *imax) const
C++ version of gsl_vector_uint_minmax_index().
static vector_uint alloc_col_from_matrix(matrix_uint &m, size_t const j)
C++ version of gsl_vector_uint_alloc_col_from_matrix().
int reverse()
C++ version of gsl_vector_uint_reverse().
gsl_vector_uint const * get() const
Get the gsl_vector_uint.
bool operator<(vector_uint const &v) const
A container needs to define an ordering for sorting.
int fwrite(FILE *stream) const
C++ version of gsl_vector_uint_fwrite().
vector_uint clone() const
The clone function.
void set_zero()
C++ version of gsl_vector_uint_set_zero().
vector_uint(block_uint &b, size_t const offset, size_t const n, size_t const stride=1)
C++ version of gsl_vector_uint_alloc_from_block().
vector_uint const const_subvector(size_t i, size_t n) const
C++ version of gsl_vector_uint_const_subvector().
static vector_uint view_array_with_stride(unsigned int *base, size_t stride, size_t n)
C++ version of gsl_vector_uint_view_array_with_stride().
size_t min_index() const
C++ version of gsl_vector_uint_min_index().
void minmax(unsigned int *min_out, unsigned int *max_out) const
C++ version of gsl_vector_uint_minmax().
bool operator==(vector_uint const &v) const
Two vector_uint objects are identically equal if their elements are identical.
vector_uint subvector_with_stride(size_t i, size_t stride, size_t n)
C++ version of gsl_vector_uint_subvector_with_stride().
int sub(vector_uint const &b)
C++ version of gsl_vector_uint_sub().
~vector_uint()
The destructor only deletes the pointers if count reaches zero.
int isnull() const
C++ version of gsl_vector_uint_isnull().
unsigned int * ptr(size_t const i)
C++ version of gsl_vector_uint_ptr().
value_type const * const_pointer
A container must have a constant pointer type.
vector_uint(V &v, size_t const stride=1)
Construct from an object that implements data() and size().
bool unique() const
Find if this is the only object sharing the gsl_vector_uint.
int fprintf(FILE *stream, char const *format) const
C++ version of gsl_vector_uint_fprintf().
static vector_uint const const_view_array(ARRAY const &v, size_t n=0)
C++ version of gsl_vector_uint _const_view_array().
int fread(FILE *stream)
C++ version of gsl_vector_uint_fread().
vector_uint(size_t const n)
The default constructor creates a new vector_uint with n elements.
size_t max_index() const
C++ version of gsl_vector_uint_max_index().
int fscanf(FILE *stream)
C++ version of gsl_vector_uint_fscanf().
unsigned int const * data() const
Give access to the data block_uint.
void swap(vector_uint &v)
Swap two vector_uint objects.
void minmax(unsigned int &min_out, unsigned int &max_out) const
C++ version of gsl_vector_uint_minmax().
static vector_uint const const_view_array(unsigned int const *v, size_t n)
C++ version of gsl_vector_uint _const_view_array().
void set(size_t const i, unsigned int x)
C++ version of gsl_vector_uint_set().
value_type & reference
A container must have a reference type.
bool operator<=(vector_uint const &v) const
A container needs to define an ordering for sorting.
vector_uint const const_subvector_with_stride(size_t i, size_t stride, size_t n) const
C++ version of gsl_vector_uint_const_subvector_with_stride().
const_iterator::difference_type difference_type
A container must have a difference_type.
unsigned int sum(vector_uint const &a) const
C++ version of gsl_vector_uint_sum().
static vector_uint view_array(unsigned int *v, size_t n)
C++ version of gsl_vector_uint_view_array().
int set_basis(size_t i)
C++ version of gsl_vector_uint_set_basis().
iterator begin()
Get iterator pointing to first vector_uint element.
static vector_uint calloc(size_t const n)
C++ version of gsl_vector_uint_calloc().
void reset()
Stop sharing ownership of the shared pointer.
gsl_vector_uint * get()
Get the gsl_vector_uint.
unsigned int const * const_ptr(size_t const i) const
C++ version of gsl_vector_uint_const_ptr().
void wrap_gsl_vector_uint_without_ownership(gsl_vector_uint *v)
This function is intended mainly for internal use.
vector_uint()
The default constructor is only really useful for assigning to.
unsigned int value_type
A container must have a value_type.
gsl_vector_uint * ccgsl_pointer
The shared pointer.
vector_uint(vector_uint &v)
The copy constructor.
iterator_t< false > iterator
The iterator type.
const_reverse_iterator rbegin() const
Get iterator pointing to first vector_uint element.
bool operator>=(vector_uint const &v) const
A container needs to define an ordering for sorting.
vector_uint(vector_uint &&v)
Move constructor.
size_type max_size() const
The max size (number of elements) of the vector_uint.
int isneg() const
C++ version of gsl_vector_uint_isneg().
unsigned int * data()
Give access to the data block_uint.
bool empty() const
Find if the vector_uint is empty.
vector_uint(vector_uint &v, size_t const offset, size_t const n, size_t const stride=1)
C++ version of gsl_vector_uint_alloc_from_vector().
const_iterator_t< false > const_iterator
The const_iterator type.
vector_uint & operator=(vector_uint &&v)
Move operator.
int ispos() const
C++ version of gsl_vector_uint_ispos().
size_type size() const
The size (number of elements) of the vector_uint.
unsigned int get(size_t const i) const
C++ version of gsl_vector_uint_get().
size_t * count
The shared reference count.
value_type * pointer
A container must have a pointer type.
int add_constant(unsigned int const x)
C++ version of gsl_vector_uint_add_constant().
reverse_iterator rbegin()
Get iterator pointing to first vector_uint element.
void set_all(unsigned int x)
C++ version of gsl_vector_uint_set_all().
iterator end()
Get iterator pointing beyond last vector_uint element.
int isnonneg() const
C++ version of gsl_vector_uint_isnonneg().
static vector_uint view_array_with_stride(ARRAY &base, size_t stride, size_t n=0)
C++ version of gsl_vector_uint_view_array_with_stride().
vector_uint subvector(size_t i, size_t n)
C++ version of gsl_vector_uint_subvector().
const_iterator_t< true > const_reverse_iterator
The const_reverse_t type.
iterator_t< true > reverse_iterator
The reverse_iterator type.
int mul(vector_uint const &b)
C++ version of gsl_vector_uint_mul().
int swap_elements(size_t const i, size_t const j)
C++ version of gsl_vector_uint_swap_elements().
static vector_uint alloc_row_from_matrix(matrix_uint &m, size_t const i)
C++ version of gsl_vector_uint_alloc_row_from_matrix().
unsigned int min() const
C++ version of gsl_vector_uint_min().
static vector_uint view_array(ARRAY &v, size_t n=0)
C++ version of gsl_vector_uint_view_array().
size_t size_type
A container must have a size_type.
bool operator>(vector_uint const &v) const
A container needs to define an ordering for sorting.
bool owns_data
Used to allow a vector that does not own its data.
vector_uint(vector_uint const &v)
The copy constructor.
const_iterator begin() const
Get iterator pointing to first vector_uint element.
static vector_uint const const_view_array_with_stride(ARRAY const &base, size_t stride, size_t n=0)
C++ version of gsl_vector_uint_const_view_array_with_stride().
int memcpy(vector_uint const &src)
C++ version of gsl_vector_uint_memcpy().
reverse_iterator rend()
Get iterator pointing beyond last vector_uint element.
size_t use_count() const
Find how many vector_uint objects share this pointer.
value_type const & const_reference
A container must have a constant reference type.
int scale(unsigned int const x)
C++ version of gsl_vector_uint_scale().
const_reverse_iterator rend() const
Get iterator pointing beyond last vector_uint element.
static vector_uint const const_view_array_with_stride(unsigned int const *base, size_t stride, size_t n)
C++ version of gsl_vector_uint_const_view_array_with_stride().
gsl_vector * ccgsl_pointer
The shared pointer.
size_t size(series const &cs)
C++ version of gsl_cheb_size().
int min(movstat::end_t const endtype, vector const &x, vector &y, workspace &w)
C++ version of gsl_movstat_min().
vector position(workspace const &w)
C++ version of gsl_multifit_nlinear_position().
double beta(rng const &r, double const a, double const b)
C++ version of gsl_ran_beta().
double get(quantile_workspace &w)
C++ version of gsl_rstat_quantile_get().
size_t n(workspace const &w)
C++ version of gsl_rstat_n().
double b(int order, double qq)
C++ version of gsl_sf_mathieu_b().
double a(int order, double qq)
C++ version of gsl_sf_mathieu_a().
gsl_sf_result result
Typedef for gsl_sf_result.
The gsl package creates an interface to the GNU Scientific Library for C++.