19#ifndef CCGSL_VECTOR_LONG_DOUBLE_HPP
20#define CCGSL_VECTOR_LONG_DOUBLE_HPP
22#include<gsl/gsl_vector_long_double.h>
33 class matrix_long_double;
65 try {
count =
new size_t; }
catch( std::bad_alloc& e ){
79 if(
n > 0 )
ccgsl_pointer = gsl_vector_long_double_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_long_double( gsl_vector_long_double* v ) : owns_data(true){
105#ifdef __GXX_EXPERIMENTAL_CXX0X__
111 size_t const n = initializer_list.size();
112 ccgsl_pointer = gsl_vector_long_double_alloc(
n );
114 try { count =
new size_t; }
catch( std::bad_alloc& e ){
116 if(
n > 0 ) gsl_vector_long_double_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_long_double_free( ccgsl_pointer );
153 else delete ccgsl_pointer; }
160 if( count != 0 ) ++*count;
176 size_t const n = v.size() / stride;
177 ccgsl_pointer =
static_cast<gsl_vector_long_double*
>( malloc(
sizeof( gsl_vector_long_double ) ) );
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_long_double_free( ccgsl_pointer );
187 else delete ccgsl_pointer;
201 gsl_vector_long_double_memcpy( copy.
get(),
get() );
210 if( count != 0 and --*count == 0 ){
212 if( ccgsl_pointer != 0 ){
213 if( ccgsl_pointer->size > 0 ) gsl_vector_long_double_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_long_double_free( ccgsl_pointer );
233 else delete ccgsl_pointer; }
236 if(0 == count) count =
new size_t;
251 if( (ccgsl_pointer == 0) != (v.
ccgsl_pointer == 0 ) )
return false;
253 if( ccgsl_pointer->size != v.
ccgsl_pointer->size )
return false;
255 for(
size_t i = 0; i < ccgsl_pointer->size; ++i )
256 if( gsl_vector_long_double_get( ccgsl_pointer, i ) != gsl_vector_long_double_get( v.
ccgsl_pointer, i ) )
return false;
263#ifdef __GXX_EXPERIMENTAL_CXX0X__
269 ccgsl_pointer( v.ccgsl_pointer ), count( nullptr ){
270 std::swap( count, v.count );
271 v.ccgsl_pointer =
nullptr;
308 size_t const size = ccgsl_pointer->size;
311 for(
size_t i = 0; i <
min; ++i ){
312 long double const t = gsl_vector_long_double_get( ccgsl_pointer, i );
313 long double const u =gsl_vector_long_double_get( v.
ccgsl_pointer, i );
314 if( t < u )
return true;
315 if( u < t )
return false;
318 return size < v_size;
331 if( ccgsl_pointer == 0 )
return false;
335 size_t const size = ccgsl_pointer->size;
338 for(
size_t i = 0; i <
min; ++i ){
339 long double const t = gsl_vector_long_double_get( ccgsl_pointer, i );
340 long double const u =gsl_vector_long_double_get( v.
ccgsl_pointer, i );
341 if( t > u )
return true;
342 if( u > t )
return false;
345 return size > v_size;
357 return operator<( v ) or operator==( v );
369 return operator>( v ) or operator==( v );
403 template<
typename container,
typename content,
bool reverse_t>
class iterator_base {
435 static content something = 0;
440 }
else if( v->ccgsl_pointer == 0 ){
466 }
else if( v->ccgsl_pointer == 0 ){
490 static content something = 0;
495 }
else if( v->ccgsl_pointer == 0 ){
510 return *(v->ccgsl_pointer->data + p * v->ccgsl_pointer->stride);
520 if( v == 0 or i.
v == 0 ){
523 }
else if( v->ccgsl_pointer == 0 or i.
v->ccgsl_pointer == 0 ){
528 if( v->ccgsl_pointer != i.
v->ccgsl_pointer ){
529 gsl_error(
"trying to take difference of iterators for different vector_long_double objects", __FILE__, __LINE__,
551 return not this->operator==( i );
562 if( v == 0 or i.
v == 0 ){
567 if( v->ccgsl_pointer != i.
v->ccgsl_pointer ){
568 gsl_error(
"trying to take difference of iterators for different vector_long_double objects", __FILE__, __LINE__,
584 }
else if( v->ccgsl_pointer == 0 ){
601 }
else if( v->ccgsl_pointer == 0 ){
618 }
else if( v->ccgsl_pointer == 0 ){
766 if( this->v == 0 or i.
v == 0 ){
769 }
else if( this->v->ccgsl_pointer == 0 or i.
v->
ccgsl_pointer == 0 ){
775 gsl_error(
"trying to take difference of iterators for different vector_long_double objects", __FILE__, __LINE__,
795 return not this->operator==( i );
804 if( this->v == 0 or i.
v == 0 ){
810 gsl_error(
"trying to take difference of iterators for different vector_long_double objects", __FILE__, __LINE__,
835 :
public iterator_base<vector_long_double const,long double,reverse_t>{
952 if( this->v == 0 or i.
v == 0 ){
955 }
else if( this->v->ccgsl_pointer == 0 or i.
v->
ccgsl_pointer == 0 ){
961 gsl_error(
"trying to take difference of iterators for different vector_long_double objects", __FILE__, __LINE__,
993 return not this->operator==( i );
1002 if( this->v == 0 or i.
v == 0 ){
1008 gsl_error(
"trying to take difference of iterators for different vector_long_double objects", __FILE__, __LINE__,
1028 return not this->operator==( i );
1037 if( this->v == 0 or i.
v == 0 ){
1043 gsl_error(
"trying to take difference of iterators for different vector_long_double objects", __FILE__, __LINE__,
1108 if( ccgsl_pointer == 0 )
return iterator(
this, 0 );
1133 if( ccgsl_pointer == 0 ) gsl_error(
"null vector_long_double", __FILE__, __LINE__, GSL_EFAULT );
1134#ifndef GSL_RANGE_CHECK_OFF
1135 if( ccgsl_pointer->stride != 1 )
1136 gsl_error(
"vector_long_double does not have stride of size 1", __FILE__, __LINE__, GSL_EBADLEN );
1138 return ccgsl_pointer->data; }
1147 if( ccgsl_pointer == 0 ) gsl_error(
"null vector_long_double", __FILE__, __LINE__, GSL_EFAULT );
1148#ifndef GSL_RANGE_CHECK_OFF
1149 if( ccgsl_pointer->stride != 1 )
1150 gsl_error(
"vector_long_double does not have stride of size 1", __FILE__, __LINE__, GSL_EBADLEN );
1152 return ccgsl_pointer->data; }
1165 bool empty()
const {
return ccgsl_pointer == 0 or ccgsl_pointer->size == 0; }
1174 std::swap( count, v.
count );
1217 static long double something = 0;
1219 if( ccgsl_pointer == 0 ){
1223#ifndef GSL_RANGE_CHECK_OFF
1226 gsl_error(
"trying to read beyond end of vector_long_double", __FILE__, __LINE__,
exception::GSL_EINVAL );
1231 return *(ccgsl_pointer->data +
n * ccgsl_pointer->stride);
1240 static long double something = 0;
1242 if( ccgsl_pointer == 0 ){
1246#ifndef GSL_RANGE_CHECK_OFF
1249 gsl_error(
"trying to read beyond end of vector_long_double", __FILE__, __LINE__,
exception::GSL_EINVAL );
1254 return *(ccgsl_pointer->data +
n * ccgsl_pointer->stride);
1275 gsl_vector_long_double*
get() {
return ccgsl_pointer; }
1280 gsl_vector_long_double
const*
get()
const {
return ccgsl_pointer; }
1286 bool unique()
const {
return count != 0 and *count == 1; }
1291 size_t use_count()
const {
return count == 0 ? 0 : *count; }
1297#ifdef __GXX_EXPERIMENTAL_CXX0X__
1300 operator bool()
const {
return ccgsl_pointer != 0; }
1318 void set_all(
long double x ){ gsl_vector_long_double_set_all(
get(), x ); }
1324 int set_basis(
size_t i ){
return gsl_vector_long_double_set_basis(
get(), i ); }
1343 return gsl_vector_long_double_swap_elements(
get(), i, j ); }
1348 long double max()
const {
return gsl_vector_long_double_max(
get() ); }
1353 long double min()
const {
return gsl_vector_long_double_min(
get() ); }
1359 void minmax(
long double* min_out,
long double* max_out )
const {
1360 gsl_vector_long_double_minmax(
get(), min_out, max_out ); }
1366 void minmax(
long double& min_out,
long double& max_out )
const {
1367 gsl_vector_long_double_minmax(
get(), &min_out, &max_out ); }
1372 size_t max_index()
const {
return gsl_vector_long_double_max_index(
get() ); }
1377 size_t min_index()
const {
return gsl_vector_long_double_min_index(
get() ); }
1384 gsl_vector_long_double_minmax_index(
get(), imin, imax ); }
1414 int scale(
long double const x ){
return gsl_vector_long_double_scale(
get(), x ); }
1420 int add_constant(
long double const x ){
return gsl_vector_long_double_add_constant(
get(), x ); }
1429 long double const beta ){
1430 return gsl_vector_long_double_axpby( alpha, x.
get(),
beta,
get() );
1442 int isnull()
const {
return gsl_vector_long_double_isnull(
get() ); }
1447 int ispos()
const {
return gsl_vector_long_double_ispos(
get() ); }
1452 int isneg()
const {
return gsl_vector_long_double_isneg(
get() ); }
1457 int isnonneg()
const {
return gsl_vector_long_double_isnonneg(
get() ); }
1463 long double get(
size_t const i )
const {
return gsl_vector_long_double_get(
get(), i ); }
1469 void set(
size_t const i,
long double x ){ gsl_vector_long_double_set(
get(), i, x ); }
1475 long double*
ptr(
size_t const i ){
return gsl_vector_long_double_ptr(
get(), i ); }
1481 long double const*
const_ptr(
size_t const i )
const {
return gsl_vector_long_double_const_ptr(
get(), i ); }
1487 int fread( FILE* stream ){
return gsl_vector_long_double_fread( stream,
get() ); }
1493 int fwrite( FILE* stream )
const {
return gsl_vector_long_double_fwrite( stream,
get() ); }
1499 int fscanf( FILE* stream ){
return gsl_vector_long_double_fscanf( stream,
get() ); }
1506 int fprintf( FILE* stream,
char const* format )
const {
1507 return gsl_vector_long_double_fprintf( stream,
get(), format ); }
1516 ccgsl_pointer = gsl_vector_long_double_alloc_from_block(
b.get(), offset,
n, stride );
1518 try { count =
new size_t; }
catch( std::bad_alloc& e ){
1520 gsl_vector_long_double_free( ccgsl_pointer );
1533 ccgsl_pointer = gsl_vector_long_double_alloc_from_vector( v.
get(), offset,
n, stride );
1535 try { count =
new size_t; }
catch( std::bad_alloc& e ){
1537 gsl_vector_long_double_free( ccgsl_pointer );
1549 gsl_vector_long_double* w =
static_cast<gsl_vector_long_double*
>( malloc(
sizeof( gsl_vector_long_double ) ) );
1550 *w = gsl_vector_long_double_view_array( v,
n ).vector;
1563 gsl_vector_long_double* w =
static_cast<gsl_vector_long_double*
>( malloc(
sizeof( gsl_vector_long_double ) ) );
1564 *w = gsl_vector_long_double_view_array_with_stride( base, stride,
n ).vector;
1576 gsl_vector_long_double* w =
static_cast<gsl_vector_long_double *
>( malloc(
sizeof( gsl_vector_long_double ) ) );
1577 *w = gsl_vector_long_double_const_view_array( v,
n ).vector;
1590 gsl_vector_long_double* w =
static_cast<gsl_vector_long_double*
>( malloc(
sizeof( gsl_vector_long_double ) ) );
1591 *w = gsl_vector_long_double_const_view_array_with_stride( base, stride,
n ).vector;
1604 gsl_vector_long_double* w =
static_cast<gsl_vector_long_double*
>( malloc(
sizeof( gsl_vector_long_double ) ) );
1605 *w = gsl_vector_long_double_const_view_array( v,
n ).vector;
1619 static vector_long_double
const view_array_with_stride(
long double const* base,
size_t stride,
size_t n ){
1620 gsl_vector_long_double* w =
static_cast<gsl_vector_long_double*
>( malloc(
sizeof( gsl_vector_long_double ) ) );
1621 *w = gsl_vector_long_double_const_view_array_with_stride( base, stride,
n ).vector;
1622 return vector_long_double( w );
1634 gsl_vector_long_double* w =
static_cast<gsl_vector_long_double*
>( malloc(
sizeof( gsl_vector_long_double ) ) );
1635 *w = gsl_vector_long_double_subvector(
get(), i,
n ).vector;
1648 gsl_vector_long_double* w =
static_cast<gsl_vector_long_double*
>( malloc(
sizeof( gsl_vector_long_double ) ) );
1649 *w = gsl_vector_long_double_subvector_with_stride(
get(), i, stride,
n ).vector;
1661 gsl_vector_long_double* w =
static_cast<gsl_vector_long_double*
>( malloc(
sizeof( gsl_vector_long_double ) ) );
1662 *w = gsl_vector_long_double_const_subvector(
get(), i,
n ).vector;
1675 gsl_vector_long_double* w =
static_cast<gsl_vector_long_double*
>( malloc(
sizeof( gsl_vector_long_double ) ) );
1676 *w = gsl_vector_long_double_const_subvector_with_stride(
get(), i, stride,
n ).vector;
1689 gsl_vector_long_double* w =
static_cast<gsl_vector_long_double*
>( malloc(
sizeof( gsl_vector_long_double ) ) );
1690 *w = gsl_vector_long_double_const_subvector(
get(), i,
n ).vector;
1704 vector_long_double
const subvector_with_stride(
size_t i,
size_t stride,
size_t n )
const {
1705 gsl_vector_long_double* w =
static_cast<gsl_vector_long_double*
>( malloc(
sizeof( gsl_vector_long_double ) ) );
1706 *w = gsl_vector_long_double_const_subvector_with_stride(
get(), i, stride,
n ).vector;
1707 return vector_long_double( w );
1718 template<
typename ARRAY>
1724 gsl_vector_long_double* w =
static_cast<gsl_vector_long_double*
>( malloc(
sizeof( gsl_vector_long_double ) ) );
1725 *w = gsl_vector_long_double_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_long_double* w =
static_cast<gsl_vector_long_double*
>( malloc(
sizeof( gsl_vector_long_double ) ) );
1744 *w = gsl_vector_long_double_view_array_with_stride( base.data(), stride,
n ).vector;
1755 template<
typename ARRAY>
1761 gsl_vector_long_double* w =
static_cast<gsl_vector_long_double *
>( malloc(
sizeof( gsl_vector_long_double ) ) );
1762 *w = gsl_vector_long_double_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_long_double* w =
static_cast<gsl_vector_long_double*
>( malloc(
sizeof( gsl_vector_long_double ) ) );
1781 *w = gsl_vector_long_double_const_view_array_with_stride( base.data(), stride,
n ).vector;
1793 template<
typename ARRAY>
1799 gsl_vector_long_double* w =
static_cast<gsl_vector_long_double*
>( malloc(
sizeof( gsl_vector_long_double ) ) );
1800 *w = gsl_vector_long_double_const_view_array( v.data(),
n ).vector;
1814 template<
typename ARRAY>
1815 static vector_long_double
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_long_double* w =
static_cast<gsl_vector_long_double*
>( malloc(
sizeof( gsl_vector_long_double ) ) );
1821 *w = gsl_vector_long_double_const_view_array_with_stride( base.data(), stride,
n ).vector;
1822 return vector_long_double( w );
This class handles vector_long_doubles 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_long_double objects as shared handles.
A class template for the const iterators.
bool operator!=(iterator_t< reverse_t > const &i) const
Comparison with non-const iterator.
const_iterator_t< reverse_t > operator-(difference_type const n) const
The - operator: subtract distance from iterator.
difference_type operator-(const_iterator_t< reverse_t > const &i) const
The - operator: find distance between two iterators.
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(vector_long_double const *v, difference_type position)
This constructor allows vector_long_double to create non-default iterators.
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.
const_iterator_t()
The default constructor.
bool operator<(iterator_t< reverse_t > const &i) const
Comparison with non-const iterator.
const_iterator_t(iterator_t< reverse_t > const &i)
A copy constructor.
iterator_base< vector_long_doubleconst, longdouble, reverse_t >::difference_type difference_type
Difference type.
const_iterator_t< reverse_t > operator++(int)
The postfix ++ operator.
const_iterator_t< reverse_t > & operator+=(difference_type const n)
The += operator.
bool operator==(const_iterator_t< reverse_t > const &i) const
Comparison with const iterator.
difference_type operator-(iterator_t< reverse_t > const &i) const
The - operator: find distance between two iterators.
bool operator<(const_iterator_t< reverse_t > const &i) const
Comparison with const iterator.
const_iterator_t< reverse_t > operator--(int)
The postfix – operator.
bool operator==(iterator_t< reverse_t > const &i) const
Comparison with non-const iterator.
const_iterator_t< reverse_t > operator+(difference_type const n) const
The + operator.
const_iterator_t< reverse_t > & operator--()
The prefix – operator.
The container must have iterator types.
void decrement()
Decrement the iterator.
iterator_base()
The iterator is default constructible.
ptrdiff_t difference_type
An iterator must have a difference_type.
container * v
Store a pointer to a vector_long_double we can iterate over: 0 if no vector_long_double.
std::random_access_iterator_tag iterator_category
An iterator must have an iterator category.
reference operator[](difference_type const n) const
Get element at i + n by reference ([] operator).
bool operator!=(iterator_base< container, content, reverse_t > const &i) const
The != operator.
pointer operator->() const
Dereference the pointer.
value_type & reference
An iterator must have a reference type.
difference_type position
Mark position of iterator within vector_long_double.
long double value_type
An iterator must have a value type.
iterator_base(container *v, difference_type position)
This constructor allows vector_long_double to create non-default iterators.
reference operator*() const
Dereference the pointer.
difference_type operator-(iterator_base< container, content, reverse_t > const &i) const
The - operator: find distance between two iterators.
void increment()
Increment the iterator.
bool operator<(iterator_base< container, content, reverse_t > const &i) const
The < operator is used to compare iterators.
void shift(difference_type const n)
Shift iterator n places.
bool operator==(iterator_base< container, content, reverse_t > const &i) const
The == operator.
value_type * pointer
An iterator must have a pointer typea.
A class template for the two non-const iterators.
difference_type operator-(const_iterator_t< reverse_t > const &i) const
The - operator: find distance between two iterators.
iterator_t< reverse_t > & operator++()
The prefix ++ operator.
iterator_t< reverse_t > operator++(int)
The postfix ++ operator.
iterator_t< reverse_t > operator+(difference_type const n) const
The + operator.
difference_type operator-(iterator_t< reverse_t > const &i) const
The - operator: find distance between two iterators.
bool operator!=(const_iterator_t< reverse_t > const &i) const
Comparison with const iterator.
iterator_base< vector_long_double, longdouble, reverse_t >::difference_type difference_type
Difference type.
iterator_t< reverse_t > & operator+=(difference_type const n)
The += operator.
bool operator<(const_iterator_t< reverse_t > const &i) const
Comparison with const iterator.
iterator_t< reverse_t > operator-(difference_type const n) const
The - operator: subtract distance from iterator.
iterator_t< reverse_t > & operator=(iterator_t< reverse_t > const &i)
We can assign one output iterator from another.
iterator_t< reverse_t > operator--(int)
The postfix – operator.
bool operator==(const_iterator_t< reverse_t > const &i) const
Comparison with const iterator.
iterator_t< reverse_t > & operator-=(difference_type const n)
The -= operator.
iterator_t(vector_long_double *v, difference_type position)
This constructor allows vector_long_double to create non-default iterators.
iterator_t< reverse_t > & operator--()
The prefix – operator.
iterator_t()
The default constructor.
This class handles vector_long_double objects as shared handles.
int sub(vector_long_double const &b)
C++ version of gsl_vector_long_double_sub().
long double const * data() const
Give access to the data block_long_double.
bool operator<(vector_long_double const &v) const
A container needs to define an ordering for sorting.
vector_long_double(std::initializer_list< long double > initializer_list)
Could construct from a std::initializer_list in C++11.
const_iterator end() const
Get iterator pointing beyond last vector_long_double element.
size_t size_type
A container must have a size_type.
vector_long_double(vector_long_double &&v)
Move constructor.
vector_long_double & operator=(vector_long_double &&v)
Move operator.
static vector_long_double alloc_col_from_matrix(matrix_long_double &m, size_t const j)
C++ version of gsl_vector_long_double_alloc_col_from_matrix().
int reverse()
C++ version of gsl_vector_long_double_reverse().
static vector_long_double view_array(long double *v, size_t n)
C++ version of gsl_vector_long_double_view_array().
int set_basis(size_t i)
C++ version of gsl_vector_long_double_set_basis().
bool unique() const
Find if this is the only object sharing the gsl_vector_long_double.
long double const & operator[](size_t const n) const
Get element at position n by reference ([] operator).
int isnull() const
C++ version of gsl_vector_long_double_isnull().
vector_long_double const const_subvector(size_t i, size_t n) const
C++ version of gsl_vector_long_double_const_subvector().
vector_long_double(vector_long_double &v)
The copy constructor.
static vector_long_double calloc(size_t const n)
C++ version of gsl_vector_long_double_calloc().
size_type max_size() const
The max size (number of elements) of the vector_long_double.
int axpby(long double const alpha, vector_long_double const &x, long double const beta)
C++ version of gsl_vector_long_double_axpby().
value_type const * const_pointer
A container must have a constant pointer type.
static vector_long_double const const_view_array_with_stride(ARRAY const &base, size_t stride, size_t n=0)
C++ version of gsl_vector_long_double_const_view_array_with_stride().
const_iterator_t< true > const_reverse_iterator
The const_reverse_t type.
long double * ptr(size_t const i)
C++ version of gsl_vector_long_double_ptr().
iterator_t< false > iterator
The iterator type.
void minmax_index(size_t *imin, size_t *imax) const
C++ version of gsl_vector_long_double_minmax_index().
int mul(vector_long_double const &b)
C++ version of gsl_vector_long_double_mul().
int fread(FILE *stream)
C++ version of gsl_vector_long_double_fread().
const_iterator::difference_type difference_type
A container must have a difference_type.
void set_all(long double x)
C++ version of gsl_vector_long_double_set_all().
gsl_vector_long_double * ccgsl_pointer
The shared pointer.
value_type & reference
A container must have a reference type.
long double get(size_t const i) const
C++ version of gsl_vector_long_double_get().
iterator end()
Get iterator pointing beyond last vector_long_double element.
const_reverse_iterator rbegin() const
Get iterator pointing to first vector_long_double element.
long double * data()
Give access to the data block_long_double.
bool operator<=(vector_long_double const &v) const
A container needs to define an ordering for sorting.
static vector_long_double view_array_with_stride(ARRAY &base, size_t stride, size_t n=0)
C++ version of gsl_vector_long_double_view_array_with_stride().
bool operator!=(vector_long_double const &v) const
Two vector_long_double objects are different equal if their elements are not identical.
value_type * pointer
A container must have a pointer type.
static vector_long_double alloc_row_from_matrix(matrix_long_double &m, size_t const i)
C++ version of gsl_vector_long_double_alloc_row_from_matrix().
int isneg() const
C++ version of gsl_vector_long_double_isneg().
size_t use_count() const
Find how many vector_long_double objects share this pointer.
void set(size_t const i, long double x)
C++ version of gsl_vector_long_double_set().
gsl_vector_long_double const * get() const
Get the gsl_vector_long_double.
static vector_long_double const const_view_array(long double const *v, size_t n)
C++ version of gsl_vector_long_double _const_view_array().
size_t min_index() const
C++ version of gsl_vector_long_double_min_index().
int memcpy(vector_long_double const &src)
C++ version of gsl_vector_long_double_memcpy().
const_iterator_t< false > const_iterator
The const_iterator type.
iterator begin()
Get iterator pointing to first vector_long_double element.
int ispos() const
C++ version of gsl_vector_long_double_ispos().
static vector_long_double view_array(ARRAY &v, size_t n=0)
C++ version of gsl_vector_long_double_view_array().
vector_long_double clone() const
The clone function.
void set_zero()
C++ version of gsl_vector_long_double_set_zero().
size_t max_index() const
C++ version of gsl_vector_long_double_max_index().
size_type size() const
The size (number of elements) of the vector_long_double.
vector_long_double & operator=(vector_long_double const &v)
The assignment operator.
void swap(vector_long_double &v)
Swap two vector_long_double objects.
int isnonneg() const
C++ version of gsl_vector_long_double_isnonneg().
iterator_t< true > reverse_iterator
The reverse_iterator type.
static vector_long_double view_array_with_stride(long double *base, size_t stride, size_t n)
C++ version of gsl_vector_long_double_view_array_with_stride().
long double max() const
C++ version of gsl_vector_long_double_max().
vector_long_double const const_subvector_with_stride(size_t i, size_t stride, size_t n) const
C++ version of gsl_vector_long_double_const_subvector_with_stride().
void reset()
Stop sharing ownership of the shared pointer.
long double value_type
A container must have a value_type.
gsl_vector_long_double * get()
Get the gsl_vector_long_double.
int add(vector_long_double const &b)
C++ version of gsl_vector_long_double_add().
long double & operator[](size_t const n)
Get element at position n by reference ([] operator).
int add_constant(long double const x)
C++ version of gsl_vector_long_double_add_constant().
vector_long_double()
The default constructor is only really useful for assigning to.
vector_long_double(V &v, size_t const stride=1)
Construct from an object that implements data() and size().
long double sum(vector_long_double const &a) const
C++ version of gsl_vector_long_double_sum().
bool operator==(vector_long_double const &v) const
Two vector_long_double objects are identically equal if their elements are identical.
int fprintf(FILE *stream, char const *format) const
C++ version of gsl_vector_long_double_fprintf().
vector_long_double subvector_with_stride(size_t i, size_t stride, size_t n)
C++ version of gsl_vector_long_double_subvector_with_stride().
static vector_long_double const const_view_array_with_stride(long double const *base, size_t stride, size_t n)
C++ version of gsl_vector_long_double_const_view_array_with_stride().
~vector_long_double()
The destructor only deletes the pointers if count reaches zero.
reverse_iterator rend()
Get iterator pointing beyond last vector_long_double element.
long double const * const_ptr(size_t const i) const
C++ version of gsl_vector_long_double_const_ptr().
value_type const & const_reference
A container must have a constant reference type.
int fwrite(FILE *stream) const
C++ version of gsl_vector_long_double_fwrite().
const_iterator begin() const
Get iterator pointing to first vector_long_double element.
void minmax(long double &min_out, long double &max_out) const
C++ version of gsl_vector_long_double_minmax().
int div(vector_long_double const &b)
C++ version of gsl_vector_long_double_div().
int fscanf(FILE *stream)
C++ version of gsl_vector_long_double_fscanf().
vector_long_double(vector_long_double const &v)
The copy constructor.
bool empty() const
Find if the vector_long_double is empty.
void minmax(long double *min_out, long double *max_out) const
C++ version of gsl_vector_long_double_minmax().
vector_long_double(size_t const n)
The default constructor creates a new vector_long_double with n elements.
void wrap_gsl_vector_long_double_without_ownership(gsl_vector_long_double *v)
This function is intended mainly for internal use.
const_reverse_iterator rend() const
Get iterator pointing beyond last vector_long_double element.
vector_long_double(block_long_double &b, size_t const offset, size_t const n, size_t const stride=1)
C++ version of gsl_vector_long_double_alloc_from_block().
vector_long_double(vector_long_double &v, size_t const offset, size_t const n, size_t const stride=1)
C++ version of gsl_vector_long_double_alloc_from_vector().
static vector_long_double const const_view_array(ARRAY const &v, size_t n=0)
C++ version of gsl_vector_long_double _const_view_array().
long double min() const
C++ version of gsl_vector_long_double_min().
bool operator>(vector_long_double const &v) const
A container needs to define an ordering for sorting.
int swap_elements(size_t const i, size_t const j)
C++ version of gsl_vector_long_double_swap_elements().
bool operator>=(vector_long_double 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.
int scale(long double const x)
C++ version of gsl_vector_long_double_scale().
vector_long_double subvector(size_t i, size_t n)
C++ version of gsl_vector_long_double_subvector().
size_t * count
The shared reference count.
reverse_iterator rbegin()
Get iterator pointing to first vector_long_double element.
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++.