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

java.lang.Object
  extended by org.apache.mahout.math.PersistentObject
      extended by org.apache.mahout.math.jet.random.sampling.RandomSamplingAssistant
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

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

@Deprecated
public final class RandomSamplingAssistant
extends org.apache.mahout.math.PersistentObject

See Also:
Serialized Form

Constructor Summary
RandomSamplingAssistant(long n, long N, java.util.Random randomGenerator)
          Deprecated. Constructs a random sampler that samples n random elements from an input sequence of N elements.
 
Method Summary
 java.lang.Object clone()
          Deprecated. Returns a deep copy of the receiver.
 java.util.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
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RandomSamplingAssistant

public RandomSamplingAssistant(long n,
                               long N,
                               java.util.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

clone

public java.lang.Object clone()
Deprecated. 
Returns a deep copy of the receiver.

Overrides:
clone in class org.apache.mahout.math.PersistentObject

getRandomGenerator

public java.util.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-2010 The Apache Software Foundation. All Rights Reserved.