

PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: NESTED  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 
java.lang.Object org.apache.commons.nabla.algorithmic.forward.ForwardAlgorithmicDifferentiator
public class ForwardAlgorithmicDifferentiator
Automatic differentiator class based on bytecode analysis.
This class is an implementation of the UnivariateDifferentiator
interface that computes exact differentials completely automatically
and generate java classes and instances that compute the differential
of the function as if they were handcoded and compiled.
The derivative bytecode created the first time an instance of a given class is differentiated is cached and will be reused if other instances of the same class are to be created later. The cache can also be dumped in a jar file for use in an application without bringing the full nabla library and its dependencies.
This differentiator can handle only pure bytecode methods and known methods
from math implementation classes like Math
or
StrictMath
. Pure bytecode methods are analyzed
and converted. Methods from math implementation classes are only recognized
by class and name and replaced by predefined derivative code.
FetchDifferentiator
Constructor Summary  

ForwardAlgorithmicDifferentiator()
Simple constructor. 
Method Summary  

void 
addMathImplementation(Class<?> mathClass)
Add an implementation class for mathematical functions. 
UnivariateDerivative 
differentiate(UnivariateDifferentiable d)
Create an implementation of a differential for a differentiable function . 
void 
dumpCache(OutputStream out)
Dump the cache into a stream. 
Methods inherited from class java.lang.Object 

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 
Constructor Detail 

public ForwardAlgorithmicDifferentiator()
Build a ForwardAlgorithmicDifferentiator instance with an empty cache.
Method Detail 

public void addMathImplementation(Class<?> mathClass)
At construction, the differentiator considers only the Math
and StrictMath
classes are math implementation classes. It may be useful to add
other class for example to add some missing functions like
inverse hyperbolic cosine that are not provided by the standard
java classes as of Java 1.6.
mathClass
 implementation class for mathematical functionspublic void dumpCache(OutputStream out)
out
 output stream where to dump the cachepublic UnivariateDerivative differentiate(UnivariateDifferentiable d) throws DifferentiationException
differentiable function
.
differentiate
in interface UnivariateDifferentiator
d
 differentiable function to differentiate
DifferentiationException
 if the class cannot be differentiated


PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: NESTED  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 