|
ccgsl 2.7.2
C++wrappersforGnuScientificLibrary
|
This class handles GSL combination objects. More...
#include <combination.hpp>

Classes | |
| class | const_iterator_t |
| A class template for the const iterators. More... | |
| class | iterator_base |
| The container must have iterator types. More... | |
Public Types | |
| typedef const_iterator_t< false > | const_iterator |
| The const_iterator type. More... | |
| typedef const_iterator_t< true > | const_reverse_iterator |
| The const_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 | |
| combination () | |
| The default constructor is only really useful for assigning to. More... | |
| combination (size_t const n, size_t const k, bool init=false) | |
| This constructor creates a new combination with n elements from which k are chosen. More... | |
| combination (gsl_combination *v) | |
| Could construct from a gsl_combination. More... | |
| combination (combination const &v) | |
| The copy constructor. More... | |
| combination & | operator= (combination const &v) |
| The assignment operator. More... | |
| combination | clone () const |
| The clone function. More... | |
| ~combination () | |
| The destructor only deletes the pointers if count reaches zero. More... | |
| combination (combination &&v) | |
| Move constructor. More... | |
| combination & | operator= (combination &&v) |
| Move operator. More... | |
| gsl_combination * | get () |
| Get the gsl_combination. More... | |
| gsl_combination const * | get () const |
| Get the gsl_combination. More... | |
| bool | unique () const |
| Find if this is the only object sharing the gsl_combination. More... | |
| size_t | use_count () const |
| Find how many combination objects share this pointer. More... | |
| operator bool () const | |
| Allow conversion to bool. More... | |
| void | init_first () |
| C++ version of gsl_combination_init_first(). More... | |
| void | init_last () |
| C++ version of gsl_combination_init_last(). More... | |
| int | memcpy (combination const &src) |
| C++ version of gsl_combination_memcpy(). More... | |
| int | fread (FILE *stream) |
| C++ version of gsl_combination_fread(). More... | |
| int | fwrite (FILE *stream) const |
| C++ version of gsl_combination_fwrite(). More... | |
| int | fscanf (FILE *stream) |
| C++ version of gsl_combination_fscanf(). More... | |
| int | fprintf (FILE *stream, char const *format) const |
| C++ version of gsl_combination_fprintf(). More... | |
| size_t | n () const |
| C++ version of gsl_combination_n(): Size of set. More... | |
| size_t | k () const |
| C++ version of gsl_combination_k(): Number of selections. More... | |
| size_t * | data () |
| C++ version of gsl_combination_data(). More... | |
| int | valid () |
| C++ version of gsl_combination_valid(). More... | |
| int | next () |
| C++ version of gsl_combination_next(). More... | |
| int | prev () |
| C++ version of gsl_combination_prev(). More... | |
| size_t | get (size_t const i) const |
| C++ version of gsl_combination_get(). More... | |
| size_t | operator[] (size_t const i) const |
| C++ version of gsl_combination_get(). More... | |
| const_iterator | begin () const |
| Get iterator pointing to first combination element. More... | |
| const_iterator | end () const |
| Get iterator pointing beyond last combination element. More... | |
Static Public Member Functions | |
| static combination | calloc (size_t const n, size_t const k) |
| C++ version of gsl_combination_calloc(). More... | |
Private Attributes | |
| gsl_combination * | ccgsl_pointer |
| The shared pointer. More... | |
| size_t * | count |
| The shared reference count. More... | |
This class handles GSL combination objects.
Definition at line 33 of file combination.hpp.
| typedef const_iterator_t<false> gsl::combination::const_iterator |
The const_iterator type.
Definition at line 694 of file combination.hpp.
| typedef const_iterator_t<true> gsl::combination::const_reverse_iterator |
The const_reverse_iterator type.
Definition at line 698 of file combination.hpp.
A container must have a difference_type.
Definition at line 703 of file combination.hpp.
| typedef size_t gsl::combination::size_type |
A container must have a size_type.
Definition at line 708 of file combination.hpp.
|
inline |
The default constructor is only really useful for assigning to.
Definition at line 38 of file combination.hpp.
References ccgsl_pointer, and count.
Referenced by calloc().
|
inlineexplicit |
This constructor creates a new combination with n elements from which k are chosen.
| n | The number of elements in the selection set |
| k | The number of elements chosen |
| init | Set to true to have the combination initialised |
Definition at line 48 of file combination.hpp.
References ccgsl_pointer, count, gsl::cheb::init(), init_first(), k(), and n().
|
inlineexplicit |
Could construct from a gsl_combination.
This is not usually a good idea. In this case you should not use gsl_combination_free() to deallocate the memory.
| v | The combination |
Definition at line 64 of file combination.hpp.
References ccgsl_pointer, and count.
|
inline |
The copy constructor.
This shares the combination. Use clone() if you want a full copy.
| v | The combination to copy. |
Definition at line 75 of file combination.hpp.
References count.
|
inline |
The destructor only deletes the pointers if count reaches zero.
Definition at line 112 of file combination.hpp.
References ccgsl_pointer, and count.
|
inline |
Move constructor.
| v | The combination to move. |
Definition at line 124 of file combination.hpp.
References count.
|
inline |
Get iterator pointing to first combination element.
Definition at line 714 of file combination.hpp.
|
inlinestatic |
C++ version of gsl_combination_calloc().
| n | The number of elements in the selection set |
| k | The number of elements chosen |
Definition at line 188 of file combination.hpp.
References combination(), k(), and n().
|
inline |
The clone function.
Use this if you want a copy of the combination that does not share the underlying data.
Definition at line 101 of file combination.hpp.
|
inline |
C++ version of gsl_combination_data().
Definition at line 244 of file combination.hpp.
References get().
|
inline |
Get iterator pointing beyond last combination element.
Definition at line 722 of file combination.hpp.
References ccgsl_pointer, and k().
|
inline |
C++ version of gsl_combination_fprintf().
| stream | An output stream |
| format | A print format: typically "%zu\n" |
Definition at line 228 of file combination.hpp.
References get().
|
inline |
C++ version of gsl_combination_fread().
| stream | An output stream |
Definition at line 209 of file combination.hpp.
References get().
|
inline |
C++ version of gsl_combination_fscanf().
| stream | An output stream |
Definition at line 221 of file combination.hpp.
References get().
|
inline |
C++ version of gsl_combination_fwrite().
| stream | An output stream |
Definition at line 215 of file combination.hpp.
References get().
|
inline |
Get the gsl_combination.
Definition at line 154 of file combination.hpp.
References ccgsl_pointer.
Referenced by clone(), data(), fprintf(), fread(), fscanf(), fwrite(), init_first(), init_last(), k(), memcpy(), n(), next(), operator[](), prev(), and valid().
|
inline |
Get the gsl_combination.
Definition at line 159 of file combination.hpp.
References ccgsl_pointer.
|
inline |
C++ version of gsl_combination_get().
| i | index of element |
i Definition at line 265 of file combination.hpp.
References get().
Referenced by get().
|
inline |
C++ version of gsl_combination_init_first().
Definition at line 193 of file combination.hpp.
References get().
Referenced by combination().
|
inline |
C++ version of gsl_combination_init_last().
Definition at line 197 of file combination.hpp.
References get().
|
inline |
C++ version of gsl_combination_k(): Number of selections.
Definition at line 239 of file combination.hpp.
References get().
Referenced by calloc(), clone(), combination(), and end().
|
inline |
C++ version of gsl_combination_memcpy().
| src | The combination to copy |
Definition at line 203 of file combination.hpp.
References get().
|
inline |
C++ version of gsl_combination_n(): Size of set.
Definition at line 234 of file combination.hpp.
References get().
Referenced by calloc(), clone(), combination(), gsl::combination::const_iterator_t< reverse >::operator+(), gsl::combination::const_iterator_t< reverse >::operator-(), gsl::combination::iterator_base< container, content, reverse >::operator[](), and gsl::combination::iterator_base< container, content, reverse >::shift().
|
inline |
C++ version of gsl_combination_next().
Definition at line 254 of file combination.hpp.
References get().
|
inlineexplicit |
Allow conversion to bool.
true or false according as this contains a pointer to a gsl_combination Definition at line 179 of file combination.hpp.
References ccgsl_pointer.
|
inline |
Move operator.
| v | The combination to move. |
Definition at line 133 of file combination.hpp.
References ccgsl_pointer, and count.
|
inline |
The assignment operator.
This makes a shared copy.
| v | The combination to copy |
Definition at line 83 of file combination.hpp.
References ccgsl_pointer, and count.
|
inline |
C++ version of gsl_combination_get().
| i | index of element |
i Definition at line 271 of file combination.hpp.
References get().
|
inline |
C++ version of gsl_combination_prev().
Definition at line 259 of file combination.hpp.
References get().
|
inline |
Find if this is the only object sharing the gsl_combination.
true or falses according as this is the only combination object sharing the gsl_combination Definition at line 165 of file combination.hpp.
References count.
|
inline |
Find how many combination objects share this pointer.
Definition at line 170 of file combination.hpp.
References count.
|
inline |
C++ version of gsl_combination_valid().
Definition at line 249 of file combination.hpp.
References get().
|
private |
The shared pointer.
Definition at line 143 of file combination.hpp.
Referenced by combination(), end(), get(), operator bool(), gsl::combination::const_iterator_t< reverse >::operator<(), operator=(), and ~combination().
|
private |
The shared reference count.
Definition at line 147 of file combination.hpp.
Referenced by combination(), operator=(), unique(), use_count(), and ~combination().