public class PermutationGen extends Object
Constructor and Description |
---|
PermutationGen()
Initialize with the default random generator :
MRG32k3a . |
PermutationGen(RandomStream s)
Initialize with the given random generator.
|
Modifier and Type | Method and Description |
---|---|
double[] |
permute(double[] t)
Permutes all the elements of the array.
|
double[] |
permute(double[] t,
int i,
int j)
Takes an array of double, permutes the elements
i to j and returns a new array. |
int[] |
permute(int[] t)
Permutes all the elements of the array.
|
int[] |
permute(int[] t,
int i,
int j)
Takes an array of integer, permutes the elements i to j and
returns a new array.
|
public PermutationGen()
MRG32k3a
.public PermutationGen(RandomStream s)
s
- random generator to be usedpublic double[] permute(double[] t)
t
- array to permutepublic double[] permute(double[] t, int i, int j)
i
to j
and returns a new array.t
- the array to permute; this array will not be modifiedi
- starting index of the permutationj
- last index of the permutationpublic int[] permute(int[] t)
t
- array to permute.public int[] permute(int[] t, int i, int j)
t
- the array to permutei
- starting index of the permutationj
- last index of the permutation