99 if (pResult == NULL) pResult = pNode->
copyBranch();
161 if (pResult == NULL) pResult = pNode->
copyBranch();
229 if (pTmpResult != NULL)
247 if (pTmpResult != NULL)
252 if (pTmpResult != NULL)
282 if (pResult == NULL) pResult = pNode->
copyBranch();
304 if (pTmpResult != NULL)
309 if (pTmpResult != NULL)
355 std::vector<CEvaluationNode*>::const_iterator it = callNodes.begin(), endit = callNodes.end();
361 if (pTmpResult != NULL)
423 if (pTmpResult != NULL)
429 if (pTmpResult != NULL)
435 if (pTmpResult != NULL)
498 if (pTmpResult != NULL)
503 if (pTmpResult != NULL)
525 if (pTmpResult != NULL)
530 if (pTmpResult != NULL)
552 if (pTmpResult != NULL)
557 if (pTmpResult != NULL)
602 const std::vector<CEvaluationNode*>* pItems;
603 std::vector<CEvaluationNode*>::const_iterator it, endit;
611 it = pItems->begin();
612 endit = pItems->end();
618 if (pTmpResult != NULL)
690 if (pResult == NULL) pResult = pNode->
copyBranch();
765 std::vector<CEvaluationNode*> chainNodes;
766 findChainNodes(dynamic_cast<CEvaluationNodeOperator*>(pResult), chainNodes);
781 if (pResult == NULL) pResult = pNode->
copyBranch();
818 if (pChild2 != pResult)
839 std::vector<CEvaluationNode*> chainNodes;
840 findChainNodes(dynamic_cast<CEvaluationNodeOperator*>(pResult), chainNodes);
860 if (pResult == NULL) pResult = pNode->
copyBranch();
892 std::ostringstream os;
905 if (*pChild1 == *pChild2)
929 if (pResult == NULL) pResult = pNode->
copyBranch();
965 std::ostringstream os;
978 if (*pChild1 == *pChild2)
1002 if (pResult == NULL) pResult = pNode->
copyBranch();
1016 if (pChild1 != NULL)
1020 if (pChild2 != NULL)
1035 std::ostringstream os;
1047 if (*pChild1 == *pChild2)
1057 if (pResult == NULL)
1071 if (pResult == NULL) pResult = pNode->
copyBranch();
1081 bool changed =
false;
1083 if (chainNodes.size() > 1)
1085 std::vector<CEvaluationNode*>::iterator it = chainNodes.begin(), endit = chainNodes.end();
1092 std::vector<CEvaluationNode*> numbers;
1098 if (pNumberNode != NULL)
1100 numbers.push_back(pNumberNode);
1115 if (numbers.size() > 1)
1118 it = numbers.begin(), endit = numbers.end();
1124 chainNodes.erase(std::find(chainNodes.begin(), chainNodes.end(), *it));
1129 std::ostringstream os;
1131 (*it)->setData(os.str());
1144 if (pChild1 != NULL)
1148 if (pChild2 != NULL)
1152 findChainNodes(dynamic_cast<CEvaluationNodeOperator*>(pChild1), nodes);
1161 findChainNodes(dynamic_cast<CEvaluationNodeOperator*>(pChild2), nodes);
1201 if (chainNodes.size() > 1)
1203 std::vector<CEvaluationNode*>::const_reverse_iterator it = chainNodes.rbegin(), endit = chainNodes.rend();
1228 bool changed =
false;
1230 if (chainNodes.size() > 1)
1240 std::vector<CEvaluationNode*>::iterator it = chainNodes.begin(), endit = chainNodes.end();
1241 std::map<CEvaluationNode, unsigned int> occurenceMap;
1245 std::map<CEvaluationNode, unsigned int>::iterator pos = occurenceMap.find(**it);
1247 if (pos == occurenceMap.end())
1249 occurenceMap[**it] = 1;
1264 std::map<CEvaluationNode, unsigned int>::const_iterator mapIt = occurenceMap.begin(), mapEndit = occurenceMap.end();
1265 std::ostringstream os;
1267 while (mapIt != mapEndit)
1269 os << mapIt->second;
1272 pNewOperator->
addChild(pNumberNode);
1273 pNewOperator->addChild(mapIt->first.copyBranch());
1274 chainNodes.push_back(pNewOperator);
static CEvaluationNode * normalizePowerNode(const CEvaluationNodeOperator *pNode)
static CEvaluationNodeOperator * buildOperatorBranchFromChain(CEvaluationNodeOperator::SubType subType, const std::vector< CEvaluationNode * > &chainNodes)
CEvaluationNode * copyBranch() const
virtual bool addChild(CCopasiNode< Data > *pChild, CCopasiNode< Data > *pAfter=NULL)
CCopasiNode< Data > * getSibling()
static CEvaluationNode * normalizeCEvaluationNodeCall(const CEvaluationNodeCall *pNode)
static CEvaluationNode * normalizeCEvaluationNodeChoice(const CEvaluationNodeChoice *pNode)
static void findChainNodes(CEvaluationNodeOperator *pNode, std::vector< CEvaluationNode * > &nodes)
const C_FLOAT64 & getValue() const
static CEvaluationNode * normalizeCEvaluationNodeDelay(const CEvaluationNodeDelay *pNode)
const Type & getType() const
static CEvaluationNode * normalizeCEvaluationNodeVector(const CEvaluationNodeVector *pNode)
static CEvaluationNode * create(const Type &type, const Data &data)
static CEvaluationNode * normalizeCEvaluationNodeVariable(const CEvaluationNodeVariable *pNode)
const std::vector< CEvaluationNode * > & getVector() const
static CEvaluationNode * normalizeDivideNode(const CEvaluationNodeOperator *pNode)
const std::vector< CEvaluationNode * > getListOfChildNodes() const
static CEvaluationNode * normalizeModulusNode(const CEvaluationNodeOperator *pNode)
static CEvaluationNode * normalizeCEvaluationNodeObject(const CEvaluationNodeObject *pNode)
static CEvaluationNode * normalizeMultiplyNode(const CEvaluationNodeOperator *pNode)
bool addChild(CCopasiNode< Data > *pChild, CCopasiNode< Data > *pAfter=NULL)
static Type type(const Type &type)
virtual const Data & getData() const
virtual bool addChild(CCopasiNode< Data > *pChild, CCopasiNode< Data > *pAfter=NULL)
virtual bool removeChild(CCopasiNode< Data > *pChild)
static CEvaluationNode * normalizeCEvaluationNodeWhiteSpace(const CEvaluationNodeWhiteSpace *pNode)
static CEvaluationNode * normalizeCEvaluationNodeOperator(const CEvaluationNodeOperator *pNode)
static bool eliminateMultipleNumbers(CEvaluationNodeOperator::SubType subType, std::vector< CEvaluationNode * > &chainNodes)
static CEvaluationNode * normalizeCEvaluationNodeStructure(const CEvaluationNodeStructure *pNode)
static Type subType(const Type &type)
static bool reorderNodes(std::vector< CEvaluationNode * > &chainNodes)
static CEvaluationNode * normalize(const CEvaluationNode *node)
static bool collectIdenticalBranches(CEvaluationNodeOperator::SubType subType, std::vector< CEvaluationNode * > &chainNodes)
static CEvaluationNode * normalizeMinusNode(const CEvaluationNodeOperator *pNode)
virtual const Data & getData() const
CCopasiNode< Data > * getChild()
static CEvaluationNode * normalizeCEvaluationNodeFunction(const CEvaluationNodeFunction *pNode)
static CEvaluationNode * normalizeCEvaluationNodeLogical(const CEvaluationNodeLogical *pNode)
static CEvaluationNode * normalizeCEvaluationNodeConstant(const CEvaluationNodeConstant *pNode)
static CEvaluationNode * normalizePlusNode(const CEvaluationNodeOperator *pNode)
static CEvaluationNode * normalizeCEvaluationNodeNumber(const CEvaluationNodeNumber *pNode)