de.bezier.math.combinatorics
Class CombinationSet

java.lang.Object
  extended by de.bezier.math.combinatorics.CombinatoricsBase
      extended by de.bezier.math.combinatorics.CombinatoricsBaseSet
          extended by 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

Constructor Summary
CombinationSet(int elements)
           
CombinationSet(int elements, int from, int to)
           
 
Method Summary
 void rewind()
          Rewind, start over, reset, recycle.
 
Methods inherited from class de.bezier.math.combinatorics.CombinatoricsBaseSet
hasMore, next
 
Methods inherited from class de.bezier.math.combinatorics.CombinatoricsBase
nextAndStep, numberOfElements, position, positionAsInt, positionAsLong, positionInPercent, positionInPercent, total, totalAsInt, totalAsLong
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CombinationSet

public CombinationSet(int elements)

CombinationSet

public CombinationSet(int elements,
                      int from,
                      int to)
Method Detail

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