Package com.singularsys.extensions.djep
Class DEquationExtractor
java.lang.Object
com.singularsys.jep.walkers.GenericDoNothingVisitor<DEquationExtractor.Type>
com.singularsys.jep.walkers.GenericDeepCopyVisitor<DEquationExtractor.Type>
com.singularsys.extensions.xjep.EquationExtractor<DEquationExtractor.Type>
com.singularsys.extensions.djep.DEquationExtractor
- All Implemented Interfaces:
GenericVisitor<Node,,DEquationExtractor.Type, ParseException> JepComponent,Serializable
Extract equations for symbolic variables. If
y
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 are PartialDerivative.
Since Jep 4.1, extensions 2.2 the parent class is a generic class and method signatures are more specific.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumType of variable to replace by their equations -
Field Summary
Fields inherited from class com.singularsys.jep.walkers.GenericDoNothingVisitor
ft, nf, ot -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReplacePartialDerivativevariables by their equationsReplace variables on the right had side of an assignment by their equationsReplace all symbolic variable by their equationsvisit(ASTVarNode node, DEquationExtractor.Type data) Visit a variable nodeMethods inherited from class com.singularsys.jep.walkers.GenericDeepCopyVisitor
getLightWeightInstance, visit, visit, visit, visitMethods inherited from class com.singularsys.jep.walkers.GenericDoNothingVisitor
childrenHaveChanged, copyChildrenIfNeeded, copyChildrenIfNeeded, init, makeExceptionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.singularsys.jep.GenericVisitor
makeException, visitChildren
-
Constructor Details
-
DEquationExtractor
public DEquationExtractor() -
DEquationExtractor
-
-
Method Details
-
visit
- Overrides:
visitin classEquationExtractor<DEquationExtractor.Type>- Throws:
ParseException
-
replaceVariableByExpressions
Replace all symbolic variable by their equations- Overrides:
replaceVariableByExpressionsin classEquationExtractor<DEquationExtractor.Type>- Parameters:
node- root of expression- Returns:
- copy of node with variables replaced by their equations
- Throws:
ParseException
-
replacePartialDerivativeByExpressions
ReplacePartialDerivativevariables by their equations- Parameters:
node- root of expression- Returns:
- copy of node with partial derivative variables replaced by their equations
- Throws:
ParseException
-
replaceRHSVariablesByEquations
Replace variables on the right had side of an assignment by their equations- Overrides:
replaceRHSVariablesByEquationsin classEquationExtractor<DEquationExtractor.Type>- Parameters:
node- an equation of the formg:=f^2-1- Returns:
- a copy of the node
- Throws:
ParseException- on error
-
visit
Description copied from interface:GenericVisitorVisit a variable node- Specified by:
visitin interfaceGenericVisitor<Node,DEquationExtractor.Type, ParseException> - Overrides:
visitin classEquationExtractor<DEquationExtractor.Type>- Parameters:
node- current nodedata- context data- Returns:
- the result of visiting the node
- Throws:
ParseException
-