23 : mD1(0), mD2(0), mD3(0), mD4(0), mD5(0),
63 if (exponent <= 0)
return "";
65 if (exponent == 1.0)
return base;
67 std::ostringstream ss;
68 ss << base <<
"^" << exponent;
80 assert(pModel != NULL);
96 if ((s1 !=
"") && (tmp !=
"")) s1 +=
"*";
102 if ((s1 !=
"") && (tmp !=
"")) s1 +=
"*";
108 if ((s1 !=
"") && (tmp !=
"")) s1 +=
"*";
114 if ((s1 !=
"") && (tmp !=
"")) s1 +=
"*";
120 bool parflag =
false;
125 if ((s2 !=
"") && (tmp !=
""))
126 {s2 +=
"*"; parflag =
true;}
132 if ((s2 !=
"") && (tmp !=
""))
133 {s2 +=
"*"; parflag =
true;}
139 if ((s2 !=
"") && (tmp !=
""))
140 {s2 +=
"*"; parflag =
true;}
146 if ((s2 !=
"") && (tmp !=
""))
147 {s2 +=
"*"; parflag =
true;}
151 if (parflag) s2 =
"(" + s2 +
")";
154 if ((s1 ==
"") && (s2 ==
""))
163 return s1 +
"/" + s2;
225 else if (*
this == rhs)
252 std::ostringstream os;
254 if (this->
mUnknown) os <<
"Dim: unknown";
256 else os <<
"Dim: (" << this->
mD1 <<
", " << this->
mD2 <<
", " << this->
mD3
257 <<
", " << this->
mD4 <<
", " << this->
mD5 <<
") "
286 : mpFunction(function),
288 mUseHeuristics(false),
289 mM1(-1.0), mM2(-1.0),
290 mD1(d1), mD2(d2), mD3(d3), mD4(d4), mD5(d5)
303 for (i = 0; i < imax; ++i)
348 if (isMulticompartment)
369 std::vector<std::string> ret;
370 std::vector<CDimension>::const_iterator it1, it2, it1end = store.end();
372 for (it1 = store.begin(), it2 =
mDimensions.begin(); it1 != it1end; ++it1, ++it2)
375 ret.push_back(it1->getDisplayString(pModel));
377 ret.push_back(it1->getDisplayString(pModel) +
" or " + it2->getDisplayString(pModel));
387 if (dynamic_cast<const CMassAction*>(
mpFunction))
395 for (i = 0; i < imax; ++i)
399 for (i = 0; i < imax; ++i)
403 for (i = 0; i < imax; ++i)
462 std::vector<const CEvaluationNode*> nodes;
464 std::vector< CEvaluationNode * >::const_iterator it, itEnd = allnodes.end();
466 for (it = allnodes.begin(); it != itEnd; ++it)
469 if (dynamic_cast<const CEvaluationNodeVariable*>(*it)->getIndex() == index)
471 nodes.push_back(*it);
476 std::vector<const CEvaluationNode * >::const_iterator it2, it2End = nodes.end();
478 for (it2 = nodes.begin(); it2 != it2End; ++it2)
500 else if (requestingNode)
527 assert(requestingNode);
529 switch (opnode->
getType() & 0x00FFFFFF)
548 if (requestingNode == opnode->
getLeft())
551 if (requestingNode == opnode->
getRight())
591 if (requestingNode == opnode->
getLeft())
594 if (requestingNode == opnode->
getRight())
622 if (requestingNode == opnode->
getLeft())
628 if (requestingNode == opnode->
getRight())
656 void CFindDimensions::printDebugOutput(
const CModel* pModel)
const
658 std::cout <<
"mDimensions " <<
mDimensions.size() << std::endl;
661 for (i = 0; i < imax; ++i)
662 std::cout << i <<
": " <<
mDimensions[i].print(pModel) << std::endl;
664 #endif // COPASI_DEBUG
C_FLOAT64 mD3
exponent of time base unit
CDimension compare(const CDimension &rhs) const
const C_FLOAT64 & getValue() const
CEvaluationNode * getRight()
CDimension mRootDimension
const Type & getType() const
std::string getTimeUnitName() const
void fixDimensionless(bool d1, bool d2, bool d3, bool d4, bool d5)
static std::string constructDisplayElement(const std::string &base, C_FLOAT64 exponent)
const std::vector< CDimension > & getDimensions() const
std::string getDisplayString(const CModel *pModel) const
void setUseHeuristics(bool flag)
C_FLOAT64 mD5
exponent of length base unit
CDimension operator-(const CDimension &rhs) const
std::string getLengthUnitName() const
void setChemicalEquation(const CChemEq *eq)
void findDimension(size_t index)
find dim for one parameter
std::string print(const CModel *pModel) const
std::vector< CDimension > mDimensions
C_FLOAT64 mD4
exponent of area base unit
const CFunction * mpFunction
std::string getAreaUnitName() const
bool operator==(const CDimension &rhs) const
CEvaluationNode * getLeft()
std::string getQuantityUnitName() const
C_FLOAT64 mD2
exponent of volume base unit
void findDimensions()
find dim for all parameters
CCopasiNode< Data > * getParent()
void setDimension(const C_FLOAT64 &d1, const C_FLOAT64 &d2, const C_FLOAT64 &d3, const C_FLOAT64 &d4, const C_FLOAT64 &d5)
The class for handling a chemical kinetic function.
C_FLOAT64 mD1
exponent of quantity base unit
void findDimensionsMassAction()
CDimension operator+(const CDimension &rhs) const
size_t getMolecularity(const MetaboliteRole role) const
std::string getVolumeUnitName() const
bool isContradiction() const
std::vector< std::string > findDimensionsBoth(const CModel *pModel)
const std::vector< CEvaluationNode * > & getNodeList() const
void setMolecularitiesForMassAction(const size_t &m1, const size_t &m2)
CFunctionParameters & getVariables()
CDimension operator*(const C_FLOAT64 &rhs) const