|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.ObjectbaseCode.math.RandomChooser
Fill arrays with random values given a source of values.
Copyright (c) 2004
Institution: Columbia University
| Method Summary | |
static void |
chooserandom(double[] randomvals,
double[] sourcedata,
int[] deck,
int max,
int n)
Fill randomvals with random things from sourcedata, without replacement. |
static void |
chooserandom(int[] randomnums,
boolean[] recLog,
int max,
int n)
choose n random integers from 0 to max without repeating |
static void |
chooserandom(int[] randomnums,
int[] deck,
int max,
int n)
choose n random integers from 0 to max without repeating |
static void |
chooserandomWrep(int[] randomnums,
int max,
int n)
Same as chooserandom, but with replacement -- that is, repeats are allowed. |
static void |
init(long seed)
Initialized the random number generator witha given seed. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public static void init(long seed)
seed -
public static void chooserandom(double[] randomvals,
double[] sourcedata,
int[] deck,
int max,
int n)
randomvals - answers go here.sourcedata - Data to be randomly selecteddeck - an array pre-filled with integers from 0 to max, but they don't have to be in order.max - how many values we need.n - int
public static void chooserandom(int[] randomnums,
int[] deck,
int max,
int n)
randomnums - answers go here.deck - an array pre-filled with integers from 0 to max, but they don't have to be in order.max - how many values we need.n - int
public static void chooserandom(int[] randomnums,
boolean[] recLog,
int max,
int n)
randomnums - int[]recLog - record of what values are already chosen.max - intn - int
public static void chooserandomWrep(int[] randomnums,
int max,
int n)
randomnums - int[]max - intn - int
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||