Class SublistGenerator

java.lang.Object
edu.cmu.tetrad.util.SublistGenerator

public final class SublistGenerator extends Object
Generates (nonrecursively) all of the sublists of size b from a list of size a, where a, b are nonnegative integers and a >= b. The values of a and b are given in the constructor, and the sequence of sublists is obtained by repeatedly calling the next() method. When the sequence is finished, null is returned.

A valid combination for the sublists generated by this class is an array x[] of b integers i, 0 <= i < a, such that x[j] < x[j + 1] for each j from 0 to b - 1.

Works by calling ChoiceGenerator with increasingly larger values of a.

To see what this class does, try calling ChoiceGenerator.testPrint(5, 3), for instance.

Version:
$Id: $Id
Author:
josephramsey