CMR  1.3.0
Public Member Functions | Protected Attributes | List of all members
tu::combination Class Reference

#include <combinations.hpp>

Public Member Functions

 combination (size_t n, size_t k)
 Init with (1, ..., 1, 0, ..., 0) More...
 
size_t operator[] (size_t index) const
 Where is the index's 1 entry? More...
 
size_t n () const
 
size_t k () const
 
bool is_last () const
 
void next ()
 

Protected Attributes

std::vector< size_t > _data
 
size_t _size
 

Constructor & Destructor Documentation

◆ combination()

tu::combination::combination ( size_t  n,
size_t  k 
)
inline

Init with (1, ..., 1, 0, ..., 0)

Member Function Documentation

◆ is_last()

bool tu::combination::is_last ( ) const
inline

Is this the last, i.e. (0, ..., 0, 1, ..., 1) ? Time: O(1)

◆ k()

size_t tu::combination::k ( ) const
inline

◆ n()

size_t tu::combination::n ( ) const
inline

◆ next()

void tu::combination::next ( )
inline

Compute the next combination. Time: O(k)

◆ operator[]()

size_t tu::combination::operator[] ( size_t  index) const
inline

Where is the index's 1 entry?

Member Data Documentation

◆ _data

std::vector<size_t> tu::combination::_data
protected

◆ _size

size_t tu::combination::_size
protected

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