1 #ifndef CPPAD_CG_MODEL_C_SOURCE_GEN_LOOPS_JAC_FR1_INCLUDED 2 #define CPPAD_CG_MODEL_C_SOURCE_GEN_LOOPS_JAC_FR1_INCLUDED 23 size_t maxCompressedSize,
24 const std::string& localFunctionTypeName,
25 const std::string& suffix,
26 const std::string& keyName,
27 const std::map<
size_t, std::set<size_t> >& nonLoopElements,
28 const std::map<
LoopModel<Base>*, std::map<
size_t, std::map<
size_t, std::set<size_t> > > >& loopGroups,
29 void (*generateLocalFunctionName)(std::ostringstream& cache,
const std::string& modelName,
const LoopModel<Base>& loop,
size_t g)) {
33 startingJob(
"'sparse Jacobian'", JobTimer::SOURCE_GENERATION);
39 string argsDcl = langC.generateDefaultFunctionArgumentsDcl();
41 string model_function = _name +
"_" + FUNCTION_SPARSE_JACOBIAN;
42 string localFunction = _name +
"_" + localFunctionTypeName;
43 string nlSuffix =
"noloop_" + suffix;
46 _cache <<
"#include <stdlib.h>\n" 49 generateFunctionDeclarationSource(_cache, localFunction, nlSuffix, nonLoopElements, argsDcl);
50 generateFunctionDeclarationSourceLoopForRev(_cache, langC, _name, keyName, loopGroups, generateLocalFunctionName);
53 printForRevUsageFunction(_cache, _baseTypeName, _name,
55 localFunction, suffix,
60 generateLocalFunctionName,
61 _jacSparsity.rows.size(), maxCompressedSize);
65 _sources[model_function +
".c"] = _cache.str();
virtual void generateSparseJacobianWithLoopsSourceFromForRev(const std::map< size_t, CompressedVectorInfo > &jacInfo, size_t maxCompressedSize, const std::string &localFunctionTypeName, const std::string &suffix, const std::string &keyName, const std::map< size_t, std::set< size_t > > &nonLoopElements, const std::map< LoopModel< Base > *, std::map< size_t, std::map< size_t, std::set< size_t > > > > &loopGroups, void(*generateLocalFunctionName)(std::ostringstream &cache, const std::string &modelName, const LoopModel< Base > &loop, size_t g))