math_expressions library

A math library for parsing and evaluating expressions in real, interval and vector contexts. It also supports simplification and differentiation of expressions.

The libary supports the three basic data types Number, Interval and Vector. It includes a Parser to create Expressions from Strings.

Classes

Abs
The absolute value function.
BinaryOperator
A binary operator takes two expressions and performs an operation on them.
BoundVariable
A bound variable is an anonymous variable, e.g. a variable without name, which is bound to an expression.
CompositeFunction
A composition of two given MathFunctions.
ContextModel
The context model keeps track of all known variables and functions. [...]
Cos
The cosine function.
CustomFunction
Any user-created function is a CustomFunction.
DefaultFunction
A default function is predefined in this library. It contains no expression, because the appropriate `Evaluator` knows how to handle them. [...]
Divide
The divide operator performs a division.
EvaluationType
Mathematical expressions must be evaluated under a certain EvaluationType. [...]
Exponential
The exponential function.
Expression
Any Expression supports basic mathematical operations like addition, subtraction, multiplication, division, power and negate. [...]
Interval
An Interval is defined by its minimum and maximum values, where min <= max. [...]
IntervalLiteral
An interval literal.
Lexer
The lexer creates tokens (see TokenType and Token) from an input string. The input string is expected to be in infix notation form. The lexer can convert an infix stream into a postfix stream (Reverse Polish Notation) for further processing by a Parser.
Literal
A literal can be a number, a constant or a variable.
Ln
The natural logarithm (log based e).
Log
The logarithm function.
MathFunction
A function with an arbitrary number of arguments. [...]
Minus
The minus operator performs a subtraction.
Number
A number is a constant number literal.
Parser
The Parser creates a mathematical Expression from a given input string. [...]
Plus
The plus operator performs an addition.
Point3D
A point in 3-dimensional space. This implementation supplies common mathematical operations on points.
Power
The power operator.
Root
The n-th root function. n needs to be a natural number. [...]
Sgn
The sign function.
Sin
The sine function.
Sqrt
The square root function.
Tan
The tangens function.
Times
The times operator performs a multiplication.
Token
A Token consists of text and has a TokenType.
TokenType
UnaryMinus
The unary minus negates its argument.
UnaryOperator
A unary operator takes one argument and performs an operation on it.
Variable
A variable is a named literal.
Vector
A vector of arbitrary size.