COPASI API  4.16.103
Functions
CFitProblem.cpp File Reference
#include <cmath>
#include "copasi.h"
#include "CFitProblem.h"
#include "CFitItem.h"
#include "CFitTask.h"
#include "CExperimentSet.h"
#include "CExperiment.h"
#include "CopasiDataModel/CCopasiDataModel.h"
#include "report/CCopasiRootContainer.h"
#include "model/CModel.h"
#include "model/CState.h"
#include "report/CCopasiObjectReference.h"
#include "report/CKeyFactory.h"
#include "steadystate/CSteadyStateTask.h"
#include "trajectory/CTrajectoryTask.h"
#include "trajectory/CTrajectoryProblem.h"
#include "utilities/CProcessReport.h"
#include "utilities/CCopasiException.h"
#include "utilities/CAnnotatedMatrix.h"
#include "lapack/blaswrap.h"
#include "lapack/lapackwrap.h"
Include dependency graph for CFitProblem.cpp:

Go to the source code of this file.

Functions

void createParameterSetsForExperiment (CExperiment *pExp)
 
std::ostream & operator<< (std::ostream &os, const CFitProblem &o)
 

Function Documentation

void createParameterSetsForExperiment ( CExperiment pExp)

Utility function creating a parameter set for each experiment

Definition at line 807 of file CFitProblem.cpp.

References CCopasiVectorN< CType >::add(), C_INVALID_INDEX, CModelParameterSet::createFromModel(), CCopasiVectorN< CType >::getIndex(), CCopasiDataModel::getModel(), CModel::getModelParameterSets(), CCopasiObject::getObjectDataModel(), CCopasiObject::getObjectName(), and UTCTimeStamp().

Referenced by CFitProblem::calculate().

808 {
809  if (pExp == NULL) return;
810 
811  CModel* model = pExp->getObjectDataModel()->getModel();
812  std::string origname = "PE: " + UTCTimeStamp() + " Exp: " + pExp->getObjectName();
813  std::string name = origname;
814  int count = 0;
815 
816  while (model->getModelParameterSets().getIndex(name) != C_INVALID_INDEX)
817  {
818  std::stringstream str; str << origname << " (" << ++count << ")";
819  name = str.str();
820  }
821 
822  CModelParameterSet* set = new CModelParameterSet(name);
823  model->getModelParameterSets().add(set, true);
824  set->createFromModel();
825 }
CCopasiDataModel * getObjectDataModel()
const std::string & getObjectName() const
#define C_INVALID_INDEX
Definition: copasi.h:222
virtual size_t getIndex(const std::string &name) const
virtual bool add(const CType &src)
const CCopasiVectorN< CModelParameterSet > & getModelParameterSets() const
Definition: CModel.cpp:1066
std::string UTCTimeStamp()
Definition: utility.cpp:64
Definition: CModel.h:50
std::ostream& operator<< ( std::ostream &  os,
const CFitProblem o 
)

Output stream operator

Parameters
ostream& os
constCFitProblem & A
Returns
ostream & os

Definition at line 1240 of file CFitProblem.cpp.

References CCopasiTask::getDescription(), COptProblem::mpConstraintItems, COptProblem::mpOptItems, CFitProblem::mpSteadyState, CFitProblem::mpTrajectory, and CCopasiTask::CDescription::print().

1241 {
1242  os << "Problem Description:" << std::endl;
1243 
1244  os << "Subtask: " << std::endl;
1245 
1246  if (o.mpSteadyState)
1248 
1249  if (o.mpTrajectory)
1250  o.mpTrajectory->getDescription().print(&os);
1251 
1252  if (!o.mpTrajectory && !o.mpSteadyState)
1253  os << "No Subtask specified.";
1254 
1255  os << std::endl;
1256 
1257  os << "List of Fitting Items:" << std::endl;
1258 
1259  std::vector< COptItem * >::const_iterator itItem =
1260  o.mpOptItems->begin();
1261  std::vector< COptItem * >::const_iterator endItem =
1262  o.mpOptItems->end();
1263 
1264  for (; itItem != endItem; ++itItem)
1265  os << " " << *static_cast<CFitItem *>(*itItem) << std::endl;
1266 
1267  itItem = o.mpConstraintItems->begin();
1268  endItem = o.mpConstraintItems->end();
1269 
1270  for (; itItem != endItem; ++itItem)
1271  os << " " << *static_cast<CFitItem *>(*itItem) << std::endl;
1272 
1273  return os;
1274 }
std::vector< COptItem * > * mpConstraintItems
Definition: COptProblem.h:436
CTrajectoryTask * mpTrajectory
Definition: CFitProblem.h:318
const CDescription & getDescription() const
std::vector< COptItem * > * mpOptItems
Definition: COptProblem.h:431
CSteadyStateTask * mpSteadyState
Definition: CFitProblem.h:312
virtual void print(std::ostream *ostream) const