|
unsigned long | _nvar |
| Number of original variables in DAG.
|
|
unsigned long | _naux |
| Number of auxiliary variables in DAG.
|
|
t_Vars | _Vars |
| Set of variables in DAG.
|
|
t_Ops | _Ops |
| Set of operations in DAG.
|
|
| FFGraph () |
| Default Constructor.
|
|
virtual | ~FFGraph () |
| Destructor.
|
|
unsigned long | nvar () const |
| Number of original variables in DAG.
|
|
unsigned long | naux () const |
| Number of auxiliary variables in DAG.
|
|
const t_Vars & | Vars () const |
| Reference to set of (all) variables in factorable function.
|
|
void | clear () |
| Clear DAG (all variables and operations)
|
|
std::list< const FFOp * > | subgraph (const unsigned int nDep, const FFVar *pDep) const |
| Extract list of operations corresponding to nDep dependents in array pDep
|
|
std::list< const FFOp * > | subgraph (const std::vector< const FFVar * > &vDep) const |
| Extract list of operations corresponding to dependents vDep
|
|
CPPL::dssmatrix | depmap (const unsigned nDep, const FFVar *const pDep, const unsigned nIndep, const FFVar *const pIndep) |
| Create dependency map corresponding to nDep dependents in array pDep and nIndep independents in array pIndep
|
|
CPPL::dssmatrix | depmap (std::list< const FFOp * > &opDep, const unsigned nDep, const FFVar *const pDep, const unsigned nIndep, const FFVar *const pIndep) |
| Create dependency map corresponding to nDep dependents in array pDep and nIndep independents in array pIndep – This function uses the subgraph for the dependents given in opDep
|
|
CPPL::dssmatrix | depmap (const std::vector< const FFVar * > &vDep, const std::vector< const FFVar * > &vIndep) |
| Create dependency map corresponding to the dependent variables pDep and independent variables pIndep
|
|
CPPL::dssmatrix | depmap (std::list< const FFOp * > &opDep, const std::vector< const FFVar * > &vDep, const std::vector< const FFVar * > &vIndep) |
| Create dependency map corresponding to the dependent variables pDep and independent variables pIndep – This function uses the subgraph for the dependents given in opDep
|
|
void | dot_script (const unsigned int nDep, const FFVar *pDep, std::ostream &os=std::cout) const |
| Generate script for DAG visualization of factors *F using DOT.
|
|
void | dot_script (const std::vector< const FFVar * > &vDep, std::ostream &os=std::cout) const |
| Generate script for DAG visualization of factors *F using DOT.
|
|
std::vector< const FFVar * > | FAD (const std::vector< const FFVar * > &vDep, const std::vector< const FFVar * > &vIndep) |
| Expand DAG with derivatives of dependents vDep with respect to independents vIndep using fadbad::F – Returns a vector with the entries of the Jacobian matrix ordered row-wise.
|
|
const FFVar * | FAD (const unsigned nDep, const FFVar *const pDep, const unsigned nIndep, const FFVar *const pIndep, const bool transp=false) |
| Expand DAG with derivatives of nDep dependents in array pDep with respect to nIndep independents in array pIndep using fadbad::F – Returns an array with entries of the Jacobian matrix ordered row-wise.
|
|
std::vector< const FFVar * > | BAD (const std::vector< const FFVar * > &vDep, const std::vector< const FFVar * > &vIndep) |
| Expand DAG with derivatives of dependents vDep with respect to independents vIndep using fadbad::B – Returns a vector with the entries of the Jacobian matrix ordered row-wise.
|
|
const FFVar * | BAD (const unsigned nDep, const FFVar *const pDep, const unsigned nIndep, const FFVar *const pIndep, const bool transp=false) |
| Expand DAG with derivatives of nDep dependents in array pDep with respect to nIndep independents in array pIndep using fadbad::B – Returns an array with entries of the Jacobian matrix ordered row-wise.
|
|
std::vector< const FFVar * > | TAD (const unsigned int ordermax, const std::vector< const FFVar * > &vDep, const std::vector< const FFVar * > &vVar, const FFVar *const pIndep=0) |
| Expand DAG with Taylor coefficients of dependents vDep with respect to independents vIndep using fadbad::T – Same number of dependents and independent is required, e.g. for expansion of ODE solutions – Return a vector with the 0th, 1st, ..., ordermax'th order Taylor coefficients ordered sequentially.
|
|
const FFVar * | TAD (const unsigned int ordermax, const unsigned nDep, const FFVar *const pDep, const unsigned nVar, const FFVar *const pVar, const FFVar *const pIndep=0) |
| Expand DAG with Taylor coefficients of nDep dependents in array pDep with respect to nIndep independents in array pIndep using fadbad::T – Same number of dependents and independent is required, e.g. for expansion of ODE solutions – Returns an array with the 0th, 1st, ..., ordermax'th order Taylor coefficients ordered sequentially.
|
|
std::vector< const FFVar * > | compose (const std::vector< const FFVar * > &vDepOut, const std::vector< std::pair< const FFVar *, const FFVar * > > &vDepIn) |
| Compose the dependents in vDepOut with those in vDepIn – This function creates the subgraph for the outer dependent variables internally.
|
|
const FFVar * | compose (const unsigned nDepOut, const FFVar *pDepOut, const unsigned nDepIn, const FFVar *pVarOut, const FFVar *pDepIn) |
| Compose the nDepOut dependents in array pDepOut with the nDepIn dependents in array pDepIn for the variables pVarOut – This function creates the subgraph for the outer dependent variables internally.
|
|
template<typename U > |
std::vector< U > | eval (const std::vector< const FFVar * > &vDep, const std::vector< std::pair< const FFVar *, U > > &vVar) |
| Evaluate the dependents in vDep in U arithmetic for the variable values specified in vVar – This function creates the subgraph for the dependent variables internally.
|
|
template<typename U > |
std::vector< U > | eval (std::list< const FFOp * > &opDep, const std::vector< const FFVar * > &vDep, const std::vector< std::pair< const FFVar *, U > > &vVar) |
| Evaluate the dependents in vDep in U arithmetic for the variable values specified in vVar – This function uses the subgraph for the dependent variables given in opDep
|
|
template<typename U > |
std::vector< U > | eval (std::list< const FFOp * > &opDep, U *opRes, const std::vector< const FFVar * > &vDep, const std::vector< std::pair< const FFVar *, U > > &vVar) |
| Evaluate the dependents in vDep in U arithmetic for the variable values specified in vVar – This function uses the subgraph for the dependent variables given in opDep as well as the preallocated array opRes of size opDep.size() to store intermediate results during the evaluation.
|
|
template<typename U > |
void | eval (const unsigned nDep, const FFVar *pDep, U *vDep, const unsigned nVar, const FFVar *pVar, U *vVar, const bool add=false) |
| Evaluate the nDep dependents in array pDep in U arithmetic for the nVar variable in array pVar whose values are specified in vVar and write the result in vDep (or add the result to vDep if add==true) – This function creates the subgraph for the dependent variables internally.
|
|
template<typename U > |
void | eval (std::list< const FFOp * > &opDep, const unsigned nDep, const FFVar *pDep, U *vDep, const unsigned nVar, const FFVar *pVar, U *vVar, const bool add=false) |
| Evaluate the nDep dependents in array pDep in U arithmetic for the nVar variable in array pVar whose values are specified in vVar and write the result in vDep (or add the result to vDep if add==true) – This function uses the subgraph for the dependent variables given in opDep
|
|
template<typename U > |
void | eval (std::list< const FFOp * > &opDep, U *opRes, const unsigned nDep, const FFVar *pDep, U *vDep, const unsigned nVar, const FFVar *pVar, U *vVar, const bool add=false) |
| Evaluate the nDep dependents in array pDep in U arithmetic for the nVar variable in array pVar whose values are specified in vVar and write the result in vDep (or add the result to vDep if add==true) – This function uses the subgraph for the dependent variables given in opDep as well as the preallocated array opRes of size opDep.size() to store intermediate results during the evaluation.
|
|
static void | output (const std::list< const FFOp * > &Ops, std::ostream &os=std::cout) |
| Output list of nodes in Ops to os
|
|
static double | cpuclock () |
| Return current clock time.
|
|
mc::FFGraph is a C++ class representing the DAG of a factorable function, enabling basic manipulations on that DAG, and evaluating the DAG in various arithmetics.