SSJ
V. 2.0.

umontreal.iro.lecuyer.rng
Class RandomPermutation

java.lang.Object
  extended by umontreal.iro.lecuyer.rng.RandomPermutation

public class RandomPermutation
extends Object

Provides methods to randomly shuffle arrays or lists using a random stream.


Constructor Summary
RandomPermutation()
           
 
Method Summary
static void shuffle(boolean[] array, RandomStream stream)
          Randomly permutes the array array using random stream stream.
static void shuffle(byte[] array, RandomStream stream)
          Randomly permutes the array array using random stream stream.
static void shuffle(char[] array, RandomStream stream)
          Randomly permutes the array array using random stream stream.
static void shuffle(double[] array, RandomStream stream)
          Randomly permutes the array array using random stream stream.
static void shuffle(float[] array, RandomStream stream)
          Randomly permutes the array array using random stream stream.
static void shuffle(int[] array, RandomStream stream)
          Randomly permutes the array array using random stream stream.
static void shuffle(List<?> list, RandomStream stream)
           
static void shuffle(long[] array, RandomStream stream)
          Randomly permutes the array array using random stream stream.
static void shuffle(Object[] array, RandomStream stream)
          Randomly permutes the array array using random stream stream.
static void shuffle(short[] array, RandomStream stream)
          Randomly permutes the array array using random stream stream.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RandomPermutation

public RandomPermutation()
Method Detail

shuffle

public static void shuffle(List<?> list,
                           RandomStream stream)

shuffle

public static void shuffle(Object[] array,
                           RandomStream stream)
Randomly permutes the array array using random stream stream.

Parameters:
array - the array being shuffled.
stream - the random stream used to generate random numbers.

shuffle

public static void shuffle(byte[] array,
                           RandomStream stream)
Randomly permutes the array array using random stream stream.

Parameters:
array - the array being shuffled.
stream - the random stream used to generate random numbers.

shuffle

public static void shuffle(short[] array,
                           RandomStream stream)
Randomly permutes the array array using random stream stream.

Parameters:
array - the array being shuffled.
stream - the random stream used to generate random numbers.

shuffle

public static void shuffle(int[] array,
                           RandomStream stream)
Randomly permutes the array array using random stream stream.

Parameters:
array - the array being shuffled.
stream - the random stream used to generate random numbers.

shuffle

public static void shuffle(long[] array,
                           RandomStream stream)
Randomly permutes the array array using random stream stream.

Parameters:
array - the array being shuffled.
stream - the random stream used to generate random numbers.

shuffle

public static void shuffle(char[] array,
                           RandomStream stream)
Randomly permutes the array array using random stream stream.

Parameters:
array - the array being shuffled.
stream - the random stream used to generate random numbers.

shuffle

public static void shuffle(boolean[] array,
                           RandomStream stream)
Randomly permutes the array array using random stream stream.

Parameters:
array - the array being shuffled.
stream - the random stream used to generate random numbers.

shuffle

public static void shuffle(float[] array,
                           RandomStream stream)
Randomly permutes the array array using random stream stream.

Parameters:
array - the array being shuffled.
stream - the random stream used to generate random numbers.

shuffle

public static void shuffle(double[] array,
                           RandomStream stream)
Randomly permutes the array array using random stream stream.

Parameters:
array - the array being shuffled.
stream - the random stream used to generate random numbers.

SSJ
V. 2.0.

To submit a bug or ask questions, send an e-mail to Pierre L'Ecuyer.