5#ifndef LINE_API_SYM_SYM_ENGINE_H
6#define LINE_API_SYM_SYM_ENGINE_H
75 std::vector<std::string>
pi;
76 std::vector<std::string>
num;
77 std::string
den =
"1";
91 std::vector<std::vector<std::string>>
momAll;
97 std::vector<std::string>
pi;
98 std::vector<std::string>
num;
99 std::string
den =
"1";
112 std::vector<std::string>
pi;
113 std::vector<std::string>
dpi;
136 virtual std::string
name()
const = 0;
149 const std::vector<std::string>& symbols) = 0;
161 const std::vector<std::string>& symbols,
162 const std::string& theta,
163 const std::vector<std::string>& reward) = 0;
183 const std::vector<std::string>& symbols,
184 const std::vector<std::vector<std::string>>& weights,
185 const std::vector<std::string>& names,
186 const std::vector<RatioSpec>& ratios) = 0;
216 const std::vector<std::string>& s0,
217 const std::vector<std::string>& alpha,
218 const std::string& atom,
219 const std::vector<std::string>& symbols,
220 const std::string& svar,
221 const std::vector<std::string>& want,
int nmax) = 0;
230 virtual std::vector<std::string>
simplify(
const std::vector<std::string>& exprs,
231 const std::string& form) = 0;
241 virtual std::vector<std::string>
diff(
const std::vector<std::string>& exprs,
242 const std::string& variable,
int order) = 0;
251 virtual std::vector<double>
eval(
const std::vector<std::string>& exprs,
252 const std::map<std::string, double>& assignment) = 0;
263 const std::vector<std::string>& want) {
264 return fluidODEs(rhs, vars, want, std::vector<std::string>(), std::string());
283 const std::vector<std::string>& vars,
284 const std::vector<std::string>& want,
285 const std::vector<std::string>& constraints,
286 const std::string& domain) = 0;
ExternalError(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.
FluidODEs fluidODEs(const std::vector< std::string > &rhs, const std::vector< std::string > &vars, const std::vector< std::string > &want)
Jacobian, LaTeX form and equilibria of a fluid vector field.
virtual CtmcMeasures ctmcMeasures(const std::vector< std::vector< std::string > > &Q, const std::vector< std::string > &symbols, const std::vector< std::vector< std::string > > &weights, const std::vector< std::string > &names, const std::vector< RatioSpec > &ratios)=0
Stationary distribution and a set of weighted sums of it.
virtual FluidODEs fluidODEs(const std::vector< std::string > &rhs, const std::vector< std::string > &vars, const std::vector< std::string > &want, const std::vector< std::string > &constraints, const std::string &domain)=0
Jacobian, LaTeX form and equilibria of a fluid vector field, the equilibria pinned by invariants the ...
virtual Passage ctmcPassage(const std::vector< std::vector< std::string > > &S, const std::vector< std::string > &s0, const std::vector< std::string > &alpha, const std::string &atom, const std::vector< std::string > &symbols, const std::string &svar, const std::vector< std::string > &want, int nmax)=0
First passage time into a target set: the transform and the moments.
The exception types the port throws.
Conservation laws of a layered queueing network, enumerated from its structure.
The <kind> part of a LINE:<category>:<kind> identifier (see _kb/17-error-vocabulary....
One weighted sum of the stationary distribution, or a ratio of two.
std::string name
Caller supplied name.
std::string num
Numerator of expr, empty when undefined.
std::string reason
Why the value is undefined, empty otherwise.
std::string expr
The value as a rational function, or "undefined".
std::string den
Denominator of expr, empty when undefined.
bool isDefined() const
True if this measure has a value.
Stationary distribution together with the measures taken from it.
std::vector< CtmcMeasure > ratios
One per requested ratio, in order.
std::string den
Common denominator of the whole vector.
std::vector< CtmcMeasure > measures
One per weight vector, in order.
int nConnComp
Weakly connected components.
std::vector< std::string > num
Numerator of each entry over den.
std::vector< int > connComp
Component index of each state, one based.
std::vector< std::string > pi
Stationary probability of each state.
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
First passage time transform and moments.
std::vector< std::vector< std::string > > momAll
Per start state moments.
std::vector< std::string > lstAll
Per start state transform.
std::string lstNum
Numerator of lst.
std::string lst
The transform L(s), empty if not requested.
std::vector< std::string > moments
Moments 1..nmax for the initial law.
std::vector< int > unreachable
States that cannot reach the target.
std::string lstDen
Denominator of lst.
A ratio of two measures, by their index into the weight block.
std::size_t num
Index of the numerator measure.
std::string name
Name of the resulting measure.
std::size_t den
Index of the denominator measure.
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).