|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.metsci.glimpse.util.math.fast.FastFunc
public abstract class FastFunc
A function that precomputes its values for speed. Intended to accelerate the evaluation of transcendental functions in cases where speed is more important than accuracy. To implement a particular precomputed function, extend this abstract class and implement the method that evaluates the function.
Constructor Summary | |
---|---|
FastFunc(double min,
double max,
int nSamples)
Main Constructor in which the values of this function are computed |
Method Summary | |
---|---|
double |
evaluate(double x)
|
double |
lookup(double x)
Returns the value of the precomputed function using a simple nearest neighbor interpolation. |
void |
lookup(double[][] A,
double[][] x)
Returns the value of the precomputed function using a simple nearest neighbor interpolation. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FastFunc(double min, double max, int nSamples)
min
- minimum value to samplemax
- maximum value to samplesamples
- number of samplesMethod Detail |
---|
public double lookup(double x)
x
- function argument (you must ensure this is in range)
public void lookup(double[][] A, double[][] x)
A
- function valuesx
- argumentspublic double evaluate(double x)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |