SubsetDeltaGenerator Class Reference

Generates SubsetDelta structs for subsets of fixed length. More...

#include <SubsetDeltaGenerator.hpp>

List of all members.

Public Member Functions

 SubsetDeltaGenerator (unsigned int n)
 Constructor. Initializes generator for subsets of fixed size of the set { 0, 1, 2, 3, ..., n - 1 }.
 ~SubsetDeltaGenerator ()
 Destructor. Called automatically, cleans up memory used by the object.
void getDeltasForSubsetsOfFixedLength (unsigned int k, std::vector< SubsetDelta > &deltas)
 Compute a list of minimum changes needed to change one subset to the next in the list. Starting with the subset { 0, 1, 2, ..., k - 1 }, each SubsetDelta struct indicates what item needs to be replaced, and what to replace it with in order to get the next subset in the list.

Detailed Description

Generates SubsetDelta structs for subsets of fixed length.

Uses the algorithm described in the paper "An Algorithm for Generating Subsets of Fixed Size with a Strong Minimal Change Property" by Peter Eades and Brendan McKay.

Definition at line 28 of file SubsetDeltaGenerator.hpp.


Constructor & Destructor Documentation

SubsetDeltaGenerator::SubsetDeltaGenerator ( unsigned int  n  ) 

Constructor. Initializes generator for subsets of fixed size of the set { 0, 1, 2, 3, ..., n - 1 }.

Parameters:
n Number of items in the set to make subsets of.

Definition at line 11 of file SubsetDeltaGenerator.cpp.


Member Function Documentation

void SubsetDeltaGenerator::getDeltasForSubsetsOfFixedLength ( unsigned int  k,
std::vector< SubsetDelta > &  deltas 
)

Compute a list of minimum changes needed to change one subset to the next in the list. Starting with the subset { 0, 1, 2, ..., k - 1 }, each SubsetDelta struct indicates what item needs to be replaced, and what to replace it with in order to get the next subset in the list.

Parameters:
k Desired fixed size for the subsets.
deltas Vector which will hold the deltas as described above.
Precondition:
k should satisfy 0 <= k <= n.
Postcondition:
deltas will contain the SubsetDeltas describing the minimum changes between subsets.

Definition at line 27 of file SubsetDeltaGenerator.cpp.


The documentation for this class was generated from the following files:
 All Classes Files Functions
Generated on Mon Apr 1 10:56:03 2013 by  doxygen 1.6.3