Class ExpressionParser
java.lang.Object
org.episteme.core.mathematics.symbolic.parsing.ExpressionParser
Expression parser for mathematical text.
Parses strings like "sin(x) + 2*y^2" into evaluable expressions. Supports automatic differentiation.
- Since:
- 1.0
- Author:
- Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBinary operation: +, -, *, /, ^static classConstant value.static interfaceBase interface for parsed expressions.static classFunction call: sin, cos, tan, exp, log, sqrt, absstatic classUnary negation.static classVariable reference. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ExpressionParser.Exprderivative(String expression, String variable) Compute derivative symbolically.static doubleQuick evaluation of an expression.static Map<String, ExpressionParser.Expr> Compute gradient for all variables.static doubleCompute numerical derivative using central difference.static ExpressionParser.ExprParse a mathematical expression string.static ExpressionParser.Expr
-
Constructor Details
-
ExpressionParser
public ExpressionParser()
-
-
Method Details
-
parse
Parse a mathematical expression string.- Parameters:
expression- Text like "x^2 + sin(y)"- Returns:
- Parsed expression node
-
simplify
-
eval
-
derivative
Compute derivative symbolically. -
numericalDerivative
-
gradient
Compute gradient for all variables.
-