|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.commons.nabla.forward.ForwardModeDifferentiator
public class ForwardModeDifferentiator
Algorithmic differentiator class in forward mode based on bytecode analysis.
This class is an implementation of the UnivariateFunctionDifferentiator
interface that computes exact differentials completely automatically
and generate java classes and instances that compute the differential
of the function as if they were hand-coded 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
, StrictMath
or FastMath
. 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 | |
---|---|
ForwardModeDifferentiator()
Simple constructor. |
Method Summary | |
---|---|
void |
addMathImplementation(Class<?> mathClass)
Add an implementation class for mathematical functions. |
org.apache.commons.math3.analysis.differentiation.UnivariateDifferentiableFunction |
differentiate(org.apache.commons.math3.analysis.UnivariateFunction d)
|
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 ForwardModeDifferentiator()
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 classes 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 org.apache.commons.math3.analysis.differentiation.UnivariateDifferentiableFunction differentiate(org.apache.commons.math3.analysis.UnivariateFunction d)
differentiate
in interface org.apache.commons.math3.analysis.differentiation.UnivariateFunctionDifferentiator
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |