public class CachedFunction extends java.lang.Object implements UnivariateFunction
UnivariateFunction
objectConstructor and Description |
---|
CachedFunction(UnivariateFunction f,
double epsilon)
Constructs a cached function, using a given function f for obtaining the actual values of the function.
|
Modifier and Type | Method and Description |
---|---|
long |
getCacheHits()
Retrieve the number of cache hits, that is, the number of times that an evaluation of the function was actually
done using the cache.
|
double |
value(double x) |
public CachedFunction(UnivariateFunction f, double epsilon)
epsilon
. That is, the function may return the same value for two arguments
that are closed that epsilon
.f
- the function to be cachedepsilon
- the precision used for caching, see abovepublic long getCacheHits()
public double value(double x)
value
in interface UnivariateFunction