1#ifndef CPPAD_CG_LANG_C_UTIL_INCLUDED
2#define CPPAD_CG_LANG_C_UTIL_INCLUDED
28inline void printModel(ADFun<CG<Base> >&
fun) {
42inline void printModel(ADFun<CG<Base> >&
fun,
43 const std::vector<std::string>&
depNames,
45 CPPADCG_ASSERT_UNKNOWN(
depNames.size() <=
fun.Range())
50 std::vector<CG<Base> >
indep0(
fun.Domain());
55 LanguageC<Base>
langC("
double");
61 "
y", "x", "
z", "array");
63 std::ostringstream
code;
73 std::ostream&
out = std::
cout) {
74 if(
dep.getOperationNode() !=
nullptr) {
75 if(
dep.getOperationNode()->getCodeHandler() ==
nullptr) {
76 throw CGException(
"Unable to print expression: found an operation node without a CodeHandler!");
79 CodeHandler<Base>&
handler = *
dep.getOperationNode()->getCodeHandler();
83 std::vector<CG<Base> >
depv(1);
86 std::ostringstream
code;
90 out <<
"y[0] = " <<
dep.getValue() <<
";" << std::endl;
96 std::ostream&
out = std::cout) {
97 printExpression(CG<Base>(
dep),
out);
bool GreaterThanZero(const cg::CG< Base > &x)