44 mpINumberReference(NULL),
45 mpNumberReference(NULL),
46 mpDNumberReference(NULL),
47 mpConversionFactor(&
CMoiety::DefaultFactor)
58 mINumber(src.mINumber),
59 mIAmount(src.mIAmount),
60 mEquation(src.mEquation),
61 mpINumberReference(NULL),
62 mpNumberReference(NULL),
63 mpDNumberReference(NULL),
64 mpConversionFactor(src.mpConversionFactor)
106 std::pair<C_FLOAT64, CMetab *> element;
108 element.first = value;
109 element.second = pMetabolite;
126 std::vector< std::pair< C_FLOAT64, CMetab * > >::iterator it =
mEquation.begin() + 1;
127 std::vector< std::pair< C_FLOAT64, CMetab * > >::iterator end =
mEquation.end();
129 for (; it != end; ++it)
130 mNumber -= it->first * it->second->getValue();
166 std::ostringstream Description;
167 Description.imbue(std::locale::classic());
168 Description.precision(16);
170 std::vector< std::pair< C_FLOAT64, CMetab * > >::const_iterator it =
mEquation.begin();
171 std::vector< std::pair< C_FLOAT64, CMetab * > >::const_iterator end =
mEquation.end();
173 for (; it != end; ++it)
178 Description <<
" - ";
180 Description <<
" + ";
183 if (fabs(it->first) > 1.0 + 100.0 * std::numeric_limits< C_FLOAT64 >::epsilon() ||
184 fabs(it->first) < 1.0 - 100.0 * std::numeric_limits< C_FLOAT64 >::epsilon())
185 Description << fabs(it->first) <<
"*";
190 return Description.str();
197 std::vector< std::pair< C_FLOAT64, CMetab * > >::iterator it =
mEquation.begin();
198 std::vector< std::pair< C_FLOAT64, CMetab * > >::iterator end =
mEquation.end();
200 for (; it != end; ++it)
201 mINumber += it->first * it->second->getInitialValue();
216 std::vector< std::pair< C_FLOAT64, CMetab * > >::iterator it =
mEquation.begin();
217 std::vector< std::pair< C_FLOAT64, CMetab * > >::iterator end =
mEquation.end();
219 for (; it != end; ++it)
220 mINumber += it->first * it->second->getValue();
230 std::ostringstream Infix;
231 Infix.imbue(std::locale::classic());
234 std::vector< std::pair< C_FLOAT64, CMetab * > >::const_iterator it =
mEquation.begin();
235 std::vector< std::pair< C_FLOAT64, CMetab * > >::const_iterator end =
mEquation.end();
237 for (; it != end; ++it)
247 if (fabs(it->first) > 1.0 + 100.0 * std::numeric_limits< C_FLOAT64 >::epsilon() ||
248 fabs(it->first) < 1.0 - 100.0 * std::numeric_limits< C_FLOAT64 >::epsilon())
249 Infix << fabs(it->first) <<
"*";
251 Infix <<
"<" << it->second->getInitialValueReference()->getCN() <<
">";
const C_FLOAT64 & dependentNumber()
Header file of class CExpression.
virtual bool setObjectParent(const CCopasiContainer *pParent)
CCopasiContainer * getObjectAncestor(const std::string &type) const
bool remove(const std::string &key)
void clearDirectDependencies()
virtual bool setObjectParent(const CCopasiContainer *pParent)
void setRefresh(CType *pType, void(CType::*method)(void))
CCopasiObjectReference< C_FLOAT64 > * mpIValueReference
~CDependentNumberReference()
CCopasiObject * getValueReference() const
CCopasiObject * getTotalNumberReference() const
static const C_FLOAT64 DefaultFactor
const std::vector< std::pair< C_FLOAT64, CMetab * > > & getEquation() const
std::vector< std::pair< C_FLOAT64, CMetab * > > mEquation
std::string getDescription(const CModel *model) const
CTotalNumberReference * mpNumberReference
void initConversionFactor()
CDependentNumberReference * mpDNumberReference
void addDirectDependency(const CCopasiObject *pObject)
const C_FLOAT64 & getNumber2QuantityFactor() const
std::string getExpression() const
const C_FLOAT64 & getDependentNumber() const
CCopasiObjectReference< C_FLOAT64 > * mpValueReference
C_FLOAT64 getNumber() const
std::set< const CObjectInterface * > ObjectSet
static CKeyFactory * getKeyFactory()
const C_FLOAT64 * mpConversionFactor
void add(C_FLOAT64 value, CMetab *metabolite)
void refreshDependentNumber()
virtual bool isPrerequisiteForContext(const CObjectInterface *pObject, const CMath::SimulationContextFlag &context, const CObjectInterface::ObjectSet &changedObjects) const
CDependentNumberReference()
virtual const std::string & getKey() const
CTotalNumberReference * mpINumberReference
CCopasiObject * addObjectReference(const std::string &name, CType &reference, const unsigned C_INT32 &flag=0)
CCopasiObject * getInitialValueReference() const
const C_FLOAT64 & getAmount() const
CMoiety(const std::string &name="NoName", const CCopasiContainer *pParent=NULL)
CCopasiObject * getDependentNumberReference() const
virtual bool isPrerequisiteForContext(const CObjectInterface *pObject, const CMath::SimulationContextFlag &context, const CObjectInterface::ObjectSet &changedObjects) const
#define CONSTRUCTOR_TRACE
void refreshInitialValue()