|
ccgsl 2.7.2
C++wrappersforGnuScientificLibrary
|
This class handles vectors as shared handles. More...
#include <block.hpp>

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 double | value_type |
| A container must have a value_type. More... | |
| typedef value_type & | reference |
| 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_type * | pointer |
| 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_iterator 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 | |
| block () | |
| The default constructor is only really useful for assigning to. More... | |
| block (size_t const n) | |
| The default constructor creates a new block with n elements. More... | |
| block (gsl_block *v) | |
| Could construct from a gsl_block. More... | |
| block (std::initializer_list< double > initializer_list) | |
| Could construct from a std::initializer_list in C++11. More... | |
| block (block const &v) | |
| The copy constructor. More... | |
| block & | operator= (block const &v) |
| The assignment operator. More... | |
| block | clone () const |
| The clone function. More... | |
| ~block () | |
| The destructor only deletes the pointers if count reaches zero. More... | |
| void | reset () |
| Stop sharing ownership of the shared pointer. More... | |
| block (block &&v) | |
| Move constructor. More... | |
| block & | operator= (block &&v) |
| Move operator. More... | |
| bool | operator== (block const &v) const |
| Two block objects are identically equal if their elements are identical. More... | |
| bool | operator!= (block const &v) const |
| Two block objects are different equal if their elements are not identical. More... | |
| bool | operator< (block const &v) const |
| A container needs to define an ordering for sorting. More... | |
| bool | operator> (block const &v) const |
| A container needs to define an ordering for sorting. More... | |
| bool | operator<= (block const &v) const |
| A container needs to define an ordering for sorting. More... | |
| bool | operator>= (block const &v) const |
| A container needs to define an ordering for sorting. More... | |
| iterator | begin () |
| Get iterator pointing to first block element. More... | |
| const_iterator | begin () const |
| Get iterator pointing to first block element. More... | |
| iterator | end () |
| Get iterator pointing beyond last block element. More... | |
| const_iterator | end () const |
| Get iterator pointing beyond last block element. More... | |
| size_type | size () const |
| The size (number of elements) of the block. More... | |
| double * | data () |
| Give access to the data block. More... | |
| double const * | data () const |
| Give access to the data block. More... | |
| size_type | max_size () const |
| The max size (number of elements) of the block. More... | |
| bool | empty () const |
| Find if the block is empty. More... | |
| void | swap (block &v) |
| Swap two block objects. More... | |
| reverse_iterator | rbegin () |
| Get iterator pointing to first block element. More... | |
| const_reverse_iterator | rbegin () const |
| Get iterator pointing to first block element. More... | |
| reverse_iterator | rend () |
| Get iterator pointing beyond last block element. More... | |
| const_reverse_iterator | rend () const |
| Get iterator pointing beyond last block element. More... | |
| double & | operator[] (size_t const n) |
Get element at position n by reference ([] operator). More... | |
| double const & | operator[] (size_t const n) const |
Get element at position n by reference ([] operator). More... | |
| gsl_block * | get () const |
| Get the gsl_block. More... | |
| bool | unique () const |
| Find if this is the only object sharing the gsl_block. More... | |
| size_t | use_count () const |
| Find how many block objects share this pointer. More... | |
| operator bool () const | |
| Allow conversion to bool. More... | |
Private Attributes | |
| gsl_block * | ccgsl_pointer |
| The shared pointer. More... | |
| size_t * | count |
| The shared reference count. More... | |
This class handles vectors as shared handles.
It models a random access container so that STL functions work with block.
| typedef const_iterator_t<false> gsl::block::const_iterator |
| typedef value_type const* gsl::block::const_pointer |
| typedef value_type const& gsl::block::const_reference |
| typedef const_iterator_t<true> gsl::block::const_reverse_iterator |
| typedef iterator_t<false> gsl::block::iterator |
| typedef value_type* gsl::block::pointer |
| typedef value_type& gsl::block::reference |
| typedef iterator_t<true> gsl::block::reverse_iterator |
| typedef size_t gsl::block::size_type |
| typedef double gsl::block::value_type |
|
inline |
The default constructor is only really useful for assigning to.
Definition at line 47 of file block.hpp.
References ccgsl_pointer, and count.
Referenced by operator=(), and reset().
|
inlineexplicit |
The default constructor creates a new block with n elements.
| n | The number of elements in the block |
Definition at line 57 of file block.hpp.
References ccgsl_pointer, count, and gsl::rstat::n().
|
inlineexplicit |
Could construct from a gsl_block.
This is not usually a good idea. In this case you should not use gsl_block_free() to deallocate the memory.
| v | The block |
Definition at line 79 of file block.hpp.
References ccgsl_pointer, and count.
|
inline |
Could construct from a std::initializer_list in C++11.
| initializer_list | The initializer_list. |
Definition at line 90 of file block.hpp.
References begin(), ccgsl_pointer, count, and gsl::rstat::n().
|
inline |
|
inline |
The destructor only deletes the pointers if count reaches zero.
Definition at line 150 of file block.hpp.
References ccgsl_pointer, and count.
|
inline |
|
inline |
|
inline |
|
inline |
The clone function.
Use this if you want a copy of the block that does not share the underlying data.
Definition at line 139 of file block.hpp.
References ccgsl_pointer.
|
inline |
Give access to the data block.
The data() and size() functions mimic the functions of std::array<T> and std::vector<T>.
Definition at line 1049 of file block.hpp.
References ccgsl_pointer.
|
inline |
Give access to the data block.
The data() and size() functions mimic the functions of std::array<T> and std::vector<T>.
Definition at line 1057 of file block.hpp.
References ccgsl_pointer.
|
inline |
Find if the block is empty.
true if has size zero; otherwise false Definition at line 1072 of file block.hpp.
References ccgsl_pointer.
|
inline |
Get iterator pointing beyond last block element.
Definition at line 1026 of file block.hpp.
References ccgsl_pointer, and size().
|
inline |
Get iterator pointing beyond last block element.
Definition at line 1034 of file block.hpp.
References ccgsl_pointer, and size().
|
inline |
Get the gsl_block.
Definition at line 1178 of file block.hpp.
References ccgsl_pointer.
|
inline |
The max size (number of elements) of the block.
Identical to size but required for a container.
Definition at line 1066 of file block.hpp.
References ccgsl_pointer.
|
inlineexplicit |
Allow conversion to bool.
true or false according as this contains a pointer to a gsl_block Definition at line 1198 of file block.hpp.
References ccgsl_pointer.
|
inline |
Two block objects are different equal if their elements are not identical.
| v | The block to be compared with this |
false or true according as this and v have identical elements or not Definition at line 209 of file block.hpp.
References operator==().
|
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 block is nonnegative.
| v | The block to be compared with this |
false or true according as this is less than v lexicographically Definition at line 221 of file block.hpp.
References ccgsl_pointer, gsl::movstat::min(), and size().
Referenced by operator<=().
|
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 block is nonnegative.
| v | The block to be compared with this |
false or true according as this is less than or equal to v lexicographically Definition at line 275 of file block.hpp.
References operator<(), and operator==().
The assignment operator.
This makes a shared copy.
| v | The block to copy |
Definition at line 119 of file block.hpp.
References ccgsl_pointer, and count.
|
inline |
Two block objects are identically equal if their elements are identical.
| v | The block to be compared with this |
true or false according as this and v have identical elements or not Definition at line 190 of file block.hpp.
References ccgsl_pointer.
Referenced by operator!=(), operator<=(), and operator>=().
|
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 block is nonnegative.
| v | The block to be compared with this |
false or true according as this is greater than v lexicographically Definition at line 248 of file block.hpp.
References ccgsl_pointer, gsl::movstat::min(), and size().
Referenced by operator>=().
|
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 block is nonnegative.
| v | The block to be compared with this |
false or true according as this is no less than v lexicographically Definition at line 287 of file block.hpp.
References operator==(), and operator>().
|
inline |
Get element at position n by reference ([] operator).
| n | The position of the element |
Definition at line 1122 of file block.hpp.
References ccgsl_pointer, gsl::exception::GSL_EFAULT, gsl::exception::GSL_EINVAL, gsl::rstat::n(), and size().
|
inline |
Get element at position n by reference ([] operator).
| n | The position of the element |
Definition at line 1145 of file block.hpp.
References ccgsl_pointer, gsl::exception::GSL_EFAULT, gsl::exception::GSL_EINVAL, gsl::rstat::n(), and size().
|
inline |
Get iterator pointing to first block element.
Definition at line 1089 of file block.hpp.
References ccgsl_pointer, and size().
|
inline |
Get iterator pointing to first block element.
Definition at line 1097 of file block.hpp.
References ccgsl_pointer, and size().
|
inline |
|
inline |
|
inline |
|
inline |
The size (number of elements) of the block.
Definition at line 1043 of file block.hpp.
References ccgsl_pointer.
Referenced by end(), operator<(), operator>(), operator[](), and rbegin().
|
inline |
Swap two block objects.
This works even if the block objects have different sizes because it swaps pointers.
| v | The block to swap with this. |
Definition at line 1079 of file block.hpp.
References ccgsl_pointer, and count.
|
inline |
|
inline |
|
private |
The shared pointer.
Definition at line 1167 of file block.hpp.
Referenced by block(), clone(), data(), empty(), end(), get(), max_size(), operator bool(), gsl::block::iterator_t< reverse >::operator-(), gsl::block::const_iterator_t< reverse >::operator-(), operator<(), gsl::block::iterator_t< reverse >::operator<(), gsl::block::const_iterator_t< reverse >::operator<(), operator=(), operator==(), operator>(), operator[](), rbegin(), size(), swap(), and ~block().
|
private |
The shared reference count.
Definition at line 1171 of file block.hpp.
Referenced by block(), operator=(), swap(), unique(), use_count(), and ~block().