Class SelectionMethods

java.lang.Object
  |
  +--SelectionMethods

public class SelectionMethods
extends java.lang.Object

SelectionMethods


Constructor Summary
SelectionMethods()
           
 
Method Summary
static void selectBest(double[] values, int valuesSize, int order, int[] sample, int sampleSize)
          places in the sample array, sampleSize indices of the elements in values that contain the best values corresponding to an ascending order if order is 1 or to a descending order otherwise
static void selectProb(int N, double[] probabilities, int[] sample, int n, java.util.Random rand)
          selects n integers between 0 and N-1 based on their probabilities; places the selected integers in sample; probabilities should be cumulative probabilities
static void selectUnif(int N, int[] sample, int n, java.util.Random rand)
          selects n integers with uniform probability, between 0 and N - 1 and places the selected values in the field sample
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SelectionMethods

public SelectionMethods()
Method Detail

selectBest

public static void selectBest(double[] values,
                              int valuesSize,
                              int order,
                              int[] sample,
                              int sampleSize)
places in the sample array, sampleSize indices of the elements in values that contain the best values corresponding to an ascending order if order is 1 or to a descending order otherwise


selectUnif

public static void selectUnif(int N,
                              int[] sample,
                              int n,
                              java.util.Random rand)
selects n integers with uniform probability, between 0 and N - 1 and places the selected values in the field sample


selectProb

public static void selectProb(int N,
                              double[] probabilities,
                              int[] sample,
                              int n,
                              java.util.Random rand)
selects n integers between 0 and N-1 based on their probabilities; places the selected integers in sample; probabilities should be cumulative probabilities