21#ifndef CCGSL_BLOCK_COMPLEX_FLOAT_HPP
22#define CCGSL_BLOCK_COMPLEX_FLOAT_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_floats", __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_floats", __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_floats", __FILE__, __LINE__,
726 if( this->
v == 0 or i.
v == 0 ){
732 gsl_error(
"trying to take difference of iterators for different block_complex_floats", __FILE__, __LINE__,
757 :
public iterator_base<block_complex_float const,float,reverse>{
874 if( this->
v == 0 or i.
v == 0 ){
883 gsl_error(
"trying to take difference of iterators for different block_complex_floats", __FILE__, __LINE__,
924 if( this->
v == 0 or i.
v == 0 ){
930 gsl_error(
"trying to take difference of iterators for different block_complex_floats", __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_float", __FILE__, __LINE__,
exception::GSL_EFAILED );
1156#ifndef GSL_RANGE_CHECK_OFF
1159 gsl_error(
"trying to read beyond end of block_complex_float", __FILE__, __LINE__,
exception::GSL_EFAILED );
1198#ifdef __GXX_EXPERIMENTAL_CXX0X__
A class template for the const iterators.
const_iterator_t< reverse > operator--(int)
The postfix – operator.
const_iterator_t(iterator_t< reverse > const &i)
A copy constructor.
const_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.
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.
bool operator!=(iterator_t< reverse > const &i) const
Comparison with non-const iterator.
const_iterator_t< reverse > & operator--()
The prefix – operator.
const_iterator_t< reverse > operator-(difference_type const n) const
The - operator: subtract distance from iterator.
bool operator!=(const_iterator_t< reverse > const &i) const
Comparison with const iterator.
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.
difference_type operator-(iterator_t< reverse > const &i) const
The - operator: find distance between two iterators.
iterator_base< block_complex_floatconst, float, reverse >::difference_type difference_type
Difference type.
const_iterator_t< reverse > & operator-=(difference_type const n)
The -= operator.
bool operator<(const_iterator_t< reverse > const &i) const
Comparison with const iterator.
const_iterator_t()
The default constructor.
const_iterator_t(block_complex_float const *v, difference_type position)
This constructor allows block_complex_float to create non-default iterators.
bool operator<(iterator_t< reverse > const &i) const
Comparison with non-const iterator.
bool operator==(const_iterator_t< reverse > const &i) const
Comparison with const iterator.
The container must have iterator types.
bool operator!=(iterator_base< container, content, reverse > const &i) const
The != operator.
complex_float_ref reference
An iterator must have a reference type.
std::random_access_iterator_tag iterator_category
An iterator must have a pointer type.
difference_type operator-(iterator_base< container, content, reverse > const &i) const
The - operator: find distance between two iterators.
ptrdiff_t difference_type
An iterator must have a difference_type.
bool operator<(iterator_base< container, content, reverse > const &i) const
The < operator is used to compare iterators.
reference operator*() const
Dereference the pointer.
void increment()
Increment the iterator.
iterator_base()
The iterator is default constructible.
container * v
Store a pointer to a block_complex_float we can iterate over: 0 if no block_complex_float.
pointer operator->() const
Dereference the pointer.
void decrement()
Derement the iterator.
iterator_base(container *v, difference_type position)
This constructor allows block_complex_float to create non-default iterators.
bool operator==(iterator_base< container, content, reverse > const &i) const
The == operator.
complex_float_ptr pointer
An iterator must have a pointer type.
reference operator[](difference_type const n) const
Get element at i + n by reference ([] operator).
complex_float value_type
An iterator must have a value_type.
void shift(difference_type const n)
Shift iterator n places.
difference_type position
Mark position of iterator within block_complex_float.
A class template for the two non-const 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.
iterator_t< reverse > operator-(difference_type const n) const
The - operator: subtract distance from iterator.
difference_type operator-(const_iterator_t< reverse > const &i) const
The - operator: find distance between two iterators.
iterator_t< reverse > operator--(int)
The postfix – operator.
iterator_t< reverse > & operator++()
The prefix ++ operator.
iterator_t(block_complex_float *v, difference_type position)
This constructor allows block_complex_float to create non-default iterators.
bool operator!=(const_iterator_t< reverse > const &i) const
Comparison with const iterator.
iterator_t< reverse > operator++(int)
The postfix ++ operator.
iterator_base< block_complex_float, float, reverse >::difference_type difference_type
Difference type.
iterator_t()
The default constructor.
iterator_t< reverse > & operator--()
The prefix – operator.
iterator_t< reverse > operator+(difference_type const n) const
The + operator.
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.
difference_type operator-(iterator_t< reverse > const &i) const
The - operator: find distance between two iterators.
iterator_t< reverse > & operator-=(difference_type const n)
The -= operator.
This class handles vector_complex_floats as shared handles.
const_reverse_iterator rend() const
Get iterator pointing beyond last block_complex_float element.
const_iterator begin() const
Get iterator pointing to first block_complex_float element.
const_iterator::difference_type difference_type
A container must have a difference_type.
size_t use_count() const
Find how many block_complex_float objects share this pointer.
bool operator>=(block_complex_float const &v) const
A container needs to define an ordering for sorting.
reference operator[](size_t const n)
Get element at position n by reference ([] operator).
const_iterator_t< true > const_reverse_iterator
The const_reverse_iterator type.
bool operator<(block_complex_float const &v) const
A container needs to define an ordering for sorting.
size_type max_size() const
The max size (number of elements) of the block_complex_float.
block_complex_float(size_t const n)
The default constructor creates a new block_complex_float with n elements.
block_complex_float(gsl_block_complex_float *v)
Could construct from a gsl_block_complex_float.
block_complex_float clone() const
The clone function.
const_reverse_iterator rbegin() const
Get iterator pointing to first block_complex_float element.
float * data()
Give access to the data block.
~block_complex_float()
The destructor only deletes the pointers if count reaches zero.
bool operator==(block_complex_float const &v) const
Two block_complex_float objects are identically equal if their elements are identical.
void swap(block_complex_float &v)
Swap two block_complex_float objects.
const_iterator end() const
Get iterator pointing beyond last block_complex_float element.
reference const const_reference
A container must have a constant reference type.
void reset()
Stop sharing ownership of the shared pointer.
reverse_iterator rend()
Get iterator pointing beyond last block_complex_float element.
bool unique() const
Find if this is the only object sharing the gsl_block_complex_float.
block_complex_float & operator=(block_complex_float &&v)
Move operator.
bool operator>(block_complex_float const &v) const
A container needs to define an ordering for sorting.
block_complex_float(block_complex_float const &v)
The copy constructor.
iterator_t< true > reverse_iterator
The reverse_iterator type.
bool empty() const
Find if the block_complex_float is empty.
const_reference operator[](size_t const n) const
Get element at position n by reference ([] operator).
gsl_block_complex_float * get() const
Get the gsl_block_complex_float.
complex_float value_type
A container must have a value_type.
const_iterator_t< false > const_iterator
The const_iterator type.
size_type size() const
The size (number of elements) of the block_complex_float.
iterator_t< false > iterator
The iterator type.
float const * data() const
Give access to the data block.
block_complex_float & operator=(block_complex_float const &v)
The assignment operator.
iterator end()
Get iterator pointing beyond last block_complex_float element.
reverse_iterator rbegin()
Get iterator pointing to first block_complex_float element.
complex_float_ref reference
A container must have a reference type.
complex_float_ptr pointer
A container must have a pointer type.
gsl_block_complex_float * ccgsl_pointer
The shared pointer.
size_t size_type
A container must have a size_type.
block_complex_float(block_complex_float &&v)
Move constructor.
bool operator!=(block_complex_float const &v) const
Two block_complex_float objects are different equal if their elements are not identical.
block_complex_float()
The default constructor is only really useful for assigning to.
size_t * count
The shared reference count.
complex_float_ptr const const_pointer
A container must have a constant pointer type.
iterator begin()
Get iterator pointing to first block_complex_float element.
bool operator<=(block_complex_float const &v) const
A container needs to define an ordering for sorting.
block_complex_float(std::initializer_list< std::complex< float > > initializer_list)
Could construct from a std::initializer_list in C++11.
This class can be used like a pointer for complex_float objects so that we can iterate over a vector ...
This class can be used like a reference for complex_float objects so that we can iterate over a vecto...
This class handles complex_float numbers.
@ GSL_EFAILED
generic failure
@ GSL_EFAULT
invalid pointer
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++.