Package com.singularsys.extensions.djep
Class DEquationExtractor
- java.lang.Object
-
- com.singularsys.jep.walkers.DoNothingVisitor
-
- com.singularsys.jep.walkers.DeepCopyVisitor
-
- com.singularsys.extensions.xjep.EquationExtractor
-
- com.singularsys.extensions.djep.DEquationExtractor
-
- All Implemented Interfaces:
JepComponent,ParserVisitor,java.io.Serializable
public class DEquationExtractor extends EquationExtractor
Extract equations for symbolic variables. Ifyis a variable which has an equation it will be replaced by its equation. Methods allow either all variables with equations to be extracted or just those which arePartialDerivative.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDEquationExtractor.Type
-
Constructor Summary
Constructors Constructor Description DEquationExtractor()DEquationExtractor(DJep j)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description NodereplacePartialDerivativeByExpressions(Node node)ReplacePartialDerivativevariables by their equationsNodereplaceRHSVariablesByEquations(Node node)Replace variables on the right had side of an assignment by their equationsNodereplaceVariableByExpressions(Node node)Replace all symbolic variable by their equationsjava.lang.Objectvisit(ASTVarNode node, java.lang.Object data)Visit a variable node.Nodevisit(Node node)-
Methods inherited from class com.singularsys.jep.walkers.DeepCopyVisitor
deepCopy, visit, visit, visit
-
Methods inherited from class com.singularsys.jep.walkers.DoNothingVisitor
childrenHaveChanged, copyChildrenIfNeeded, getFunctionTable, getLightWeightInstance, getNodeFactory, getOperatorTable, getVariableTable, init, visitChildren, visitNode
-
-
-
-
Constructor Detail
-
DEquationExtractor
public DEquationExtractor()
-
DEquationExtractor
public DEquationExtractor(DJep j)
-
-
Method Detail
-
visit
public Node visit(Node node) throws JepException
- Overrides:
visitin classDoNothingVisitor- Throws:
JepException
-
replaceVariableByExpressions
public Node replaceVariableByExpressions(Node node) throws JepException
Replace all symbolic variable by their equations- Overrides:
replaceVariableByExpressionsin classEquationExtractor- Parameters:
node- root of expression- Returns:
- copy of node with variables replaced by their equations
- Throws:
JepException
-
replacePartialDerivativeByExpressions
public Node replacePartialDerivativeByExpressions(Node node) throws JepException
ReplacePartialDerivativevariables by their equations- Parameters:
node- root of expression- Returns:
- copy of node with partial derivative variables replaced by their equations
- Throws:
JepException
-
replaceRHSVariablesByEquations
public Node replaceRHSVariablesByEquations(Node node) throws JepException
Replace variables on the right had side of an assignment by their equations- Overrides:
replaceRHSVariablesByEquationsin classEquationExtractor- Parameters:
node- an equation of the formg:=f^2-1- Returns:
- a copy of the node
- Throws:
JepException
-
visit
public java.lang.Object visit(ASTVarNode node, java.lang.Object data) throws JepException
Description copied from class:DoNothingVisitorVisit a variable node. Can be overridden by sub-classes.- Specified by:
visitin interfaceParserVisitor- Overrides:
visitin classEquationExtractor- Throws:
JepException
-
-