65 os <<
"total=" << pTrajectoryProblem->
getDuration() <<
",";
67 <<
",METH=stiff" << std::endl;
86 std::ostringstream tmpName;
88 size_t realName_size = realName.size();
93 if (!std::isalpha(ch, C))
97 if (std::isdigit(ch, C)) tmpName << ch;
101 for (i = 1; i < realName_size; i++)
105 if (std::isalpha(ch, C))
107 if (std::isspace(realName[i - 1], C) && std::islower(ch, C))
108 tmpName << (char) toupper(ch);
113 if (std::isdigit(ch, C)) tmpName << ch;
115 if (std::ispunct(ch, C))
139 newName = tmpName.str();
141 size_t newName_size = newName.size();
143 if (newName_size > 7)
145 std::ostringstream cutName;
147 for (i = 0; i < 7; i++)
148 cutName << newName[i];
150 newName = cutName.str();
167 std::ostringstream newname, tmp;
169 size_t name_size = name.size();
172 for (i = 0; i < name_size; i++)
176 if (std::isalpha(ch, C) && std::islower(ch, C))
177 tmp << (char) toupper(ch);
193 std::ostringstream tmpecount;
194 std::ostringstream tmpname;
195 size_t ecount_size, tmpname_size;
200 ecount = tmpecount.str();
202 ecount_size = ecount.size();
210 tmpname_size = name_size + ecount_size;
212 if (tmpname_size > 7)
214 for (i = 0; i < (7 - ecount_size); i++)
218 tmpname << name << ecount;
228 const std::string reserved[45] =
230 "SIN",
"COS",
"TAN",
"ATAN",
"ATAN2",
"SINH",
"EXP",
"DELAY",
"LN",
"LOG10",
231 "LOG",
"T",
"PI",
"IF",
"THEN",
"ELSE",
"ASIN",
"ACOS",
"HEAV",
"SIGN",
232 "CEIL",
"FLR",
"RAN",
"ABS",
"MAX",
"MIN",
"NORMAL",
"BESSELJ",
"BESSELY",
"ERF",
233 "ERFS",
"ARG1",
"ARG2",
"ARG2",
"ARG4",
"ARG5",
"ARG6",
"ARG7",
"ARG8",
"ARG9",
234 "SHIFT",
"NOT",
"INT",
"SUM",
"OF"
237 for (i = 0; i < 45; i++)
248 return "d" + objName +
"/dt";
253 return objName +
"_c";
266 size_t limit = 256, total = 1000;
269 if (line.size() > total)
272 if (line.size() > limit)
275 size_t i, pos0, pos, end = line.
size();
287 while (std::isalnum(ch, C) || ch ==
'_' || ch ==
')')
293 for (i = pos0; i < pos; i++)
300 which << part.c_str() << std::endl;
310 for (i = pos0; i < end; i++)
315 which << part.c_str() << std::endl;
319 which << line << std::endl;
325 const std::string & name,
326 const std::string & expression,
327 const std::string & )
329 std::ostringstream line;
331 line << name <<
"=" << expression;
341 std::ostringstream smKey;
342 smKey <<
"sm_" << metab->
getKey();
349 fixed <<
"#" << comments << std::endl;
363 initial <<
"#" << comments << std::endl;
405 fixed <<
"#" << comments << std::endl;
416 initial <<
"#" << comments << std::endl;
452 fixed <<
"#" << comments << std::endl;
463 initial <<
"#" << comments << std::endl;
497 metab =
dynamic_cast< const CMetab *
>(tmp);
501 std::ostringstream smKey;
502 smKey <<
"sm_" << metab->
getKey();
512 fixed <<
"#" << comments << std::endl;
523 initial <<
"#" << comments << std::endl;
552 fixed <<
"#" << comments << std::endl;
578 std::ostringstream localKey;
579 localKey << reac->
getKey() <<
"_root_func";
581 return NameMap[localKey.str()];
586 std::ostringstream odeKey;
590 odeKey <<
"ode_" << mentity->
getKey();
602 return "# Initial values:";
605 return "# Fixed Model Entities:";
608 return "# Assignment Model Entities:";
611 return "#Kinetics: ";
617 return "# Equations:";
626 os <<
"done" << std::endl;
Header file of class CExpression.
virtual bool exportSingleParameter(const CCopasiParameter *param, std::string &expression, std::string &comments)
virtual std::string getDisplayFunctionString(CFunction *func)
CCopasiProblem * getProblem()
virtual bool exportSingleMetabolite(const CMetab *metab, std::string &expression, std::string &comments)
std::set< std::string > NameSet
virtual bool exportSingleODE(const CModelEntity *mentity, std::string &equation, std::string &comments)
virtual const std::string & getKey() const
virtual std::string exportTitleString(const size_t tmp)
bool exportClosingData(const CModel *copasiModel, std::ostream &os)
std::ostringstream initial
void exportSingleLine(const std::string &line, std::ostringstream &which)
virtual std::string translateObjectName(const std::string &realName)
virtual bool exportSingleCompartment(const CCompartment *comp, std::string &expression, std::string &comments)
virtual bool isEmptyString(std::string &str)
std::string setConcentrationName(const std::string &objName)
std::string testName(const std::string &name)
const C_FLOAT64 & getStepSize() const
virtual bool exportSingleModVal(const CModelValue *modval, std::string &expression, std::string &comments)
std::string buildXPPString() const
const C_FLOAT64 & getDuration() const
virtual const std::string & getKey() const
virtual const std::string & getKey() const
virtual std::string getDisplayExpressionString(CExpression *tmp)
virtual bool exportTitleData(const CCopasiDataModel *pDataModel, std::ostream &os)
virtual std::string translateTimeVariableName()
std::map< std::string, std::string > NameMap
std::ostringstream assignment
The class for handling a chemical kinetic function.
virtual bool exportSingleObject(std::ostringstream &which, const std::string &name, const std::string &expression, const std::string &comments)
std::map< std::string, unsigned C_INT32 > Frequancy
const CModelEntity::Status & getStatus() const
virtual bool exportSingleModelEntity(const CModelEntity *tmp, std::string &expression, std::string &comments)
virtual void setReservedNames()
CEvaluationNode * getRoot()
virtual std::string KineticFunction2ODEmember(const CReaction *reac)
std::string setODEName(const std::string &objName)