- All Superinterfaces:
ASTNode,ExpressionNode,ForLoopInitializerNode,InitializerNode,SizeableNode
A CIVL-C derivative expression is a function call to the partial derivative
of an abstract function. It comprises a set of parameter-integer pairs which
encode the differential operator being applied to the function, and the
sequence of actual parameters which are the inputs to the resulting function.
-
Nested Class Summary
Nested classes/interfaces inherited from interface dev.civl.abc.ast.node.IF.ASTNode
ASTNode.NodeKindNested classes/interfaces inherited from interface dev.civl.abc.ast.node.IF.expression.ExpressionNode
ExpressionNode.ExpressionKind -
Method Summary
Modifier and TypeMethodDescriptioncopy()Returns a deep copy of this AST node.getArgument(int index) Returns the index-th argument, indexed from 0.The abstract function whose derivative is being taken.intReturns the number of actual arguments occurring in this derivative expression.intComputes the number of parameters which have at least one partial derivative taken.getPartial(int index) Returns the (identifier, int) pair at the specified index in the list of partial derivatives.Methods inherited from interface dev.civl.abc.ast.node.IF.ASTNode
addAllTransformAnnotations, addTransformAnnotation, child, childIndex, children, diff, equiv, getAttribute, getOwner, getScope, getSource, id, keepOnly, nextDFS, nodeKind, numChildren, parent, prettyPrint, prettyRepresentation, prettyRepresentation, print, remove, removeChild, removeTransformAnnotation, setAttribute, setChild, setId, setOwner, setScope, toString, transformAnnotationsMethods inherited from interface dev.civl.abc.ast.node.IF.expression.ExpressionNode
addConversion, expressionKind, getConversion, getConvertedType, getInitialType, getNumConversions, isConstantExpression, isLvalue, removeConversions, setInitialTypeMethods inherited from interface dev.civl.abc.ast.node.IF.declaration.InitializerNode
isSideEffectFreeMethods inherited from interface dev.civl.abc.ast.node.IF.expression.SizeableNode
getType
-
Method Details
-
getFunction
ExpressionNode getFunction()The abstract function whose derivative is being taken.- Returns:
- The abstract function.
-
getNumberOfArguments
int getNumberOfArguments()Returns the number of actual arguments occurring in this derivative expression.- Returns:
- The number of actual arguments.
-
getArgument
Returns the index-th argument, indexed from 0.- Returns:
- argument at position index, indexed from 0
-
getNumberOfPartials
int getNumberOfPartials()Computes the number of parameters which have at least one partial derivative taken. Note that each parameter may have a partial taken more than once (e.g.$D[rho,{x,3},{y,2}], so this is not the same thing as the total times a partial derivative is taken. That is, for$D[rho,{x,3},{y,2}], this returns 2, not 5.- Returns:
- the number of parameters that have a partial of degree at least 1
-
getPartial
Returns the (identifier, int) pair at the specified index in the list of partial derivatives.- Returns:
- the identifier-int pair at position
index, indexed from 0
-
copy
DerivativeExpressionNode copy()Description copied from interface:ASTNodeReturns a deep copy of this AST node. The node and all of its descendants will be cloned. The cloning does not copy analysis or attribute information.- Specified by:
copyin interfaceASTNode- Specified by:
copyin interfaceExpressionNode- Specified by:
copyin interfaceForLoopInitializerNode- Specified by:
copyin interfaceInitializerNode- Specified by:
copyin interfaceSizeableNode- Returns:
- deep copy of this node
-