|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.commons.nabla.forward.analysis.MethodDifferentiator
public class MethodDifferentiator
Class transforming a method computing a value to a method computing both a value and its differential.
| Constructor Summary | |
|---|---|
MethodDifferentiator(Set<String> mathClasses,
String derivedName)
Build a differentiator for a method. |
|
| Method Summary | |
|---|---|
void |
differentiate(String primitiveName,
org.objectweb.asm.tree.MethodNode method)
Differentiate a method. |
org.objectweb.asm.tree.InsnList |
doubleToDerivativeStructureConversion()
Create instructions to convert a double on top of stack to a DerivativeStructure. |
int |
getInputDSIndex()
Get the index of the input derivative structure variable. |
int |
getTmp(int number)
Get index of a size 2 temporary variable. |
boolean |
isMathImplementationClass(String name)
Test if a class is a math implementation class. |
void |
useLocal(int index,
int size)
Set a local variable as used by the modified code. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MethodDifferentiator(Set<String> mathClasses,
String derivedName)
mathClasses - math implementation classesderivedName - name of the derived class| Method Detail |
|---|
public int getInputDSIndex()
derivative structure variable.
derivative structure variable
public void differentiate(String primitiveName,
org.objectweb.asm.tree.MethodNode method)
throws DifferentiationException
primitiveName - primitive class namemethod - method to differentiate (will be modified)
DifferentiationException - if method cannot be differentiatedpublic boolean isMathImplementationClass(String name)
name - name of the class to test
public org.objectweb.asm.tree.InsnList doubleToDerivativeStructureConversion()
DerivativeStructure.
public void useLocal(int index,
int size)
throws DifferentiationException
index - index of the variablesize - size of the variable (1 or 2 for standard variables,
4 for special expanded derivative structures)
DifferentiationException - if the number of the
temporary variable lies outside of the allowed range
public int getTmp(int number)
throws DifferentiationException
Temporary variables can be used for very short duration storage of size 2 values (i.e one double, or one long or two integers). These variables are reused in many replacement instructions sequences, so their content may be overridden at any time: they should be considered to have a scope limited to one replacement sequence only. This means that one should not store a value in a variable in one replacement sequence and retrieve it later in another replacement sequence as it may have been overridden in between.
At most 5 temporary variables may be used.
number - number of the temporary variable (must be
between 1 and the maximal number of available temporary
variables)
DifferentiationException - if the number of the
temporary variable lies outside of the allowed range
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||