Package edu.cmu.tetrad.util
Class SelectionGenerator
java.lang.Object
edu.cmu.tetrad.util.SelectionGenerator
Generates (nonrecursively) all of the selections from a items, where a is
 a nonnegative integer.  The values of a is given in the
 constructor, and the sequence of seletions is obtained by repeatedly calling
 the next() method.  When the sequence is finished, null is returned.> 0
 
A valid combination for the sequence of combinations for a generated by this class is an array x[] of a integers i, 0 <= i < a.
To see what this class does, try calling SelectionGenerator.testPrint(5, 3), for instance.
- Author:
- Joseph Ramsey
- 
Constructor SummaryConstructors
- 
Method Summary
- 
Constructor Details- 
SelectionGeneratorpublic SelectionGenerator(int a) Constructs a new selection generator for a items. Once this initialization has been performed, successive calls to next() will produce the series of selections.- Parameters:
- a- the number of objects being selected from.
 
 
- 
- 
Method Details- 
nextpublic int[] next()- Returns:
- the next selection in the series, or null if the series is finished.
 
- 
testPrintpublic static void testPrint(int a) This static method will print the series of combinations for a choose b to System.out.- Parameters:
- a- the number of objects being selected from.
 
- 
getApublic int getA()- Returns:
- Ibid.
 
 
-