Combinations Class Reference

#include <Combinations.h>

List of all members.

Public Member Functions

 Combinations (unsigned int n, unsigned int k)
 ~Combinations ()
bool start (IndexSet &indexes)
bool next (IndexSet &indexes)
bool done ()


Detailed Description

Generates sequentially all combinations of "n taken k", i.e. sorted sequences of k integers in the range [0,n)

Definition at line 20 of file Combinations.h.


Constructor & Destructor Documentation

Combinations::Combinations ( unsigned int  n,
unsigned int  k 
) [inline]

Constructor

Parameters:
n determines the maximum integer (n - 1) that can apear in the generated sequences
k determines the length of the generated sequences

Definition at line 30 of file Combinations.h.

Combinations::~Combinations (  )  [inline]

Destructor

Definition at line 43 of file Combinations.h.


Member Function Documentation

bool Combinations::start ( IndexSet indexes  )  [inline]

Initialize a Combinations object to the first available combination.

Parameters:
indexes an IndexSet that will hold the first combination
Returns:
true if first combination was fetched succesfully and enumeration of combinations can continue, false otherwise.

Definition at line 53 of file Combinations.h.

References IndexSet::setData().

Referenced by FiniteGroup< T, BinaryFunction >::getSubGroups().

Here is the call graph for this function:

Here is the caller graph for this function:

bool Combinations::next ( IndexSet indexes  )  [inline]

Generate the next combination.

Parameters:
indexes an IndexSet that will hold the next combination
Returns:
true if there are more combinations in the enumeration.

Definition at line 73 of file Combinations.h.

References IndexSet::setData().

Referenced by FiniteGroup< T, BinaryFunction >::getSubGroups().

Here is the call graph for this function:

Here is the caller graph for this function:

bool Combinations::done (  )  [inline]

Tell if there are any more combinations to enumerate.

Returns:
true if there are more combinations in the enumeration and false otherwise

Definition at line 107 of file Combinations.h.


The documentation for this class was generated from the following file:
Math-Objects Library Docs  Generated by: doxygen