AtomFuncDerivative

public final class AtomFuncDerivative

Object that manages the derivatives of a black-box routine, intrinsic or external or other. For each routine, one such object is built from a specification which is an IL Tree, as described in function incorporateNewAtomFunc(Tree, SymbolTable).

Fields

derivs

public Tree[] derivs

derivsKeyTreeList

public TapList<TapPair<Tree, Tree>>[] derivsKeyTreeList

factor

public Tree factor

factorKeyTreeList

public TapList<TapPair<Tree, Tree>> factorKeyTreeList

origKeyTreeList

public TapList<TapPair<Tree, Tree>> origKeyTreeList

origPattern

public Tree origPattern

paramVars

public TapPair<Tree, Tree>[] paramVars

Constructors

AtomFuncDerivative

public AtomFuncDerivative(Tree origPattern, TapList<TapPair<Tree, Tree>> origKeyTreeList, Tree factor, TapList<TapPair<Tree, Tree>> factorKeyTreeList, TapPair<Tree, Tree>[] paramVars, Tree[] derivs, TapList<TapPair<Tree, Tree>>[] derivsKeyTreeList)

Methods

buildPartialDerivative

public Tree buildPartialDerivative(int i)

getDiffCallNames

public TapList<Tree> getDiffCallNames()

getMetavarsFromPattern

public static TapList<TapPair<Tree, Tree>> getMetavarsFromPattern(Tree tree, TapList<TapPair<Tree, Tree>> keyTreeList)

getParamExprs

public Tree[] getParamExprs()

incorporateNewAtomFunc

public static void incorporateNewAtomFunc(Tree defTree, Unit functionUnit)

Incorporates the definition of derivatives of an atomic function into the properties attached to that atomic function in the “symbolTable”. Assumes that defTree is an IL Tree of the shape: binary(call(none(), ident “atomicFunctionName”, expressions(containing <e1>,<e2>,…)) <factor>, expressions(binary(<e1>,none(),<e’1>), binary(<e2>,none(),<e’2>), …)) Where the <ei> are metavariables (op_metavar) that get instantiated during the pattern-match between the origPattern and the actual call, and the <e’i> are the corresponding partial derivatives wrt <ei>. Of course, each <e’i> may use some or all of the <ej>.

matches

public void matches(Tree tree)

toString

public String toString()