本文整理汇总了C++中SpeciesReference::getDenominator方法的典型用法代码示例。如果您正苦于以下问题:C++ SpeciesReference::getDenominator方法的具体用法?C++ SpeciesReference::getDenominator怎么用?C++ SpeciesReference::getDenominator使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SpeciesReference
的用法示例。
在下文中一共展示了SpeciesReference::getDenominator方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: dealWithL1Stoichiometry
void dealWithL1Stoichiometry(Model & m, bool l2)
{
unsigned int idCount = 0;
char newid[15];
std::string id;
for (unsigned int i = 0; i < m.getNumReactions(); i++)
{
Reaction *r = m.getReaction(i);
unsigned int j;
for (j = 0; j < r->getNumReactants(); j++)
{
SpeciesReference *sr = r->getReactant(j);
if (sr->getDenominator() != 1)
{
long stoich = static_cast<long>(sr->getStoichiometry());
int denom = sr->getDenominator();
ASTNode *node = new ASTNode();
node->setValue(stoich, denom);
if (l2 == true)
{
StoichiometryMath * sm = sr->createStoichiometryMath();
sm->setMath(node);
}
else
{
sprintf(newid, "speciesRefId_%u", idCount);
id.assign(newid);
idCount++;
sr->setId(id);
InitialAssignment * ar = m.createInitialAssignment();
ar->setSymbol(id);
ar->setMath(node);
sr->unsetStoichiometry();
}
}
}
for (j = 0; j < r->getNumProducts(); j++)
{
SpeciesReference *sr = r->getProduct(j);
if (sr->getDenominator() != 1)
{
long stoich = static_cast<long>(sr->getStoichiometry());
int denom = sr->getDenominator();
ASTNode *node = new ASTNode();
node->setValue(stoich, denom);
if (l2 == true)
{
StoichiometryMath * sm = sr->createStoichiometryMath();
sm->setMath(node);
}
else
{
sprintf(newid, "speciesRefId_%u", idCount);
id.assign(newid);
idCount++;
sr->setId(id);
InitialAssignment * ar = m.createInitialAssignment();
ar->setSymbol(id);
ar->setMath(node);
sr->unsetStoichiometry();
}
}
}
}
}