Calculators

Calculators compute values of expressions, residuals of equations and truth-values of logical expressions.

Basic

#include<hysj/calculators/basic.hpp>

In namespace calculators:

A basic calculator implementation. Does a recursive post-order traversal from each operation to be evaluated. Uses cached results if they exists, else evaluates the operation.

struct basic
type cache_type
mathematics::program program
cache_type cache
basic(const mathematics::program &p)
Create a calculator for p.

void operator()(const mathematics::equation_ids &equations, const mathematics::expression_ids &parameters, std::span<real> valuation, std::span<real> result);
Stores valuation for parameters in cache, compute the residuals of the equations and store them in result.