43 mInitialState(initialState),
44 mCurrentState(currentState),
47 mpBeginIndependent(NULL),
48 mpBeginDependent(NULL),
54 mpInitialValues(NULL),
82 std::map< CModelEntity *, size_t >::iterator it =
107 std::map< CModelEntity *, size_t >::iterator found;
115 size_t Independent, Dependent, Fixed;
116 Independent = Dependent = Fixed = 0;
118 for (i = 1; it != end; ++it, i++)
128 if (i != found->second)
137 switch ((*it)->getStatus())
145 if (static_cast< CMetab * >(*it)->isDependent())
152 assert(Dependent == 0);
159 assert(Dependent == 0);
198 while (it != end) *pUserOrder++ =
getIndex(*it++);
233 std::map< CModelEntity *, size_t >::const_iterator found =
234 mIndexMap.find(const_cast< CModelEntity * >(entity));
237 return found->second;
247 size_t OldSize =
mSize;
268 for (; pTmp != pEnd; ++pTmp, ++pInitialValues, ++pCurrentValues)
271 (*pTmp)->setInitialValuePtr(pInitialValues);
272 (*pTmp)->setValuePtr(pCurrentValues);
282 mpBeginIndependent(NULL),
283 mpBeginDependent(NULL),
286 mUpdateDependentRequired(false)
292 mpBeginIndependent(mpValues + (src.mpBeginIndependent - src.mpValues)),
293 mpBeginDependent(mpValues + (src.mpBeginDependent - src.mpValues)),
294 mpBeginFixed(mpValues + (src.mpBeginFixed - src.mpValues)),
295 mpEnd(mpValues + (src.mpEnd - src.mpValues)),
296 mUpdateDependentRequired(src.mUpdateDependentRequired)
356 for (; pIt != pEnd; ++pIt)
389 const size_t & numDependent,
390 const size_t & numFixed)
404 for (; pValue != s.
mpEnd; ++pValue)
406 os <<
"\t" << *pValue;
void remove(CModelEntity *entity)
CVector< size_t > mUserOrder
Header file of class CModelEntity and CModelValue.
void setUserOrder(const CVector< CModelEntity * > &userOrder)
size_t getNumFixed() const
size_t getNumIndependent() const
void add(CModelEntity *entity)
C_FLOAT64 * mpBeginIndependent
std::ostream & operator<<(std::ostream &os, const CState &s)
void resize(size_t size, const bool ©=false)
size_t getIndex(const CModelEntity *entity) const
CModelEntity ** endDependent()
size_t getNumVariable() const
const size_t & size() const
CModelEntity ** mpBeginDependent
CModelEntity ** beginDependent()
void setTime(const C_FLOAT64 &time)
CModelEntity ** mpBeginIndependent
C_FLOAT64 * mpBeginDependent
C_FLOAT64 * endDependent()
C_FLOAT64 * endIndependent()
size_t getNumDependent() const
bool mUpdateDependentRequired
size_t getNumFixed() const
C_FLOAT64 * mpCurrentValues
CModelEntity ** endFixed()
void setValuePtr(C_FLOAT64 *pValue)
CModelEntity ** mpEntities
CModelEntity ** beginFixed()
size_t getNumIndependent() const
CModelEntity ** beginIndependent()
void setCompileFlag(bool flag=true)
std::map< CModelEntity *, size_t > mIndexMap
const C_FLOAT64 & getTime() const
size_t getNumDependent() const
void updateIterator(const size_t &numIndependent, const size_t &numDependent, const size_t &numFixed)
void setInitialValuePtr(C_FLOAT64 *pInitialValue)
const CVector< size_t > & getUserOrder() const
C_FLOAT64 * beginDependent()
C_FLOAT64 * resize(const size_t &size)
CModelEntity ** endIndependent()
CModelEntity ** mpBeginFixed
C_FLOAT64 * beginIndependent()
void reorder(const CVector< CModelEntity * > &newOrder)
CModelEntity ** getEntities()
C_FLOAT64 * mpInitialValues
CState & operator=(const CState &rhs)
size_t getNumVariable() const