net.sourceforge.domian.test.combinatorics
Class Permutation
java.lang.Object
net.sourceforge.domian.test.combinatorics.Sequence
net.sourceforge.domian.test.combinatorics.Permutation
- All Implemented Interfaces:
- java.util.Iterator<int[]>
public class Permutation
- extends Sequence
This class generates a list with number permutations according to a given length, n
, and number of elements, m
.
The permuation list are zero-based.
The permutations 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 taken into consideration.
no: "Urnemodell - Ordnet utvalg uten tilbakelegging"
Med "ordnet" menes det at rekkefølgen som elementene er ordnet etter tas hensyn til.
Med "uten tilbakelegging" menes det at ingen elementer kan forekomme mer enn én gang.
- Author:
- Eirik Torske
Field Summary |
private long |
P
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
P
private long P
Permutation
public Permutation(int n)
Permutation
public Permutation(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.
- 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.