本文整理汇总了C++中SpeciesReference::unsetStoichiometryMath方法的典型用法代码示例。如果您正苦于以下问题:C++ SpeciesReference::unsetStoichiometryMath方法的具体用法?C++ SpeciesReference::unsetStoichiometryMath怎么用?C++ SpeciesReference::unsetStoichiometryMath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SpeciesReference
的用法示例。
在下文中一共展示了SpeciesReference::unsetStoichiometryMath方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: removeFromParentAndDelete
int StoichiometryMath::removeFromParentAndDelete()
{
SBase* parent = getParentSBMLObject();
if (parent==NULL) return LIBSBML_OPERATION_FAILED;
SpeciesReference* parentSR = static_cast<SpeciesReference*>(parent);
if (parentSR == NULL) return LIBSBML_OPERATION_FAILED;
return parentSR->unsetStoichiometryMath();
}
示例2: dealWithAssigningL1Stoichiometry
void dealWithAssigningL1Stoichiometry(Model & m, bool l2)
{
//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);
// we do not get here unless the stoichiometryMath is an integer
// or a rational
if (l2 == true && sr->isSetStoichiometryMath() == true)
{
const ASTNode* ast = sr->getStoichiometryMath()->getMath();
if (ast->isInteger())
{
int num = ast->getInteger();
sr->setStoichiometry(num);
sr->setDenominator(1);
}
else
{
int num = ast->getNumerator();
int denom = ast->getDenominator();
sr->setStoichiometry(num);
sr->setDenominator(denom);
}
sr->unsetStoichiometryMath();
}
else
{
sr->setStoichiometry(sr->getStoichiometry());
sr->setDenominator(1);
}
}
for (j = 0; j < r->getNumProducts(); j++)
{
SpeciesReference *sr = r->getProduct(j);
// we do not get here unless the stoichiometryMath is an integer
// or a rational
if (l2 == true && sr->isSetStoichiometryMath() == true)
{
const ASTNode* ast = sr->getStoichiometryMath()->getMath();
if (ast->isInteger())
{
int num = ast->getInteger();
sr->setStoichiometry(num);
sr->setDenominator(1);
}
else
{
int num = ast->getNumerator();
int denom = ast->getDenominator();
sr->setStoichiometry(num);
sr->setDenominator(denom);
}
sr->unsetStoichiometryMath();
}
else
{
sr->setStoichiometry(sr->getStoichiometry());
sr->setDenominator(1);
}
}
}
}