de.bezier.math.combinatorics
Class Variation

java.lang.Object
  extended by de.bezier.math.combinatorics.CombinatoricsBase
      extended by de.bezier.math.combinatorics.Variation

public class Variation
extends CombinatoricsBase

Like a counter, duplications, order counts

A Variation represents all possible variations of a given set of elements. This includes duplications ("a,a,a" is OK) and the order is important ("a,b" is not "b,a" and each is counted).


Constructor Summary
Variation(int elements)
          Same as using Variation( elements, elements )
Variation(int elements, int length)
           
 
Method Summary
 boolean hasMore()
          Check if there are more results available to be read.
 int[] next()
          Return next result and update internal counter.
 void rewind()
          Rewind, start over, reset, recycle.
 
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

Variation

public Variation(int elements)
Same as using Variation( elements, elements )


Variation

public Variation(int elements,
                 int length)
Parameters:
elements - Number of elements to return variations for, should be larger than 0
length - Length of the results (arrays of indices) to return, should not be negative
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

hasMore

public boolean hasMore()
Description copied from class: CombinatoricsBase
Check if there are more results available to be read. To be implements by the real workers.

Specified by:
hasMore in class CombinatoricsBase

next

public int[] next()
Description copied from class: CombinatoricsBase
Return next result and update internal counter. To be implements by the real workers.

Specified by:
next in class CombinatoricsBase


processing library Combinatorics by Florian Jenett. (c) 2010-2011