Package math.differentialcalculus
Class ExpressionSimplifier
java.lang.Object
math.differentialcalculus.ExpressionSimplifier
Objects of this class seek to
simplify a math expression, by taking it
through a series of transformative processes.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) FormulaManager
An ArrayList containing the tokens of an algebraic expression. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate String
Automatically generates a name for a given Formula object..especially since these are automatically created on the fly during expression simplification.static void
simplifyCompoundBrackets
(List<String> list) Simplifies tokens in a List that have no + or - operator, but may have brackets.Used by the main parser solve to figure out SBP portions of a multi-bracketed expression (MBP)
-
Field Details
-
scanned
An ArrayList containing the tokens of an algebraic expression. -
manager
FormulaManager manager
-
-
Constructor Details
-
ExpressionSimplifier
-
-
Method Details
-
getSimplifiedExpression
- Returns:
- an ArrayList containing the simplified expression.
-
translateToBaseTerms
- Returns:
- an ArrayList containing a Formula object's data in terms of the base variable.
-
simplifyCompoundBrackets
Simplifies tokens in a List that have no + or - operator, but may have brackets. e.g. ((x^2)*(2/x)*...)- Parameters:
list
- The List containing the tokens.
-
solve
Used by the main parser solve to figure out SBP portions of a multi-bracketed expression (MBP)- Parameters:
list
- a list of scanner tokens of a maths expression- Returns:
- the solution to a SBP maths expression
-
generateName
Automatically generates a name for a given Formula object..especially since these are automatically created on the fly during expression simplification.- Returns:
- a unique name for the object.
-