org.apache.mahout.math.random
Class AbstractSamplerFunction

java.lang.Object
  extended by org.apache.mahout.math.function.DoubleFunction
      extended by org.apache.mahout.math.random.AbstractSamplerFunction
All Implemented Interfaces:
Sampler<Double>
Direct Known Subclasses:
Empirical, Normal, PoissonSampler

public abstract class AbstractSamplerFunction
extends DoubleFunction
implements Sampler<Double>

This shim allows samplers to be used to initialize vectors.


Constructor Summary
AbstractSamplerFunction()
           
 
Method Summary
 double apply(double ignored)
          Apply the function to the argument and return the result
abstract  Double sample()
           
 
Methods inherited from class org.apache.mahout.math.function.DoubleFunction
isDensifying
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractSamplerFunction

public AbstractSamplerFunction()
Method Detail

apply

public double apply(double ignored)
Apply the function to the argument and return the result

Specified by:
apply in class DoubleFunction
Parameters:
ignored - Ignored argument
Returns:
A sample from this distribution.

sample

public abstract Double sample()
Specified by:
sample in interface Sampler<Double>


Copyright © 2008–2014 The Apache Software Foundation. All rights reserved.