|
| virtual | ~SymEngine () |
| virtual std::string | name () const =0 |
| | Name of the backing engine, e.g.
|
| virtual bool | isAvailable () const =0 |
| | True if the engine answers a health probe.
|
| 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 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 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 |
| | Rewrites expressions into a normal form.
|
| 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.
|
| virtual std::vector< std::string > | simplify (const std::vector< std::string > &exprs, const std::string &form)=0 |
| virtual std::vector< std::string > | diff (const std::vector< std::string > &exprs, const std::string &variable, int order)=0 |
| | Differentiates expressions.
|
| 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.
|
A computer algebra backend.
Definition at line 131 of file sym_engine.h.
| virtual CtmcMeasures line::sym::SymEngine::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 ) |
|
pure virtual |
Rewrites expressions into a normal form.
- Parameters
-
| exprs | the expressions |
| form | one of simplify, factor, together, cancel, expand, latex |
- Returns
- the rewritten expressions, in the input order Stationary distribution and a set of weighted sums of it.
Every mean SolverCTMC reports is a NUMERIC linear functional of pi, so the caller builds one weight vector per measure with no algebra at all and this one round trip returns each w . pi as a rational function: a throughput is pi . depRates, a queue length is pi . stateSpaceAggr, a marginal probability is pi . indicator and a mean reward is pi . r.
- Parameters
-
| Q | generator entries as expression strings, row major |
| symbols | the symbols appearing in Q |
| weights | one row per measure, each of length Q.size(); entries are parsed in the same field as Q, so an expression is admissible and not only a number |
| names | a name per weight row, or empty for w0, w1, ... |
| ratios | ratios of two measures, or empty for none |
Implemented in line::sym::SageRestEngine.
| virtual Passage line::sym::SymEngine::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 ) |
|
pure virtual |
First passage time into a target set: the transform and the moments.
With A the complement of the target, S = Q(A,A) the sub-generator, s0 = -S*1 the exit vector and alpha the initial law restricted to A, following Harrison and Knottenbelt (2002),
L(s) = alpha (sI - S)^-1 s0 + atom Eqs. 1-2
(-S) M(n) = n M(n-1), M(0) = 1 Eq. 3
THE MOMENTS COME FROM THE RECURSION, not from differentiating L: it carries no transform symbol, stays in the same fraction field and is nmax right solves against one matrix. Differentiating would leave the fraction field, and the evaluation at s = 0 can hit 0/0 where a factor of s failed to cancel.
- Parameters
-
| S | the sub-generator on the non-target states, row major |
| s0 | the exit vector -S*1 |
| alpha | the initial law restricted to the non-target states |
| atom | the initial mass already inside the target set |
| symbols | the rate symbols appearing in S |
| svar | the transform symbol; adjoined to the field only when a transform is asked for, and required to differ from every rate symbol |
| want | any of lst, lstall, moments, momall |
| nmax | highest moment order, at least 1 |
Implemented in line::sym::SageRestEngine.