COPASI API
4.16.103
|
#include <stress_test.h>
Public Member Functions | |
void | run (const std::vector< std::string > &filenames) |
stress_test () | |
virtual | ~stress_test () |
Protected Member Functions | |
void | normalizeAndSimplifyExpressions (const Model *pModel) |
void | normalizeAndSimplifyFunctionDefinitions (const Model *pModel) |
void | normalizeFunctionDB () |
void | normalizeMath (const std::string &filename) |
Static Protected Member Functions | |
static bool | normalize_names (ASTNode *pNode, const Reaction *pReaction, const Model *pModel) |
Definition at line 50 of file stress_test.h.
stress_test::stress_test | ( | ) |
Constructor.
Definition at line 57 of file stress_test.cpp.
References CCopasiRootContainer::addDatamodel(), CCopasiRootContainer::init(), and mpDataModel.
|
virtual |
Destructor.
Definition at line 85 of file stress_test.cpp.
References CCopasiRootContainer::destroy(), mNormalizedCOPASIFunctionDefinitions, mNormalizedExpressions, and mNormalizedFunctionDefinitions.
|
staticprotected |
Definition at line 1305 of file stress_test.cpp.
Referenced by normalizeAndSimplifyExpressions().
|
protected |
Normalizes all expressions but the function definitions in the given model. void normalizeExpressions(const Model* pModel); Normalizes the function definitions in the given model. void normalizeFunctionDefinitions(const Model* pModel); Normalizes all expressions but the function definitions in the given model.
Normalizes all expressions but the function definitions in the given model.
Definition at line 412 of file stress_test.cpp.
References are_equal(), create_expression(), create_simplified_normalform(), CReaction::getFunction(), CCopasiDataModel::getModel(), CCopasiObject::getObjectName(), CModel::getReactions(), mDifferentNormalform, mExpressionMappings, mNormalizedCOPASIFunctionDefinitions, mNumExceeded, mNumExpressions, mNumFailed, mNumKineticFunctions, mNumMappedKineticExpressions, mNumSBO, mNumUnmappedKineticExpressions, mpDataModel, mProcessTimes, mSBOMap, mTV1, mTV2, mTZ1, mTZ2, mUnknownCategories, normalize_names(), and CCopasiVector< T >::size().
Referenced by normalizeMath().
|
protected |
Normalizes the function definitions in the given model.
Definition at line 983 of file stress_test.cpp.
References create_simplified_normalform(), expand_function_calls(), mNormalizedFunctionDefinitions, mNumExceededFunctions, mNumFailedFunctions, mNumFunctionDefinitions, mProcessTimes, mTV1, mTV2, mTZ1, and mTZ2.
Referenced by normalizeMath().
|
protected |
Normalizes COPASIs function database.
Normalizes all expressions but the function definitions in the given model. void stress_test::normalizeExpressions(const Model* pModel) { expressions can occur in assignments, initial assignments, kinetic laws event triggers, event delays, event assignments and stiochiometric expressions const InitialAssignment* pInitialAssignment = NULL; const ASTNode* pMath = NULL; ASTNode* pNewMath = NULL; CNormalFraction* pFraction = NULL; initial assignments unsigned int i, iMax = pModel->getListOfInitialAssignments()->size(); for (i = 0;i < iMax;++i) { pInitialAssignment = pModel->getInitialAssignment(i); assert(pInitialAssignment != NULL); pMath = pInitialAssignment->getMath(); if (pMath != NULL) { pNewMath = create_expression(pMath, pModel); assert(pNewMath != NULL); pFraction = create_normalform(pNewMath); delete pNewMath; assert(pFraction != NULL); this->mNormalizedExpressions.push_back(pFraction); } } rules const Rule* pRule = NULL; iMax = pModel->getListOfRules()->size(); for (i = 0;i < iMax;++i) { pRule = pModel->getRule(i); assert(pRule != NULL); pMath = pRule->getMath(); if (pMath != NULL) { pNewMath = create_expression(pMath, pModel); assert(pNewMath != NULL); pFraction = create_normalform(pNewMath); delete pNewMath; assert(pFraction != NULL); this->mNormalizedExpressions.push_back(pFraction); } } kinetic laws + stoichiometric expressions const Reaction* pReaction = NULL; iMax = pModel->getListOfReactions()->size(); for (i = 0;i < iMax;++i) { pReaction = pModel->getReaction(i); assert(pReaction != NULL); const KineticLaw* pLaw = pReaction->getKineticLaw(); if (pLaw != NULL) { pMath = pLaw->getMath(); if (pMath != NULL) { pNewMath = create_expression(pMath, pModel); assert(pNewMath != NULL); pFraction = create_normalform(pNewMath); delete pNewMath; assert(pFraction != NULL); this->mNormalizedExpressions.push_back(pFraction); } } const SpeciesReference* pSpeciesReference = NULL; substrates unsigned j, jMax = pReaction->getListOfReactants()->size(); for (j = 0;j < jMax;++j) { pSpeciesReference = pReaction->getReactant(j); assert(pSpeciesReference != NULL); if (pSpeciesReference->isSetStoichiometryMath()) { const StoichiometryMath* pSMath = pSpeciesReference->getStoichiometryMath(); assert(pSMath != NULL); pMath = pSMath->getMath(); if (pMath != NULL) { pNewMath = create_expression(pMath, pModel); assert(pNewMath != NULL); pFraction = create_normalform(pNewMath); delete pNewMath; assert(pFraction != NULL); this->mNormalizedExpressions.push_back(pFraction); } } } products jMax = pReaction->getListOfProducts()->size(); for (j = 0;j < jMax;++j) { pSpeciesReference = pReaction->getProduct(j); assert(pSpeciesReference != NULL); if (pSpeciesReference->isSetStoichiometryMath()) { const StoichiometryMath* pSMath = pSpeciesReference->getStoichiometryMath(); assert(pSMath != NULL); pMath = pSMath->getMath(); if (pMath != NULL) { pNewMath = create_expression(pMath, pModel); assert(pNewMath != NULL); pFraction = create_normalform(pNewMath); delete pNewMath; assert(pFraction != NULL); this->mNormalizedExpressions.push_back(pFraction); } } } } events const Event* pEvent = NULL; const Trigger* pTrigger = NULL; const Delay* pDelay = NULL; iMax = pModel->getListOfEvents()->size(); for (i = 0;i < iMax;++i) { pEvent = pModel->getEvent(i); assert(pEvent != NULL); trigger pTrigger = pEvent->getTrigger(); assert(pTrigger != NULL); pMath = pTrigger->getMath(); if (pMath != NULL) { pNewMath = create_expression(pMath, pModel); assert(pNewMath != NULL); pFraction = create_normalform(pNewMath); delete pNewMath; assert(pFraction != NULL); this->mNormalizedExpressions.push_back(pFraction); }
delay if (pEvent->isSetDelay()) { pDelay = pEvent->getDelay(); assert(pDelay != NULL); pMath = pDelay->getMath(); if (pMath != NULL) { pNewMath = create_expression(pMath, pModel); assert(pNewMath != NULL); pFraction = create_normalform(pNewMath); delete pNewMath; assert(pFraction != NULL); this->mNormalizedExpressions.push_back(pFraction); } }
event assignments unsigned int j, jMax = pEvent->getListOfEventAssignments()->size(); const EventAssignment* pEventAssignment = NULL; for (j = 0;j < jMax;++j) { pEventAssignment = pEvent->getEventAssignment(j); assert(pEventAssignment != NULL); pMath = pEventAssignment->getMath(); if (pMath != NULL) { pNewMath = create_expression(pMath, pModel); assert(pNewMath != NULL); pFraction = create_normalform(pNewMath); delete pNewMath; assert(pFraction != NULL); this->mNormalizedExpressions.push_back(pFraction); } } } } Normalizes the function definitions in the given model. void stress_test::normalizeFunctionDefinitions(const Model* pModel) { const FunctionDefinition* pFunDef = NULL; const ASTNode* pRoot = NULL; ASTNode* pNewRoot = NULL; CNormalFraction* pFraction = NULL; unsigned int i, iMax = pModel->getListOfFunctionDefinitions()->size(); for (i = 0;i < iMax;++i) { pFunDef = pModel->getFunctionDefinition(i); pRoot = pFunDef->getMath(); the actual function is the last child if (pRoot != NULL && pRoot->getNumChildren() > 0) { function definitons have to be expanded const ASTNode* pMath = pRoot->getChild(pRoot->getNumChildren() - 1); assert(pMath != NULL); pNewRoot = expand_function_calls(pMath, pModel); assert(pNewRoot != NULL); pFraction = create_normalform(pNewRoot); assert(pFraction != NULL); mNormalizedFunctionDefinitions.push_back(pFraction); } } } Normalizes COPASIs function database.
Definition at line 1248 of file stress_test.cpp.
References expand_function_calls(), CCopasiRootContainer::getFunctionList(), CCopasiObject::getObjectName(), CEvaluationTree::getRoot(), CFunctionDB::loadedFunctions(), mNormalizedCOPASIFunctionDefinitions, mNumCOPASIFunctions, mNumExceededCOPASIFunctions, mNumFailedCOPASIFunctions, mProcessTimes, mTV1, mTV2, mTZ1, mTZ2, CNormalTranslation::normAndSimplifyReptdly(), CEvaluationNode::printRecursively(), and CCopasiVector< T >::size().
Referenced by run().
|
protected |
Loads an sbml model from the given file and normalized all mathematical expressions in the SBML model.
Definition at line 372 of file stress_test.cpp.
References CCopasiDataModel::getCurrentSBMLDocument(), CCopasiDataModel::importSBML(), mNumFiles, mpDataModel, mUnreadableFiles, normalizeAndSimplifyExpressions(), and normalizeAndSimplifyFunctionDefinitions().
Referenced by run().
void stress_test::run | ( | const std::vector< std::string > & | filenames | ) |
Goes through the list of files, loads each file and normalizes the mathematical expressions in the contained model.
Definition at line 121 of file stress_test.cpp.
References are_equal(), mDifferentNormalform, mExpressionMappings, mNormalizedCOPASIFunctionDefinitions, mNormalizedFunctionDefinitions, mNumCOPASIFunctions, mNumExceeded, mNumExceededCOPASIFunctions, mNumExceededFunctions, mNumExpressions, mNumFailed, mNumFailedCOPASIFunctions, mNumFailedFunctions, mNumFiles, mNumFunctionDefinitions, mNumKineticFunctions, mNumMappedKineticExpressions, mNumSBO, mNumUnmappedKineticExpressions, mProcessTimes, mSBOMap, mUnknownCategories, mUnreadableFiles, normalizeFunctionDB(), and normalizeMath().
Referenced by main().
|
protected |
Definition at line 177 of file stress_test.h.
Referenced by normalizeAndSimplifyExpressions(), and run().
|
protected |
Definition at line 174 of file stress_test.h.
Referenced by normalizeAndSimplifyExpressions(), and run().
|
protected |
Definition at line 172 of file stress_test.h.
Referenced by normalizeAndSimplifyExpressions(), normalizeFunctionDB(), run(), and ~stress_test().
|
protected |
Definition at line 170 of file stress_test.h.
Referenced by ~stress_test().
|
protected |
Definition at line 171 of file stress_test.h.
Referenced by normalizeAndSimplifyFunctionDefinitions(), run(), and ~stress_test().
|
protected |
Definition at line 167 of file stress_test.h.
|
protected |
Definition at line 161 of file stress_test.h.
Referenced by normalizeFunctionDB(), and run().
|
protected |
Definition at line 159 of file stress_test.h.
Referenced by normalizeAndSimplifyExpressions(), and run().
|
protected |
Definition at line 162 of file stress_test.h.
Referenced by normalizeFunctionDB(), and run().
|
protected |
Definition at line 156 of file stress_test.h.
Referenced by normalizeAndSimplifyFunctionDefinitions(), and run().
|
protected |
Definition at line 158 of file stress_test.h.
Referenced by normalizeAndSimplifyExpressions(), and run().
|
protected |
Definition at line 160 of file stress_test.h.
Referenced by normalizeAndSimplifyExpressions(), and run().
|
protected |
Definition at line 163 of file stress_test.h.
Referenced by normalizeFunctionDB(), and run().
|
protected |
Definition at line 157 of file stress_test.h.
Referenced by normalizeAndSimplifyFunctionDefinitions(), and run().
|
protected |
Definition at line 164 of file stress_test.h.
Referenced by normalizeMath(), and run().
|
protected |
Definition at line 155 of file stress_test.h.
Referenced by normalizeAndSimplifyFunctionDefinitions(), and run().
|
protected |
Definition at line 165 of file stress_test.h.
Referenced by normalizeAndSimplifyExpressions(), and run().
|
protected |
Definition at line 168 of file stress_test.h.
Referenced by normalizeAndSimplifyExpressions(), and run().
|
protected |
Definition at line 166 of file stress_test.h.
|
protected |
Definition at line 178 of file stress_test.h.
Referenced by normalizeAndSimplifyExpressions(), and run().
|
protected |
Definition at line 169 of file stress_test.h.
Referenced by normalizeAndSimplifyExpressions(), and run().
|
protected |
Definition at line 179 of file stress_test.h.
Referenced by normalizeAndSimplifyExpressions(), normalizeMath(), and stress_test().
|
protected |
Definition at line 184 of file stress_test.h.
Referenced by normalizeAndSimplifyExpressions(), normalizeAndSimplifyFunctionDefinitions(), normalizeFunctionDB(), and run().
|
protected |
Definition at line 175 of file stress_test.h.
Referenced by normalizeAndSimplifyExpressions(), and run().
|
protected |
Definition at line 180 of file stress_test.h.
Referenced by normalizeAndSimplifyExpressions(), normalizeAndSimplifyFunctionDefinitions(), and normalizeFunctionDB().
|
protected |
Definition at line 182 of file stress_test.h.
Referenced by normalizeAndSimplifyExpressions(), normalizeAndSimplifyFunctionDefinitions(), and normalizeFunctionDB().
|
protected |
Definition at line 181 of file stress_test.h.
Referenced by normalizeAndSimplifyExpressions(), normalizeAndSimplifyFunctionDefinitions(), and normalizeFunctionDB().
|
protected |
Definition at line 183 of file stress_test.h.
Referenced by normalizeAndSimplifyExpressions(), normalizeAndSimplifyFunctionDefinitions(), and normalizeFunctionDB().
|
protected |
Definition at line 176 of file stress_test.h.
Referenced by normalizeAndSimplifyExpressions(), and run().
|
protected |
Definition at line 173 of file stress_test.h.
Referenced by normalizeMath(), and run().