KrisLibrary  1.0.0
Classes | Functions
combination.h File Reference

Various combination utilities. More...

#include <vector>
#include <KrisLibrary/errors.h>

Go to the source code of this file.

Classes

class  Combination
 A class that enumerates combinations. More...
 

Functions

void FirstCombination (std::vector< int > &v, int n)
 
void LastCombination (std::vector< int > &v, int n)
 
int NextCombination (std::vector< int > &v, int n)
 
int PrevCombination (std::vector< int > &v, int n)
 

Detailed Description

Various combination utilities.

A combination is defined by an array v (or a vector) of length k, with entries from 0 to n. Elements are sorted and unique.