This repo demonstrates how to dump the CppAD stack from TMB and visualize the computational graph.
- Command line tools:
apt-get install graphviz inkscape
- Upcoming TMB version 1.7.12 or current master branch installed using
make cran-version
.
To enable tracing of the operation stack compile a model using:
compile("model.cpp", tracesweep=TRUE)
This will set the preprocessor flag CPPAD_FORWARD0SWEEP_TRACE
.
To dump the stack use
obj$env$f(dumpstack=TRUE)
R --slave < dumpstack.R