net.sourceforge.domian.test.combinatorics
Class Combination
java.lang.Object
net.sourceforge.domian.test.combinatorics.Sequence
net.sourceforge.domian.test.combinatorics.Combination
- All Implemented Interfaces:
- java.util.Iterator<int[]>
public class Combination
- extends Sequence
This class generates a list with number combinations according to a given length, n
, and number of elements, m
.
The combination list are zero-based.
The combinations of n
elements chosen from a list of m
elements, are the possible arrangements where each element only can appear once and the ordering of elements is not taken into consideration.
no: "Urnemodell - Uordnet utvalg uten tilbakelegging"
Med "uordnet" menes det at rekkefølgen som elementene er ordnet etter ikke tas hensyn til.
Med "uten tilbakelegging" menes det at ingen elementer kan forekomme mer enn én gang.
- Author:
- Eirik Torske
Field Summary |
private long |
C
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
C
private long C
Combination
public Combination(int n)
Combination
public Combination(int m,
int n)
calculateTotalNumberOfSequences
protected void calculateTotalNumberOfSequences()
- Overrides:
calculateTotalNumberOfSequences
in class Sequence
sequenceConstraintOk
protected boolean sequenceConstraintOk()
- Permutation constraint: No numbers in the number sequence can be similar, and numbers must be ascending/ordered.
- Overrides:
sequenceConstraintOk
in class Sequence
hasNext
public boolean hasNext()
- Specified by:
hasNext
in interface java.util.Iterator<int[]>
- Overrides:
hasNext
in class Sequence
Copyright © 2008-2010. All Rights Reserved.