Package com.singularsys.extensions.xjep
Class EquationExtractor
- java.lang.Object
-
- com.singularsys.jep.walkers.DoNothingVisitor
-
- com.singularsys.jep.walkers.DeepCopyVisitor
-
- com.singularsys.extensions.xjep.EquationExtractor
-
- All Implemented Interfaces:
JepComponent
,ParserVisitor
,java.io.Serializable
- Direct Known Subclasses:
DEquationExtractor
public class EquationExtractor extends DeepCopyVisitor
Extract equations for symbolic variables. Ify
is a variable which has an equation it will be replaced by its equation.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description EquationExtractor()
EquationExtractor(Jep j)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Node
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.-
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, visit, visitChildren, visitNode
-
-
-
-
Constructor Detail
-
EquationExtractor
public EquationExtractor()
-
EquationExtractor
public EquationExtractor(Jep j)
-
-
Method Detail
-
replaceVariableByExpressions
public Node replaceVariableByExpressions(Node node) throws JepException
Replace all symbolic variable by their equations- Parameters:
node
- root of expression- Returns:
- copy of node with 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- 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 classDeepCopyVisitor
- Throws:
JepException
-
-