21#ifndef CCGSL_BLOCK_COMPLEX_LONG_DOUBLE_HPP
22#define CCGSL_BLOCK_COMPLEX_LONG_DOUBLE_HPP
24#include<gsl/gsl_block.h>
29#ifdef __GXX_EXPERIMENTAL_CXX0X__
69 try {
count =
new size_t; }
catch( std::bad_alloc& e ){
88#ifdef __GXX_EXPERIMENTAL_CXX0X__
94 size_t const n = initializer_list.size();
97 try {
count =
new size_t; }
catch( std::bad_alloc& e ){
106 for(
auto x : initializer_list ){
169#ifdef __GXX_EXPERIMENTAL_CXX0X__
175 std::swap(
count, v.count );
176 v.ccgsl_pointer =
nullptr;
236 for(
size_t i = 0; i <
min; ++i ){
239 if( t < u )
return true;
240 if( u < t )
return false;
243 return size < v_size;
263 for(
size_t i = 0; i <
min; ++i ){
266 if( t > u )
return true;
267 if( u > t )
return false;
270 return size > v_size;
328 template<
typename container,
typename content,
bool reverse>
364 }
else if(
v->ccgsl_pointer == 0 ){
390 }
else if(
v->ccgsl_pointer == 0 ){
417 }
else if(
v->ccgsl_pointer == 0 ){
442 if(
v == 0 or i.
v == 0 ){
445 }
else if(
v->ccgsl_pointer == 0 or i.
v->ccgsl_pointer == 0 ){
450 if(
v->ccgsl_pointer != i.
v->ccgsl_pointer ){
451 gsl_error(
"trying to take difference of iterators for different block_complex_long_doubles", __FILE__, __LINE__,
484 if(
v == 0 or i.
v == 0 ){
489 if(
v->ccgsl_pointer != i.
v->ccgsl_pointer ){
490 gsl_error(
"trying to take difference of iterators for different block_complex_long_doubles", __FILE__, __LINE__,
506 }
else if(
v->ccgsl_pointer == 0 ){
523 }
else if(
v->ccgsl_pointer == 0 ){
540 }
else if(
v->ccgsl_pointer == 0 ){
688 if( this->
v == 0 or i.
v == 0 ){
697 gsl_error(
"trying to take difference of iterators for different block_complex_long_doubles", __FILE__, __LINE__,
726 if( this->
v == 0 or i.
v == 0 ){
732 gsl_error(
"trying to take difference of iterators for different block_complex_long_doubles", __FILE__, __LINE__,
757 :
public iterator_base<block_complex_long_double const,long double,reverse>{
874 if( this->
v == 0 or i.
v == 0 ){
883 gsl_error(
"trying to take difference of iterators for different block_complex_long_doubles", __FILE__, __LINE__,
924 if( this->
v == 0 or i.
v == 0 ){
930 gsl_error(
"trying to take difference of iterators for different block_complex_long_doubles", __FILE__, __LINE__,
959 if( this->
v == 0 or i.
v == 0 ){
965 gsl_error(
"trying to take difference of iterators for different block_complexs", __FILE__, __LINE__,
1053 if(
ccgsl_pointer == 0 ) gsl_error(
"null block", __FILE__, __LINE__, GSL_EFAULT );
1061 if(
ccgsl_pointer == 0 ) gsl_error(
"null block", __FILE__, __LINE__, GSL_EFAULT );
1133#ifndef GSL_RANGE_CHECK_OFF
1136 gsl_error(
"trying to read beyond end of block_complex_long_double", __FILE__, __LINE__,
exception::GSL_EFAILED );
1156#ifndef GSL_RANGE_CHECK_OFF
1159 gsl_error(
"trying to read beyond end of block_complex_long_double", __FILE__, __LINE__,
exception::GSL_EFAILED );
1198#ifdef __GXX_EXPERIMENTAL_CXX0X__
A class template for the const iterators.
bool operator<(iterator_t< reverse > const &i) const
Comparison with non-const iterator.
const_iterator_t< reverse > operator++(int)
The postfix ++ operator.
difference_type operator-(const_iterator_t< reverse > const &i) const
The - operator: find distance between two iterators.
const_iterator_t()
The default constructor.
const_iterator_t< reverse > & operator--()
The prefix – operator.
const_iterator_t< reverse > & operator++()
The prefix ++ operator.
const_iterator_t< reverse > & operator=(const_iterator_t< reverse > const &i)
We can assign one output iterator from another.
const_iterator_t< reverse > operator--(int)
The postfix – operator.
bool operator!=(iterator_t< reverse > const &i) const
Comparison with non-const iterator.
const_iterator_t< reverse > & operator+=(difference_type const n)
The += operator.
difference_type operator-(iterator_t< reverse > const &i) const
The - operator: find distance between two iterators.
bool operator!=(const_iterator_t< reverse > const &i) const
Comparison with const iterator.
iterator_base< block_complex_long_doubleconst, longdouble, reverse >::difference_type difference_type
Difference type.
bool operator==(const_iterator_t< reverse > const &i) const
Comparison with const iterator.
bool operator<(const_iterator_t< reverse > const &i) const
Comparison with const iterator.
const_iterator_t(iterator_t< reverse > const &i)
A copy constructor.
const_iterator_t(block_complex_long_double const *v, difference_type position)
This constructor allows block_complex_long_double to create non-default iterators.
bool operator==(iterator_t< reverse > const &i) const
Comparison with non-const iterator.
const_iterator_t< reverse > operator-(difference_type const n) const
The - operator: subtract distance from iterator.
const_iterator_t< reverse > & operator-=(difference_type const n)
The -= operator.
const_iterator_t< reverse > operator+(difference_type const n) const
The + operator.
The container must have iterator types.
bool operator<(iterator_base< container, content, reverse > const &i) const
The < operator is used to compare iterators.
complex_long_double_ptr pointer
An iterator must have a pointer type.
pointer operator->() const
Dereference the pointer.
void shift(difference_type const n)
Shift iterator n places.
std::random_access_iterator_tag iterator_category
An iterator must have a pointer type.
reference operator[](difference_type const n) const
Get element at i + n by reference ([] operator).
void decrement()
Derement the iterator.
void increment()
Increment the iterator.
ptrdiff_t difference_type
An iterator must have a difference_type.
iterator_base()
The iterator is default constructible.
complex_long_double value_type
An iterator must have a value_type.
bool operator==(iterator_base< container, content, reverse > const &i) const
The == operator.
container * v
Store a pointer to a block_complex_long_double we can iterate over: 0 if no block_complex_long_double...
bool operator!=(iterator_base< container, content, reverse > const &i) const
The != operator.
complex_long_double_ref reference
An iterator must have a reference type.
difference_type operator-(iterator_base< container, content, reverse > const &i) const
The - operator: find distance between two iterators.
reference operator*() const
Dereference the pointer.
difference_type position
Mark position of iterator within block_complex_long_double.
iterator_base(container *v, difference_type position)
This constructor allows block_complex_long_double to create non-default iterators.
A class template for the two non-const iterators.
bool operator==(const_iterator_t< reverse > const &i) const
Comparison with const iterator.
difference_type operator-(iterator_t< reverse > const &i) const
The - operator: find distance between two iterators.
iterator_t< reverse > operator+(difference_type const n) const
The + operator.
iterator_t< reverse > & operator++()
The prefix ++ operator.
bool operator!=(const_iterator_t< reverse > const &i) const
Comparison with const iterator.
iterator_t()
The default constructor.
iterator_t< reverse > operator--(int)
The postfix – operator.
bool operator<(const_iterator_t< reverse > const &i) const
Comparison with const iterator.
iterator_t< reverse > operator-(difference_type const n) const
The - operator: subtract distance from iterator.
iterator_t< reverse > & operator--()
The prefix – operator.
iterator_t< reverse > & operator-=(difference_type const n)
The -= operator.
iterator_t< reverse > operator++(int)
The postfix ++ operator.
iterator_t(block_complex_long_double *v, difference_type position)
This constructor allows block_complex_long_double to create non-default iterators.
iterator_t< reverse > & operator=(iterator_t< reverse > const &i)
We can assign one output iterator from another.
iterator_t< reverse > & operator+=(difference_type const n)
The += operator.
difference_type operator-(const_iterator_t< reverse > const &i) const
The - operator: find distance between two iterators.
iterator_base< block_complex_long_double, longdouble, reverse >::difference_type difference_type
Difference type.
This class handles vector_complex_long_doubles as shared handles.
block_complex_long_double & operator=(block_complex_long_double const &v)
The assignment operator.
reverse_iterator rend()
Get iterator pointing beyond last block_complex_long_double element.
complex_long_double_ptr const const_pointer
A container must have a constant pointer type.
bool unique() const
Find if this is the only object sharing the gsl_block_complex_long_double.
size_t use_count() const
Find how many block_complex_long_double objects share this pointer.
reference operator[](size_t const n)
Get element at position n by reference ([] operator).
block_complex_long_double(std::initializer_list< std::complex< long double > > initializer_list)
Could construct from a std::initializer_list in C++11.
const_reference operator[](size_t const n) const
Get element at position n by reference ([] operator).
size_t * count
The shared reference count.
block_complex_long_double(size_t const n)
The default constructor creates a new block_complex_long_double with n elements.
complex_long_double_ptr pointer
A container must have a pointer type.
const_iterator::difference_type difference_type
A container must have a difference_type.
const_iterator_t< false > const_iterator
The const_iterator type.
void reset()
Stop sharing ownership of the shared pointer.
block_complex_long_double(gsl_block_complex_long_double *v)
Could construct from a gsl_block_complex_long_double.
gsl_block_complex_long_double * get() const
Get the gsl_block_complex_long_double.
reference const const_reference
A container must have a constant reference type.
const_iterator begin() const
Get iterator pointing to first block_complex_long_double element.
size_type max_size() const
The max size (number of elements) of the block_complex_long_double.
const_reverse_iterator rbegin() const
Get iterator pointing to first block_complex_long_double element.
bool operator<(block_complex_long_double const &v) const
A container needs to define an ordering for sorting.
block_complex_long_double(block_complex_long_double const &v)
The copy constructor.
bool operator>(block_complex_long_double const &v) const
A container needs to define an ordering for sorting.
block_complex_long_double(block_complex_long_double &&v)
Move constructor.
block_complex_long_double()
The default constructor is only really useful for assigning to.
void swap(block_complex_long_double &v)
Swap two block_complex_long_double objects.
gsl_block_complex_long_double * ccgsl_pointer
The shared pointer.
iterator_t< false > iterator
The iterator type.
bool empty() const
Find if the block_complex_long_double is empty.
block_complex_long_double & operator=(block_complex_long_double &&v)
Move operator.
const_iterator_t< true > const_reverse_iterator
The const_reverse_iterator type.
long double * data()
Give access to the data block.
complex_long_double value_type
A container must have a value_type.
const_reverse_iterator rend() const
Get iterator pointing beyond last block_complex_long_double element.
size_t size_type
A container must have a size_type.
size_type size() const
The size (number of elements) of the block_complex_long_double.
iterator begin()
Get iterator pointing to first block_complex_long_double element.
block_complex_long_double clone() const
The clone function.
const_iterator end() const
Get iterator pointing beyond last block_complex_long_double element.
~block_complex_long_double()
The destructor only deletes the pointers if count reaches zero.
iterator end()
Get iterator pointing beyond last block_complex_long_double element.
complex_long_double_ref reference
A container must have a reference type.
bool operator!=(block_complex_long_double const &v) const
Two block_complex_long_double objects are different equal if their elements are not identical.
reverse_iterator rbegin()
Get iterator pointing to first block_complex_long_double element.
bool operator<=(block_complex_long_double const &v) const
A container needs to define an ordering for sorting.
bool operator>=(block_complex_long_double const &v) const
A container needs to define an ordering for sorting.
bool operator==(block_complex_long_double const &v) const
Two block_complex_long_double objects are identically equal if their elements are identical.
iterator_t< true > reverse_iterator
The reverse_iterator type.
long double const * data() const
Give access to the data block.
This class can be used like a pointer for complex_long_double objects so that we can iterate over a v...
This class can be used like a reference for complex_long_double objects so that we can iterate over a...
This class handles complex_long_double numbers.
@ GSL_EFAILED
generic failure
int min(movstat::end_t const endtype, vector const &x, vector &y, workspace &w)
C++ version of gsl_movstat_min().
size_t n(workspace const &w)
C++ version of gsl_rstat_n().
gsl_sf_result result
Typedef for gsl_sf_result.
The gsl package creates an interface to the GNU Scientific Library for C++.