1#ifndef CPPAD_CG_DOT_UTIL_INCLUDED
2#define CPPAD_CG_DOT_UTIL_INCLUDED
18#include <cppad/cg/lang/c/lang_c_default_var_name_gen.hpp>
27inline void printDotExpression(
CG<Base>& dep,
28 std::ostream& out = std::cout) {
29 if (dep.getOperationNode() !=
nullptr) {
30 if (dep.getOperationNode()->getCodeHandler() ==
nullptr) {
31 throw CGException(
"Unable to print expression: found an operation node without a CodeHandler!");
38 std::vector<CG<Base> > depv(1);
41 std::ostringstream code;
42 handler.generateCode(code, langDot, depv, nameGen);
46 "\"" << dep.getValue() <<
"\" -> \"y[0]\"\n"
53 std::ostream& out = std::cout) {
54 printDotExpression(
CG<Base>(dep), out);