LINE Solver (C++)
Templated C++ port of the LINE queueing solver
Loading...
Searching...
No Matches
line::sym::SymEngine Class Referenceabstract

A computer algebra backend. More...

#include <line/api/sym/sym_engine.h>

Inheritance diagram for line::sym::SymEngine:

Public Member Functions

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 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< 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.

Detailed Description

A computer algebra backend.

Definition at line 82 of file sym_engine.h.

Constructor & Destructor Documentation

◆ ~SymEngine()

virtual line::sym::SymEngine::~SymEngine ( )
inlinevirtual

Definition at line 84 of file sym_engine.h.

Member Function Documentation

◆ ctmcSensitivity()

virtual SymSensitivity line::sym::SymEngine::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 )
pure virtual

Exact parametric sensitivity of a steady-state reward.

Parameters
Qgenerator entries as expression strings, row major
symbolsthe symbols appearing in Q
thetathe symbol to differentiate with respect to
rewardreward rate per state, empty for the distribution alone
Returns
the sensitivity of the distribution and, if a reward is given, of its mean

Implemented in line::sym::SageRestEngine.

◆ diff()

virtual std::vector< std::string > line::sym::SymEngine::diff ( const std::vector< std::string > & exprs,
const std::string & variable,
int order )
pure virtual

Differentiates expressions.

Parameters
exprsthe expressions
variablethe differentiation variable
orderthe order of the derivative, at least 1
Returns
the derivatives, in the input order

Implemented in line::sym::SageRestEngine.

◆ eval()

virtual std::vector< double > line::sym::SymEngine::eval ( const std::vector< std::string > & exprs,
const std::map< std::string, double > & assignment )
pure virtual

Substitutes values for symbols and evaluates.

Parameters
exprsthe expressions
assignmentvalue of each symbol
Returns
the numeric values, NaN where a free symbol remains

Implemented in line::sym::SageRestEngine.

◆ fluidODEs()

virtual FluidODEs line::sym::SymEngine::fluidODEs ( const std::vector< std::string > & rhs,
const std::vector< std::string > & vars,
const std::vector< std::string > & want )
pure virtual

Jacobian, LaTeX form and equilibria of a fluid vector field.

Parameters
rhsthe right hand side of dx/dt, one expression per state variable
varsthe state variable names
wantany of jacobian, latex, equilibria
Returns
the requested items

Implemented in line::sym::SageRestEngine.

◆ isAvailable()

virtual bool line::sym::SymEngine::isAvailable ( ) const
pure virtual

True if the engine answers a health probe.

Implemented in line::sym::SageRestEngine.

◆ name()

virtual std::string line::sym::SymEngine::name ( ) const
pure virtual

Name of the backing engine, e.g.

"sage".

Implemented in line::sym::SageRestEngine.

◆ simplify()

virtual std::vector< std::string > line::sym::SymEngine::simplify ( const std::vector< std::string > & exprs,
const std::string & form )
pure virtual

Rewrites expressions into a normal form.

Parameters
exprsthe expressions
formone of simplify, factor, together, cancel, expand, latex
Returns
the rewritten expressions, in the input order

Implemented in line::sym::SageRestEngine.

◆ solveCTMC()

virtual CtmcSolution line::sym::SymEngine::solveCTMC ( const std::vector< std::vector< std::string > > & Q,
const std::vector< std::string > & symbols )
pure virtual

Symbolic stationary distribution of a CTMC, pi Q = 0 with sum(pi) = 1.

Parameters
Qgenerator entries as expression strings, row major and square
symbolsthe symbols appearing in Q, e.g. x1..xE
Returns
the solution, with pi also split over a common denominator

Implemented in line::sym::SageRestEngine.


The documentation for this class was generated from the following file: