SSJ
V. labo.

umontreal.iro.lecuyer.rng
Class RandomPermutation

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

public class RandomPermutation
extends Object

RandomPermutation

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


Constructor Summary
RandomPermutation()
           
 
Method Summary
static void init(byte[] array, int n)
          Deprecated. 
static void init(double[] array, int n)
          Deprecated. 
static void init(float[] array, int n)
          Deprecated. 
static void init(int[] array, int n)
          Deprecated. 
static void init(long[] array, int n)
          Deprecated. 
static void init(short[] array, int n)
          Deprecated. 
static void shuffle(boolean[] array, int n, int k, RandomStream stream)
          [tabb244]
arraythe array being shuffled.
static void shuffle(boolean[] array, RandomStream stream)
          [tabb121]
arraythe array being shuffled.
static void shuffle(byte[] array, int n, int k, RandomStream stream)
          .
static void shuffle(byte[] array, RandomStream stream)
          [tabb77]
arraythe array being shuffled.
static void shuffle(char[] array, int n, int k, RandomStream stream)
          [tabb231]
arraythe array being shuffled.
static void shuffle(char[] array, RandomStream stream)
          [tabb112]
arraythe array being shuffled.
static void shuffle(double[] array, int n, int k, RandomStream stream)
          [tabb270]
arraythe array being shuffled.
static void shuffle(double[] array, RandomStream stream)
          .
static void shuffle(float[] array, int n, int k, RandomStream stream)
          [tabb257]
arraythe array being shuffled.
static void shuffle(float[] array, RandomStream stream)
          [tabb130]
arraythe array being shuffled.
static void shuffle(int[] array, int n, int k, RandomStream stream)
          [tabb205]
arraythe array being shuffled.
static void shuffle(int[] array, RandomStream stream)
          [tabb94]
arraythe array being shuffled.
static void shuffle(List<?> list, int k, RandomStream stream)
           
static void shuffle(List<?> list, RandomStream stream)
           
static void shuffle(long[] array, int n, int k, RandomStream stream)
          [tabb218]
arraythe array being shuffled.
static void shuffle(long[] array, RandomStream stream)
          [tabb103]
arraythe array being shuffled.
static void shuffle(Object[] array, int n, int k, RandomStream stream)
          .
static void shuffle(Object[] array, RandomStream stream)
          .
static void shuffle(short[] array, int n, int k, RandomStream stream)
          [tabb192]
arraythe array being shuffled.
static void shuffle(short[] array, RandomStream stream)
          .
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RandomPermutation

public RandomPermutation()
Method Detail

init

@Deprecated
public static void init(byte[] array,
                                   int n)
Deprecated. 

. \begin{tabb}Initializes \texttt{array} with the first $n$
 positive integers in ...
 ...$, for
 $i=1,...,n$. The size of \texttt{array} must be at least $n$.
 \end{tabb}
arraythe array to initialize. nnumber of elements initialized.


init

@Deprecated
public static void init(short[] array,
                                   int n)
Deprecated. 

. \begin{tabb}Similar to \method{init}{}{\texttt{(byte[], int)}}.
 \end{tabb}
arraythe array to initialize. nnumber of elements initialized.


init

@Deprecated
public static void init(int[] array,
                                   int n)
Deprecated. 

[tabb24]
arraythe array to initialize. nnumber of elements initialized.


init

@Deprecated
public static void init(long[] array,
                                   int n)
Deprecated. 

[tabb33]
arraythe array to initialize. nnumber of elements initialized.


init

@Deprecated
public static void init(float[] array,
                                   int n)
Deprecated. 

[tabb42]
arraythe array to initialize. nnumber of elements initialized.


init

@Deprecated
public static void init(double[] array,
                                   int n)
Deprecated. 

. \begin{tabb}Similar to \method{init}{}{\texttt{(byte[], int)}}.
 \bigskip\hrule
 \end{tabb}
arraythe array to initialize. nnumber of elements initialized.


shuffle

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

shuffle

public static void shuffle(Object[] array,
                           RandomStream stream)
. \begin{tabb}Randomly permutes \texttt{array} using \texttt{stream}.
 This method permutes the whole array.
 \end{tabb}
