|
ant
A2 ant: class-based analysis framework
|
KofNvector class: Generate all combinations when drawing k elements out of a vector. More...
#include <Combinatorics.h>
Collaboration diagram for ant::analysis::utils::NchooseK< T >:Classes | |
| class | const_iterator |
| Iterator over the elements of a combination. Used to iterate over the current combination. More... | |
Public Types | |
| typedef T | value_type |
Public Member Functions | |
| NchooseK (const std::vector< T > &data, index_type k) | |
| KofNvector. More... | |
| const T & | at (const size_t i) const |
| Access the ith element of the currently drawn combination. More... | |
| bool | next () |
| Generate the next combination. More... | |
| const_iterator | begin () const |
| const_iterator | end () const |
| const index_list & | Indices () const |
| NchooseK< T > & | operator++ () |
| bool | done () const |
| std::size_t | size () const |
| std::size_t | k () const |
| k More... | |
| std::size_t | n () const |
| n More... | |
Protected Types | |
| using | index_type = std::size_t |
| using | index_list = std::vector< index_type > |
Protected Member Functions | |
| bool | nextlevel (index_type i) |
Protected Attributes | |
| const std::vector< T > | _data |
| index_list | indices |
| bool | _done |
KofNvector class: Generate all combinations when drawing k elements out of a vector.
Elements are kept in the order they were in inside the data vector.
No duplicate combinations.
No duplicate elements (drawing without putting back).
|
protected |
|
protected |
| typedef T ant::analysis::utils::NchooseK< T >::value_type |
|
inline |
KofNvector.
| _data | The std::vector to draw from |
| k | number of elemets to draw each time |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
k
|
inline |
n
|
inline |
Generate the next combination.
|
inlineprotected |
|
inline |
|
inline |
|
protected |
|
protected |
|
protected |