5#ifndef LINE_API_SYM_SYM_ENGINE_H
6#define LINE_API_SYM_SYM_ENGINE_H
48 std::vector<std::string>
pi;
49 std::vector<std::string>
num;
50 std::string
den =
"1";
63 std::vector<std::string>
pi;
64 std::vector<std::string>
dpi;
73 std::vector<std::vector<std::string>>
jacobian;
75 std::vector<std::map<std::string, std::string>>
equilibria;
87 virtual std::string
name()
const = 0;
100 const std::vector<std::string>& symbols) = 0;
112 const std::vector<std::string>& symbols,
113 const std::string& theta,
114 const std::vector<std::string>& reward) = 0;
123 virtual std::vector<std::string>
simplify(
const std::vector<std::string>& exprs,
124 const std::string& form) = 0;
134 virtual std::vector<std::string>
diff(
const std::vector<std::string>& exprs,
135 const std::string& variable,
int order) = 0;
144 virtual std::vector<double>
eval(
const std::vector<std::string>& exprs,
145 const std::map<std::string, double>& assignment) = 0;
156 const std::vector<std::string>& vars,
157 const std::vector<std::string>& want) = 0;
Error(const std::string &what)
SymEngineError(const std::string &what)
A computer algebra backend.
virtual bool isAvailable() const =0
True if the engine answers a health probe.
virtual std::string name() const =0
Name of the backing engine, e.g.
virtual CtmcSolution solveCTMC(const std::vector< std::vector< std::string > > &Q, const std::vector< std::string > &symbols)=0
Symbolic stationary distribution of a CTMC, pi Q = 0 with sum(pi) = 1.
virtual std::vector< std::string > diff(const std::vector< std::string > &exprs, const std::string &variable, int order)=0
Differentiates expressions.
virtual SymSensitivity ctmcSensitivity(const std::vector< std::vector< std::string > > &Q, const std::vector< std::string > &symbols, const std::string &theta, const std::vector< std::string > &reward)=0
Exact parametric sensitivity of a steady-state reward.
virtual std::vector< std::string > simplify(const std::vector< std::string > &exprs, const std::string &form)=0
Rewrites expressions into a normal form.
virtual std::vector< double > eval(const std::vector< std::string > &exprs, const std::map< std::string, double > &assignment)=0
Substitutes values for symbols and evaluates.
virtual FluidODEs fluidODEs(const std::vector< std::string > &rhs, const std::vector< std::string > &vars, const std::vector< std::string > &want)=0
Jacobian, LaTeX form and equilibria of a fluid vector field.
The exception types the port throws.
Symbolic stationary distribution of a CTMC.
std::vector< std::string > pi
Stationary probability of each state, as an expression.
std::vector< int > connComp
Component index of each state, one based.
std::vector< std::string > num
Numerator of each entry over the common denominator.
int nConnComp
Weakly connected components of the generator.
std::string den
Common denominator of the whole vector.
Symbolic analysis of a fluid vector field.
std::vector< std::string > latex
LaTeX form of each right hand side.
std::vector< std::map< std::string, std::string > > equilibria
variable -> expression
std::vector< std::vector< std::string > > jacobian
d f_i / d x_j
Exact parametric sensitivity, following Trivedi and Bobbio (2017), Sec.
bool hasReward
Whether Er, S and SS were computed.
std::vector< std::string > dpi
Derivative of the distribution with respect to theta.
std::vector< std::string > pi
Stationary distribution.
std::string SS
Scaled sensitivity (theta/E[r]) d(E[r])/dtheta, Eq. (9.80).
std::string Er
Mean reward, empty if no reward was given.
std::string S
Unscaled sensitivity d(E[r])/dtheta, Eq. (9.79).