de.bezier.math.combinatorics
Class CombinationSet
java.lang.Object
de.bezier.math.combinatorics.CombinatoricsBase
de.bezier.math.combinatorics.CombinatoricsBaseSet
de.bezier.math.combinatorics.CombinationSet
public class CombinationSet
- extends CombinatoricsBaseSet
A range of Combinations
A CombinationSet represents a range of Combinations, for example:
CombinationSet cset = new CombinationSet( 3 );
would represent (and loop thru the results of) these single Combinations:
{
new Combination( 3, 0 ), // [], empty
new Combination( 3, 1 ), // [0], [1], [2]
new Combination( 3, 2 ), // [0,1], [0,2], [1,2]
new Combination( 3, 3 ) // [0,1,2]
}
If you were just interessted in results of lengths 1 and 2 you could:
CombinationSet cset = new CombinationSet( 3, 1, 2 ); // 3 elements, starting at lenghts 1, ends at length 2
which then would only represent these Combinations:
{
new Combination( 3, 1 ), // [0], [1], [2]
new Combination( 3, 2 ), // [0,1], [0,2], [1,2]
}
- See Also:
Combination
Method Summary |
void |
rewind()
Rewind, start over, reset, recycle. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CombinationSet
public CombinationSet(int elements)
CombinationSet
public CombinationSet(int elements,
int from,
int to)
rewind
public void rewind()
- Description copied from class:
CombinatoricsBase
- Rewind, start over, reset, recycle.
To be implements by the real workers.
- Specified by:
rewind
in class CombinatoricsBase
processing library Combinatorics by Florian Jenett. (c) 2010-2011