arraythe array being shuffled. streamthe random stream used to generate random numbers.


shuffle

public static void shuffle(byte[] array,
                           RandomStream stream)
[tabb77]
arraythe array being shuffled. streamthe random stream used to generate random numbers.


shuffle

public static void shuffle(short[] array,
                           RandomStream stream)
. \begin{tabb}Similar to \method{shuffle}{}{\texttt{(byte[], RandomStream)}}.
 \end{tabb}
arraythe array being shuffled. streamthe random stream used to generate random numbers.


shuffle

public static void shuffle(int[] array,
                           RandomStream stream)
[tabb94]
arraythe array being shuffled. streamthe random stream used to generate random numbers.


shuffle

public static void shuffle(long[] array,
                           RandomStream stream)
[tabb103]
arraythe array being shuffled. streamthe random stream used to generate random numbers.


shuffle

public static void shuffle(char[] array,
                           RandomStream stream)
[tabb112]
arraythe array being shuffled. streamthe random stream used to generate random numbers.


shuffle

public static void shuffle(boolean[] array,
                           RandomStream stream)
[tabb121]
arraythe array being shuffled. streamthe random stream used to generate random numbers.


shuffle

public static void shuffle(float[] array,
                           RandomStream stream)
[tabb130]
arraythe array being shuffled. streamthe random stream used to generate random numbers.


shuffle

public static void shuffle(double[] array,
                           RandomStream stream)
. \begin{tabb}Similar to \method{shuffle}{}{\texttt{(byte[], RandomStream)}}.
 \bigskip\hrule
 \end{tabb}
arraythe array being shuffled. streamthe random stream used to generate random numbers.


shuffle

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

shuffle

public static void shuffle(Object[] array,
                           int n,
                           int k,
                           RandomStream stream)
. \begin{tabb}Partially permutes \texttt{array} as follows
 using \texttt{stream}:...
 ...ements and are placed in the first
 $k$\ positions, in random order.
 \end{tabb}
arraythe array being shuffled. nselection amongst the first n elements. knumber of elements selected. streamthe random stream used to generate random numbers.


shuffle

public static void shuffle(byte[] array,
                           int n,
                           int k,
                           RandomStream stream)
. \begin{tabb}Similar to
 \method{shuffle}{}{\texttt{(Object[], n, k, RandomStream)}}.
 \end{tabb}
arraythe array being shuffled. nselection amongst the first n elements. knumber of elements selected. streamthe random stream used to generate random numbers.


shuffle

public static void shuffle(short[] array,
                           int n,
                           int k,
                           RandomStream stream)
[tabb192]
arraythe array being shuffled. nselection amongst the first n elements. knumber of elements selected. streamthe random stream used to generate random numbers.


shuffle

public static void shuffle(int[] array,
                           int n,
                           int k,
                           RandomStream stream)
[tabb205]
arraythe array being shuffled. nselection amongst the first n elements. knumber of elements selected. streamthe random stream used to generate random numbers.


shuffle

public static void shuffle(long[] array,
                           int n,
                           int k,
                           RandomStream stream)
[tabb218]
arraythe array being shuffled. nselection amongst the first n elements. knumber of elements selected. streamthe random stream used to generate random numbers.


shuffle

public static void shuffle(char[] array,
                           int n,
                           int k,
                           RandomStream stream)
[tabb231]
arraythe array being shuffled. nselection amongst the first n elements. knumber of elements selected. streamthe random stream used to generate random numbers.


shuffle

public static void shuffle(boolean[] array,
                           int n,
                           int k,
                           RandomStream stream)
[tabb244]
arraythe array being shuffled. nselection amongst the first n elements. knumber of elements selected. streamthe random stream used to generate random numbers.


shuffle

public static void shuffle(float[] array,
                           int n,
                           int k,
                           RandomStream stream)
[tabb257]
arraythe array being shuffled. nselection amongst the first n elements. knumber of elements selected. streamthe random stream used to generate random numbers.


shuffle

public static void shuffle(double[] array,
                           int n,
                           int k,
                           RandomStream stream)
[tabb270]
arraythe array being shuffled. nselection amongst the first n elements. knumber of elements selected. streamthe random stream used to generate random numbers.


SSJ
V. labo.

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