|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.stanford.nlp.optimization.AbstractCachingDiffFunction
public abstract class AbstractCachingDiffFunction
Field Summary | |
---|---|
protected double[] |
derivative
|
protected double |
value
|
Constructor Summary | |
---|---|
AbstractCachingDiffFunction()
|
Method Summary | |
---|---|
protected abstract void |
calculate(double[] x)
Calculate the value at x and the derivative and save them in the respective fields |
protected void |
clearCache()
Clears the cache in a way that doesn't require reallocation :-) |
protected void |
copy(double[] y,
double[] x)
|
double[] |
derivativeAt(double[] x)
Returns the first-derivative vector at the input location. |
abstract int |
domainDimension()
Returns the number of dimensions in the function's domain |
double[] |
initial()
Returns the intitial point in the domain (but not necessarily a feasible one). |
double |
lastValue()
|
void |
setValue(double v)
|
double |
valueAt(double[] x)
Returns the value of the function at a single point. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected double[] derivative
protected double value
Constructor Detail |
---|
public AbstractCachingDiffFunction()
Method Detail |
---|
public abstract int domainDimension()
Function
domainDimension
in interface Function
protected abstract void calculate(double[] x)
protected void clearCache()
public double[] initial()
HasInitial
initial
in interface HasInitial
protected void copy(double[] y, double[] x)
public double valueAt(double[] x)
Function
valueAt
in interface Function
x
- a double[]
input
public double[] derivativeAt(double[] x)
DiffFunction
derivativeAt
in interface DiffFunction
x
- a double[]
input vector
public double lastValue()
public void setValue(double v)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |