org.apache.mahout.math.jet.random.sampling
Class RandomSamplingAssistant

java.lang.Object
  extended by org.apache.mahout.math.jet.random.sampling.RandomSamplingAssistant

Deprecated. until unit tests are in place. Until this time, this class/interface is unsupported.

@Deprecated
public final class RandomSamplingAssistant
extends Object


Constructor Summary
RandomSamplingAssistant(long n, long N, Random randomGenerator)
          Deprecated. Constructs a random sampler that samples n random elements from an input sequence of N elements.
 
Method Summary
 Random getRandomGenerator()
          Deprecated. Returns the used random generator.
static int[] sampleArray(int n, int[] elements)
          Deprecated. Just shows how this class can be used; samples n elements from and int[] array.
 boolean sampleNextElement()
          Deprecated. Returns whether the next element of the input sequence shall be sampled (picked) or not.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RandomSamplingAssistant

public RandomSamplingAssistant(long n,
                               long N,
                               Random randomGenerator)
Deprecated. 
Constructs a random sampler that samples n random elements from an input sequence of N elements.

Parameters:
n - the total number of elements to choose (must be >= 0).
N - number of elements to choose from (must be >= n).
randomGenerator - a random number generator. Set this parameter to null to use the default random number generator.
Method Detail

getRandomGenerator

public Random getRandomGenerator()
Deprecated. 
Returns the used random generator.


sampleArray

public static int[] sampleArray(int n,
                                int[] elements)
Deprecated. 
Just shows how this class can be used; samples n elements from and int[] array.


sampleNextElement

public boolean sampleNextElement()
Deprecated. 
Returns whether the next element of the input sequence shall be sampled (picked) or not.

Returns:
true if the next element shall be sampled (picked), false otherwise.


Copyright © 2008-2011 The Apache Software Foundation. All Rights Reserved.