public abstract class IntToDoubleFunctionCache
extends java.lang.Object
Constructor and Description |
---|
IntToDoubleFunctionCache() |
Modifier and Type | Method and Description |
---|---|
protected abstract double |
compute(int n) |
void |
expandCache(int newCapacity)
Ensures that the cache contains a value for n.
|
double |
get(int i)
Get the value of the function, expanding the cache as necessary.
|
protected abstract int |
maxSize() |
int |
size() |
protected abstract int maxSize()
protected abstract double compute(int n)
public double get(int i)
i
- operandi
public void expandCache(int newCapacity)
newCapacity
- desired value to be precomputedpublic int size()