Expression evaluation
PUEL calculators and unit-expression solvers.
-
class Calculator
Evaluates PUEL expressions and returns PUQ results.
Public Static Attributes
-
static exs::Solver<CalculatorAtom> solver
-
static exs::Solver<CalculatorAtom> solver
-
class CalculatorAtom : public snt::exs::AtomBase<CalculatorAtom, Quantity>
EXS atom that evaluates a PUQ quantity expression.
Public Functions
-
CalculatorAtom(const CalculatorAtom &a) = default
-
virtual std::string to_string() override
Get a string representation of an atom
-
void math_add(CalculatorAtom *other) override
Add another quantity atom, including its units and uncertainty.
- Parameters:
other – Quantity atom to add; dimensions must be compatible.
-
void math_subtract(CalculatorAtom *other) override
-
virtual void math_negate() override
Negate value of this value
-
void math_multiply(CalculatorAtom *other) override
-
void math_divide(CalculatorAtom *other) override
Public Static Functions
-
static Quantity from_string(std::string &s, exs::BaseSettings *set = nullptr)
-
CalculatorAtom(const CalculatorAtom &a) = default
-
class UnitAtom : public snt::exs::AtomBase<UnitAtom, Measurement>
EXS atom that resolves a unit expression to a PUQ measurement.
Public Functions
-
inline UnitAtom(Measurement v)
-
virtual std::string to_string() override
Get a string representation of an atom
-
void math_power(ExponentVariant &e)
Public Static Functions
-
static Measurement from_string(const std::string &s, exs::BaseSettings *set = nullptr)
-
inline UnitAtom(Measurement v)
-
class UnitSolver
Calcuates unit atoms from unit expressions
In order to speed up calculations of units this class is caching input unit expression strings and stores already calculated unit atoms in a cache map. This should avoid repeated calculations of the same inputs.
Public Functions
-
UnitSolver() = default
Default constructor
-
UnitSolver() = default