org.debellor.core.util
Class Permute

java.lang.Object
  extended by org.debellor.core.util.Permute

public class Permute
extends java.lang.Object

Author:
Marcin Wojnarski

Constructor Summary
Permute()
           
 
Method Summary
static int[] indices(int range)
           
static int[] indices(int range, int length, java.util.Random random)
          Generates random combination of integers from [0,range), of length length, without repetitions.
static int[] indices(int range, java.util.Random random)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Permute

public Permute()
Method Detail

indices

public static int[] indices(int range,
                            int length,
                            java.util.Random random)
Generates random combination of integers from [0,range), of length length, without repetitions.

Parameters:
range - Values will be picked randomly from [0,range) interval
length - Number of returned values. Must be <= range
random - Random number generator to be used
Returns:
Random combination of integers from [0,range), of length length, without repetitions.

indices

public static int[] indices(int range,
                            java.util.Random random)

indices

public static int[] indices(int range)