org.apache.mahout.math.random
Class AbstractSamplerFunction
java.lang.Object
org.apache.mahout.math.function.DoubleFunction
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.
Method Summary |
double |
apply(double ignored)
Apply the function to the argument and return the result |
abstract Double |
sample()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractSamplerFunction
public AbstractSamplerFunction()
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.