Features
Public Member Functions | List of all members
combination_t Class Reference

Public Member Functions

 combination_t (combination_element_t n, combination_element_t k)
 
void initialize ()
 
combination_element_t k () const
 
combination_element_t n () const
 
bool next ()
 
std::vector< combination_element_toperator() () const
 

Detailed Description

Exemplars of this class allow to systematically generate all combinations for n elements and sample size k.

Constructor & Destructor Documentation

◆ combination_t()

combination_t::combination_t ( combination_element_t  n,
combination_element_t  k 
)
inline

A combination exemplar must be initialized with number of elements and sample size.

Parameters
nNumber of elements.
kSample size.

Member Function Documentation

◆ initialize()

void combination_t::initialize ( )
inline

Creates initial valid state for a combination_t exemplar.

◆ k()

combination_element_t combination_t::k ( ) const
inline

Returns sample size.

Returns
Sample size.

◆ n()

combination_element_t combination_t::n ( ) const
inline

Returns number of elements.

Returns
Number of elements.

◆ next()

bool combination_t::next ( )
inline

Tries to generate next combination.

Returns
True, if next combination is available, and false otherwise.
Here is the caller graph for this function:

◆ operator()()

std::vector<combination_element_t> combination_t::operator() ( ) const
inline

Returns vector that containes the elements of the actual combination.

Returns
Copy of internal state of combination as vector.

The documentation for this class was generated from the following file: