31 const std::string & name):
36 mDependentObjectiveValues(0),
38 mDependentErrorMean(0),
39 mDependentErrorMeanSD(0),
40 mDependentDataCount(0),
50 mDependentObjectiveValues(0),
52 mDependentErrorMean(0),
53 mDependentErrorMeanSD(0),
54 mDependentDataCount(0),
64 mDependentObjectiveValues(0),
66 mDependentErrorMean(0),
67 mDependentErrorMeanSD(0),
68 mDependentDataCount(0),
82 for (; it != end; ++it)
84 if (dynamic_cast< CCopasiParameterGroup * >(*it) == NULL)
continue;
86 if (!elevate<CExperiment, CCopasiParameterGroup>(*it))
return false;
104 std::set< CCopasiObject * > DependentObjects;
107 std::string CurrentFileName(
"");
108 size_t CurrentLineNumber = 1;
111 std::vector< CExperiment * >::iterator end =
mpExperiments->end();
113 for (; it != end; ++it)
115 if (CurrentFileName != (*it)->getFileName())
117 CurrentFileName = (*it)->getFileName();
118 CurrentLineNumber = 1;
135 if (!(*it)->read(in, CurrentLineNumber))
return false;
137 if (!(*it)->compile(listOfContainer))
return false;
139 const std::map< CCopasiObject *, size_t > & ExpDependentObjects
140 = (*it)->getDependentObjects();
141 std::map< CCopasiObject *, size_t >::const_iterator itObject
142 = ExpDependentObjects.begin();
143 std::map< CCopasiObject *, size_t >::const_iterator endObject
144 = ExpDependentObjects.end();
146 for (; itObject != endObject; ++itObject)
147 DependentObjects.insert(itObject->first);
152 std::set< CCopasiObject * >::const_iterator itObject = DependentObjects.begin();
153 std::set< CCopasiObject * >::const_iterator endObject = DependentObjects.end();
155 for (; itObject != endObject; ++itObject, ++ppInsert)
156 *ppInsert = *itObject;
197 std::vector< CExperiment * >::iterator end =
mpExperiments->end();
202 for (; it != end; ++it)
204 (*it)->calculateStatistics();
209 for (i = 0; ppObject != ppEnd; ++ppObject, ++i)
211 Count = (*it)->getColumnValidValueCount(*ppObject);
217 Tmp = (*it)->getRMS(*ppObject);
230 for (i = 0; i != imax; i++)
241 mDependentRMS[i] = std::numeric_limits<C_FLOAT64>::quiet_NaN();
249 for (; it != end; ++it)
254 for (i = 0; ppObject != ppEnd; ++ppObject, ++i)
256 Count = (*it)->getColumnValidValueCount(*ppObject);
264 for (i = 0; i != imax; i++)
276 imax =
std::max(imax, (*it)->getDependentData().numRows());
279 assert(pParentTask != NULL);
281 for (i = 0; i < imax; i++)
291 imax =
std::max(imax, (*it)->extendedTimeSeriesSize());
293 for (i = 0; i < imax; i++)
299 (*it)->updateFittedPointValuesFromExtendedTimeSeries(i);
367 std::vector< CExperiment * >::const_iterator end =
mpExperiments->end();
369 for (; it != end; ++it)
371 if ((*it)->getExperimentType() == type)
395 size_t i, imax =
size();
397 for (i = 0; i < imax; i++)
412 for (; it != end; ++it)
413 if (dynamic_cast< CExperiment * >(*it) == NULL)
415 if (it != swapTarget)
416 swap(it, swapTarget);
424 std::vector< CExperiment * >::iterator endSort =
mpExperiments->end();
433 std::vector< std::string > List;
434 std::string currentFile =
"";
437 std::vector< CExperiment * >::iterator end =
mpExperiments->end();
439 for (; it != end; ++it)
440 if (currentFile != (*it)->getFileName())
442 currentFile = (*it)->getFileName();
443 List.push_back(currentFile);
453 std::vector< CExperiment * >::iterator end =
mpExperiments->end();
455 for (; it != end; ++it)
456 Count += (*it)->getDependentData().numRows() * (*it)->getDependentData().numCols();
469 std::vector< CExperiment * >::iterator end =
mpExperiments->end();
471 for (; it != end; ++it)
480 const std::string & name):
506 else if (weight > 1.0)
std::vector< std::string > getFileNames() const
CCopasiContainer * getObjectAncestor(const std::string &type) const
const CMatrix< C_FLOAT64 > & getIndependentData() const
bool swap(const size_t &iFrom, const size_t &iTo)
const CVector< CCopasiObject * > & getDependentObjects() const
const CMatrix< C_FLOAT64 > & getDependentData() const
const std::string & getObjectName() const
CCrossValidationSet(const CCopasiContainer *pParent, const std::string &name="Validation Set")
CCopasiObject * get(const std::string &key)
std::vector< CCopasiParameter * > * pGROUP
index_iterator endIndex() const
void resize(size_t size, const bool ©=false)
virtual void output(const COutputInterface::Activity &activity)
CVector< C_FLOAT64 > mDependentRMS
CExperiment * getExperiment(const size_t &index)
const CVector< C_FLOAT64 > & getDependentRMS() const
void initializeParameter()
bool calculateStatistics()
const size_t & getValidValueCount() const
bool removeParameter(const std::string &name)
CVector< CCopasiObject * > mDependentObjects
virtual bool elevateChildren()
const C_FLOAT64 & getWeight() const
CVector< C_FLOAT64 > mDependentErrorMeanSD
const CVector< C_FLOAT64 > & getDependentObjectiveValues() const
CExperiment * addExperiment(const CExperiment &experiment)
static bool compare(const CExperiment *lhs, const CExperiment *rhs)
index_iterator beginIndex() const
const CVector< C_FLOAT64 > & getDependentErrorMean() const
const Value & getValue() const
void setWeight(const C_FLOAT64 &weight)
bool hasDataForTaskType(const CCopasiTask::Type &type) const
bool compile(const std::vector< CCopasiContainer * > listOfContainer=CCopasiContainer::EmptyList)
const CCopasiTask::Type & getExperimentType(const size_t &index) const
CCopasiParameter * getParameter(const std::string &name)
CExperimentSet(const CCopasiContainer *pParent, const std::string &name="Experiment Set")
unsigned C_INT32 * mpThreshold
size_t keyToIndex(const std::string &key) const
virtual ~CExperimentSet()
void initializeParameter()
CVector< C_FLOAT64 > mDependentObjectiveValues
const CVector< C_FLOAT64 > & getDependentErrorMeanSD() const
const CCopasiTask::Type & getExperimentType() const
static CKeyFactory * getKeyFactory()
void setThreshold(const unsigned C_INT32 &threshold)
size_t getDataPointCount() const
const unsigned C_INT32 & getThreshold() const
std::vector< CExperiment * > * mpExperiments
std::string StringPrint(const char *format,...)
bool addParameter(const CCopasiParameter ¶meter)
CCopasiParameter * assertParameter(const std::string &name, const CCopasiParameter::Type type, const CType &defaultValue)
const CMatrix< C_FLOAT64 > & getDependentData(const size_t &index) const
CCopasiParameterGroup * getGroup(const std::string &name)
static CLocaleString fromUtf8(const std::string &utf8)
bool setObjectName(const std::string &name)
virtual ~CCrossValidationSet()
parameterGroup::iterator index_iterator
const CMatrix< C_FLOAT64 > & getIndependentData(const size_t &index) const
size_t getExperimentCount() const
CVector< C_FLOAT64 > mDependentErrorMean
CVector< size_t > mDependentDataCount
void removeExperiment(const size_t &index)