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. Ify
is 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 class
DEquationExtractor.Type
-
Constructor Summary
Constructors Constructor Description DEquationExtractor()
DEquationExtractor(DJep j)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Node
replacePartialDerivativeByExpressions(Node node)
ReplacePartialDerivative
variables by their equationsNode
replaceRHSVariablesByEquations(Node node)
Replace variables on the right had side of an assignment by their equationsNode
replaceVariableByExpressions(Node node)
Replace all symbolic variable by their equationsjava.lang.Object
visit(ASTVarNode node, java.lang.Object data)
Visit a variable node.Node
visit(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:
visit
in classDoNothingVisitor
- Throws:
JepException
-
replaceVariableByExpressions
public Node replaceVariableByExpressions(Node node) throws JepException
Replace all symbolic variable by their equations- Overrides:
replaceVariableByExpressions
in 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
ReplacePartialDerivative
variables 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:
replaceRHSVariablesByEquations
in 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:DoNothingVisitor
Visit a variable node. Can be overridden by sub-classes.- Specified by:
visit
in interfaceParserVisitor
- Overrides:
visit
in classEquationExtractor
- Throws:
JepException
-
-