COPASI API  4.16.103
Public Member Functions | Protected Member Functions | Private Slots | Private Member Functions | Private Attributes | List of all members
CQFittingResult Class Reference

#include <CQFittingResult.h>

Inheritance diagram for CQFittingResult:
Inheritance graph
[legend]
Collaboration diagram for CQFittingResult:
Collaboration graph
[legend]

Public Member Functions

 CQFittingResult (QWidget *parent=0, const char *name=0)
 
virtual bool leave ()
 
virtual bool update (ListViews::ObjectType objectType, ListViews::Action action, const std::string &key)
 
 ~CQFittingResult ()
 
- Public Member Functions inherited from CopasiWidget
 CopasiWidget (QWidget *parent=0, const char *name=0, Qt::WFlags f=0)
 
bool enter (const std::string &key)
 
CCopasiDataModelgetDataModel ()
 
bool getIgnoreUpdates ()
 
virtual void setFramework (int framework)
 
void setIgnoreUpdates (bool v)
 

Protected Member Functions

virtual bool enterProtected ()
 

Private Slots

void slotSave (void)
 
void slotUpdateModel ()
 

Private Member Functions

void init ()
 

Private Attributes

const CFitProblemmpProblem
 
const CFitTaskmpTask
 

Additional Inherited Members

- Protected Slots inherited from CopasiWidget
virtual bool protectedNotify (ListViews::ObjectType objectType, ListViews::Action action, const std::string &key="")
 
- Protected Attributes inherited from CopasiWidget
int mFramework
 
bool mIgnoreUpdates
 
std::string mKey
 
CCopasiDataModelmpDataModel
 
ListViewsmpListView
 
CCopasiObjectmpObject
 

Detailed Description

Definition at line 30 of file CQFittingResult.h.

Constructor & Destructor Documentation

CQFittingResult::CQFittingResult ( QWidget *  parent = 0,
const char *  name = 0 
)

Definition at line 43 of file CQFittingResult.cpp.

References init().

44  : CopasiWidget(parent, name)
45 {
46  setupUi(this);
47 
48  init();
49 }
CopasiWidget(QWidget *parent=0, const char *name=0, Qt::WFlags f=0)
CQFittingResult::~CQFittingResult ( )

Definition at line 54 of file CQFittingResult.cpp.

55 {
56  // no need to delete child widgets, Qt does it all for us
57 }

Member Function Documentation

bool CQFittingResult::enterProtected ( )
protectedvirtual

Reimplemented from CopasiWidget.

Definition at line 84 of file CQFittingResult.cpp.

References C_FLOAT64, FROM_UTF8, COptProblem::getCalculateStatistics(), CFitProblem::getCorrelations(), CFitProblem::getCrossValidationSet(), CCopasiRootContainer::getDatamodelList(), CCopasiDataModel::getDataObject(), CExperimentSet::getDependentErrorMean(), CExperimentSet::getDependentErrorMeanSD(), CExperimentSet::getDependentObjectiveValues(), CExperimentSet::getDependentObjects(), CExperimentSet::getDependentRMS(), CExperiment::getErrorMean(), CExperiment::getErrorMeanSD(), CFitProblem::getExperiementSet(), CExperimentSet::getExperiment(), CExperimentSet::getExperimentCount(), CFitProblem::getFisherInformation(), CFitProblem::getFisherInformationEigenvalues(), CFitProblem::getFisherInformationEigenvectors(), COptProblem::getFunctionEvaluations(), COptItem::getLastStartValue(), COptItem::getLowerBound(), COptItem::getLowerBoundValue(), CCopasiObject::getObjectDisplayName(), CExperiment::getObjectiveValue(), CCopasiObject::getObjectName(), COptProblem::getOptItemList(), CCopasiTask::getProblem(), CExperiment::getRMS(), CFitProblem::getScaledFisherInformation(), CFitProblem::getScaledFisherInformationEigenvalues(), CFitProblem::getScaledFisherInformationEigenvectors(), COptProblem::getSolutionVariables(), CCopasiDataModel::getTaskList(), COptItem::getUpperBound(), COptItem::getUpperBoundValue(), COptProblem::getVariableGradients(), CFitProblem::getVariableStdDeviations(), mpProblem, mpTask, and CVectorCore< CType >::size().

85 {
86  assert(CCopasiRootContainer::getDatamodelList()->size() > 0);
88  assert(pDataModel != NULL);
89 
90  mpTask =
91  dynamic_cast<CFitTask *>((*pDataModel->getTaskList())["Parameter Estimation"]);
92 
93  if (!mpTask) return false;
94 
95  mpProblem = dynamic_cast<const CFitProblem *>(mpTask->getProblem());
96 
97  if (!mpProblem) return false;
98 
99  mpMain->load(mpProblem);
100 
102  {
103  mpTabWidget->setTabEnabled(mpTabWidget->indexOf(mpExperiments), true);
104  mpTabWidget->setTabEnabled(mpTabWidget->indexOf(mpValues), true);
105  mpTabWidget->setTabEnabled(mpTabWidget->indexOf(mpCorrelations), true);
106  mpTabWidget->setTabEnabled(mpTabWidget->indexOf(mpFisherInformationPage), true);
107 
108  mpTabWidget->setTabEnabled(mpTabWidget->indexOf(mpCrossValidations), true);
109  mpTabWidget->setTabEnabled(mpTabWidget->indexOf(mpCrossValidationValues), true);
110  }
111  else
112  {
113  mpTabWidget->setTabEnabled(mpTabWidget->indexOf(mpExperiments), false);
114  mpTabWidget->setTabEnabled(mpTabWidget->indexOf(mpValues), false);
115  mpTabWidget->setTabEnabled(mpTabWidget->indexOf(mpCorrelations), false);
116  mpTabWidget->setTabEnabled(mpTabWidget->indexOf(mpFisherInformationPage), false);
117 
118  mpTabWidget->setTabEnabled(mpTabWidget->indexOf(mpCrossValidations), false);
119  mpTabWidget->setTabEnabled(mpTabWidget->indexOf(mpCrossValidationValues), false);
120  }
121 
122  size_t i, imax;
123  QTableWidgetItem * pItem;
124 
125  // Loop over the optimization items
126  const std::vector< COptItem * > & Items = mpProblem->getOptItemList();
127  const CVector< C_FLOAT64 > & Solutions = mpProblem->getSolutionVariables();
128  const CVector< C_FLOAT64 > & StdDeviations = mpProblem->getVariableStdDeviations();
129  const CVector< C_FLOAT64 > & Gradients = mpProblem->getVariableGradients();
130 
131  imax = Items.size();
132 
133  if (mpProblem->getFunctionEvaluations() == 0)
134  imax = 0;
135 
136  //the parameters table
137  mpParameters->setRowCount((int) imax);
138 
139  QColor BackgroundColor = mpParameters->palette().brush(QPalette::Active, QPalette::Base).color();
140 
141  int h, s, v;
142  BackgroundColor.getHsv(&h, &s, &v);
143 
144  if (s < 20)
145  {
146  s = 20;
147  }
148 
149  BackgroundColor.setHsv(0, s, v);
150 
151  for (i = 0; i != imax; i++)
152  {
153  //1st column: parameter name
154  const CCopasiObject *pObject =
155  pDataModel->getDataObject(Items[i]->getObjectCN());
156 
157  if (pObject)
158  {
159  std::string Experiments =
160  static_cast<CFitItem *>(Items[i])->getExperiments();
161 
162  if (Experiments != "")
163  Experiments = "; {" + Experiments + "}";
164 
165  pItem = new QTableWidgetItem(FROM_UTF8(pObject->getObjectDisplayName() + Experiments));
166  }
167  else
168  pItem = new QTableWidgetItem("Not Found");
169 
170  mpParameters->setItem((int) i, 0, pItem);
171 
172  const C_FLOAT64 & Solution = i < Solutions.size() ? Solutions[i] : std::numeric_limits<double>::quiet_NaN();
173 
174  //2nd column: lower bound
175  const COptItem *current = Items[i];
176  pItem = new QTableWidgetItem(FROM_UTF8(current->getLowerBound()));
177  mpParameters->setItem((int) i, 1, pItem);
178 
179  if (current->getLowerBoundValue() != NULL && 1.01 * *current->getLowerBoundValue() > Solution)
180  {
181  pItem->setBackgroundColor(BackgroundColor);
182  }
183 
184  //3rd column: start value
185  pItem = new QTableWidgetItem(QString::number(current->getLastStartValue()));
186  pItem->setForeground(QColor(120, 120, 140));
187  mpParameters->setItem((int) i, 2, pItem);
188 
189  //4th column: solution value
190  pItem = new QTableWidgetItem(QString::number(Solution));
191  mpParameters->setItem((int) i, 3, pItem);
192 
193  //5th column: upper bound
194  pItem = new QTableWidgetItem(FROM_UTF8(current->getUpperBound()));
195  mpParameters->setItem((int) i, 4, pItem);
196 
197  if (current->getUpperBoundValue() != NULL && 0.99 * *current->getUpperBoundValue() < Solution)
198  {
199  pItem->setBackgroundColor(BackgroundColor);
200  }
201 
202  const C_FLOAT64 & StdDeviation = i < StdDeviations.size() ? StdDeviations[i] : std::numeric_limits<double>::quiet_NaN();
203 
204  pItem = new QTableWidgetItem(QString::number(StdDeviation));
205 
206  mpParameters->setItem((int) i, 5, pItem);
207 
208  pItem = new QTableWidgetItem(QString::number(fabs(100.0 * StdDeviation / Solution)));
209 
210  mpParameters->setItem((int) i, 6, pItem);
211 
212  pItem = new QTableWidgetItem(QString::number(i < Gradients.size() ? Gradients[i] : std::numeric_limits<double>::quiet_NaN()));
213 
214  mpParameters->setItem((int) i, 7, pItem);
215  }
216 
217  mpParameters->resizeColumnsToContents();
218  mpParameters->resizeRowsToContents();
219 
220  // Loop over the experiments
221  const CExperimentSet & Experiments = mpProblem->getExperiementSet();
222 
223  imax = Experiments.getExperimentCount();
224 
225  if (mpProblem->getFunctionEvaluations() == 0)
226  imax = 0;
227 
228  mpExperiments->setRowCount((int) imax);
229 
230  for (i = 0; i != imax; i++)
231  {
232  const CExperiment & Experiment = * Experiments.getExperiment(i);
233  pItem = new QTableWidgetItem(FROM_UTF8(Experiment.getObjectName()));
234  mpExperiments->setItem((int) i, 0, pItem);
235  pItem = new QTableWidgetItem(QString::number(Experiment.getObjectiveValue()));
236  mpExperiments->setItem((int) i, 1, pItem);
237  pItem = new QTableWidgetItem(QString::number(Experiment.getRMS()));
238  mpExperiments->setItem((int) i, 2, pItem);
239  pItem = new QTableWidgetItem(QString::number(Experiment.getErrorMean()));
240  mpExperiments->setItem((int) i, 3, pItem);
241  pItem = new QTableWidgetItem(QString::number(Experiment.getErrorMeanSD()));
242  mpExperiments->setItem((int) i, 4, pItem);
243  }
244 
245  mpExperiments->resizeColumnsToContents();
246  mpExperiments->resizeRowsToContents();
247 
248  // Loop over the dependent objects
249  imax = Experiments.getDependentObjects().size();
250 
251  if (mpProblem->getFunctionEvaluations() == 0)
252  imax = 0;
253 
254  mpValues->setRowCount((int) imax);
255 
256  for (i = 0; i != imax; i++)
257  {
258  const CCopasiObject * pObject = Experiments.getDependentObjects()[i];
259 
260  if (pObject)
261  pItem = new QTableWidgetItem(FROM_UTF8(pObject->getObjectDisplayName()));
262  else
263  pItem = new QTableWidgetItem("Not Found");
264 
265  mpValues->setItem((int) i, 0, pItem);
266 
267  pItem = new QTableWidgetItem(QString::number(Experiments.getDependentObjectiveValues()[i]));
268  mpValues->setItem((int) i, 1, pItem);
269  pItem = new QTableWidgetItem(QString::number(Experiments.getDependentRMS()[i]));
270  mpValues->setItem((int) i, 2, pItem);
271  pItem = new QTableWidgetItem(QString::number(Experiments.getDependentErrorMean()[i]));
272  mpValues->setItem((int) i, 3, pItem);
273  pItem = new QTableWidgetItem(QString::number(Experiments.getDependentErrorMeanSD()[i]));
274  mpValues->setItem((int) i, 4, pItem);
275  }
276 
277  mpValues->resizeColumnsToContents();
278  mpValues->resizeRowsToContents();
279 
280  // Fill correlation matrix
281  imax = Items.size();
282 
283  if (mpProblem->getFunctionEvaluations() == 0)
284  imax = 0;
285 
286  CColorScaleBiLog * tcs = new CColorScaleBiLog();
287  mpCorrelations->setColorCoding(tcs);
288  mpCorrelations->setColorScalingAutomatic(true);
289  mpCorrelations->setArrayAnnotation(&mpProblem->getCorrelations());
290 
291  tcs = new CColorScaleBiLog();
292  mpFisherInformationMatrix->setColorCoding(tcs);
293  mpFisherInformationMatrix->setColorScalingAutomatic(true);
294  mpFisherInformationMatrix->setArrayAnnotation(&mpProblem->getFisherInformation());
295 
296  tcs = new CColorScaleBiLog();
297  mpFisherInformationEigenvalues->setColorCoding(tcs);
298  mpFisherInformationEigenvalues->setColorScalingAutomatic(true);
299  mpFisherInformationEigenvalues->setArrayAnnotation(&mpProblem->getFisherInformationEigenvalues());
300  mpFisherInformationEigenvalues->mpComboRows->setCurrentIndex(1);
301 
302  tcs = new CColorScaleBiLog();
303  mpFisherInformationEigenvectors->setColorCoding(tcs);
304  mpFisherInformationEigenvectors->setColorScalingAutomatic(true);
305  mpFisherInformationEigenvectors->setArrayAnnotation(&mpProblem->getFisherInformationEigenvectors());
306  mpFisherInformationEigenvectors->mpComboRows->setCurrentIndex(1);
307 
308  tcs = new CColorScaleBiLog();
309  mpFisherInformationScaledMatrix->setColorCoding(tcs);
310  mpFisherInformationScaledMatrix->setColorScalingAutomatic(true);
311  mpFisherInformationScaledMatrix->setArrayAnnotation(&mpProblem->getScaledFisherInformation());
312 
313  tcs = new CColorScaleBiLog();
314  mpFisherInformationScaledEigenvalues->setColorCoding(tcs);
315  mpFisherInformationScaledEigenvalues->setColorScalingAutomatic(true);
316  mpFisherInformationScaledEigenvalues->setArrayAnnotation(&mpProblem->getScaledFisherInformationEigenvalues());
317  mpFisherInformationScaledEigenvalues->mpComboRows->setCurrentIndex(1);
318 
319  tcs = new CColorScaleBiLog();
320  mpFisherInformationScaledEigenvectors->setColorCoding(tcs);
321  mpFisherInformationScaledEigenvectors->setColorScalingAutomatic(true);
322  mpFisherInformationScaledEigenvectors->setArrayAnnotation(&mpProblem->getScaledFisherInformationEigenvectors());
323  mpFisherInformationScaledEigenvectors->mpComboRows->setCurrentIndex(1);
324 
325  bool Enable = (mpProblem->getCrossValidationSet().getExperimentCount() > 0);
326 
327  mpTabWidget->setTabEnabled(mpTabWidget->indexOf(mpCrossValidations), Enable);
328  mpTabWidget->setTabEnabled(mpTabWidget->indexOf(mpCrossValidationValues), Enable);
329 
330  // Loop over the cross validation
331  const CCrossValidationSet & CrossValidations = mpProblem->getCrossValidationSet();
332 
333  imax = CrossValidations.getExperimentCount();
334 
335  if (mpProblem->getFunctionEvaluations() == 0)
336  imax = 0;
337 
338  mpCrossValidations->setRowCount(imax);
339 
340  for (i = 0; i != imax; i++)
341  {
342  const CExperiment & Experiment = * CrossValidations.getExperiment(i);
343  pItem = new QTableWidgetItem(FROM_UTF8(Experiment.getObjectName()));
344  mpCrossValidations->setItem(i, 0, pItem);
345  pItem = new QTableWidgetItem(QString::number(Experiment.getObjectiveValue()));
346  mpCrossValidations->setItem(i, 1, pItem);
347  pItem = new QTableWidgetItem(QString::number(Experiment.getRMS()));
348  mpCrossValidations->setItem(i, 2, pItem);
349  pItem = new QTableWidgetItem(QString::number(Experiment.getErrorMean()));
350  mpCrossValidations->setItem(i, 3, pItem);
351  pItem = new QTableWidgetItem(QString::number(Experiment.getErrorMeanSD()));
352  mpCrossValidations->setItem(i, 4, pItem);
353  }
354 
355  mpCrossValidations->resizeColumnsToContents();
356  mpCrossValidations->resizeRowsToContents();
357 
358  // Loop over the dependent objects
359  imax = CrossValidations.getDependentObjects().size();
360 
361  if (mpProblem->getFunctionEvaluations() == 0)
362  imax = 0;
363 
364  mpCrossValidationValues->setRowCount(imax);
365 
366  for (i = 0; i != imax; i++)
367  {
368  const CCopasiObject * pObject = CrossValidations.getDependentObjects()[i];
369 
370  if (pObject)
371  pItem = new QTableWidgetItem(FROM_UTF8(pObject->getObjectDisplayName()));
372  else
373  pItem = new QTableWidgetItem("Not Found");
374 
375  mpCrossValidationValues->setItem(i, 0, pItem);
376  pItem = new QTableWidgetItem(QString::number(CrossValidations.getDependentObjectiveValues()[i]));
377  mpCrossValidationValues->setItem(i, 1, pItem);
378  pItem = new QTableWidgetItem(QString::number(CrossValidations.getDependentRMS()[i]));
379  mpCrossValidationValues->setItem(i, 2, pItem);
380  pItem = new QTableWidgetItem(QString::number(CrossValidations.getDependentErrorMean()[i]));
381  mpCrossValidationValues->setItem(i, 3, pItem);
382  pItem = new QTableWidgetItem(QString::number(CrossValidations.getDependentErrorMeanSD()[i]));
383  mpCrossValidationValues->setItem(i, 4, pItem);
384  }
385 
386  mpCrossValidationValues->resizeColumnsToContents();
387  mpCrossValidationValues->resizeRowsToContents();
388 
389  return true;
390 }
CCopasiObject * getDataObject(const CCopasiObjectName &CN) const
virtual std::string getObjectDisplayName(bool regular=true, bool richtext=false) const
#define FROM_UTF8(__x)
Definition: qtUtilities.h:73
CCopasiProblem * getProblem()
const CVector< CCopasiObject * > & getDependentObjects() const
const C_FLOAT64 & getObjectiveValue() const
const std::string & getObjectName() const
const std::string getUpperBound() const
Definition: COptItem.cpp:189
CArrayAnnotation & getScaledFisherInformationEigenvectors() const
const CVector< C_FLOAT64 > & getVariableStdDeviations() const
const CVector< C_FLOAT64 > & getVariableGradients() const
const C_FLOAT64 & getLastStartValue() const
Definition: COptItem.cpp:220
const CExperimentSet & getExperiementSet() const
CExperiment * getExperiment(const size_t &index)
const CVector< C_FLOAT64 > & getDependentRMS() const
CArrayAnnotation & getCorrelations() const
CArrayAnnotation & getFisherInformation() const
const C_FLOAT64 & getRMS() const
const CVector< C_FLOAT64 > & getDependentObjectiveValues() const
const C_FLOAT64 & getErrorMean() const
CArrayAnnotation & getScaledFisherInformation() const
const std::vector< COptItem * > & getOptItemList() const
CArrayAnnotation & getFisherInformationEigenvalues() const
const C_FLOAT64 & getErrorMeanSD() const
const CVector< C_FLOAT64 > & getDependentErrorMean() const
CArrayAnnotation & getFisherInformationEigenvectors() const
const CCrossValidationSet & getCrossValidationSet() const
CCopasiVectorN< CCopasiTask > * getTaskList()
const C_FLOAT64 * getLowerBoundValue() const
Definition: COptItem.h:191
static CCopasiVector< CCopasiDataModel > * getDatamodelList()
const CVector< C_FLOAT64 > & getSolutionVariables() const
CArrayAnnotation & getScaledFisherInformationEigenvalues() const
size_t size() const
Definition: CVector.h:100
const CVector< C_FLOAT64 > & getDependentErrorMeanSD() const
const std::string getLowerBound() const
Definition: COptItem.cpp:164
#define C_FLOAT64
Definition: copasi.h:92
const C_FLOAT64 * getUpperBoundValue() const
Definition: COptItem.h:198
const CFitTask * mpTask
const bool & getCalculateStatistics() const
const unsigned C_INT32 & getFunctionEvaluations() const
const CFitProblem * mpProblem
size_t getExperimentCount() const
void CQFittingResult::init ( )
private

Definition at line 59 of file CQFittingResult.cpp.

Referenced by CQFittingResult().

60 {
61  mpCorrelations->setLegendEnabled(false);
62  mpFisherInformationMatrix->setLegendEnabled(false);
63  mpFisherInformationEigenvalues->setLegendEnabled(false);
64  mpFisherInformationEigenvectors->setLegendEnabled(false);
65  mpFisherInformationScaledMatrix->setLegendEnabled(false);
66  mpFisherInformationScaledEigenvalues->setLegendEnabled(false);
67  mpFisherInformationScaledEigenvectors->setLegendEnabled(false);
68 }
bool CQFittingResult::leave ( )
virtual

Reimplemented from CopasiWidget.

Definition at line 78 of file CQFittingResult.cpp.

79 {
80  // :TODO:
81  return true;
82 }
void CQFittingResult::slotSave ( void  )
privateslot

Definition at line 392 of file CQFittingResult.cpp.

References C_FLOAT64, C_INT32, checkSelection(), CLocaleString::fromUtf8(), CFitProblem::getCorrelations(), COptProblem::getExecutionTime(), CFitProblem::getFisherInformation(), CFitProblem::getFisherInformationEigenvalues(), CFitProblem::getFisherInformationEigenvectors(), COptProblem::getFunctionEvaluations(), CFitProblem::getRMS(), CopasiFileDialog::getSaveFileName(), CFitProblem::getScaledFisherInformation(), CFitProblem::getScaledFisherInformationEigenvalues(), CFitProblem::getScaledFisherInformationEigenvectors(), COptProblem::getSolutionValue(), CFitProblem::getStdDeviation(), mpProblem, and TO_UTF8.

393 {
394  C_INT32 Answer = QMessageBox::No;
395  QString fileName;
396 
397  while (Answer == QMessageBox::No)
398  {
399  fileName =
401  "Save File Dialog",
402  "untitled.txt",
403  "TEXT Files (*.txt)",
404  "Save to");
405 
406  if (fileName.isEmpty()) return;
407 
408  if (!fileName.endsWith(".txt") &&
409  !fileName.endsWith(".")) fileName += ".txt";
410 
411  fileName = fileName.remove(QRegExp("\\.$"));
412 
413  Answer = checkSelection(fileName);
414 
415  if (Answer == QMessageBox::Cancel) return;
416  }
417 
418  std::ofstream file(CLocaleString::fromUtf8(TO_UTF8(fileName)).c_str());
419 
420  if (file.fail()) return;
421 
422  int i, imax;
423 
424  // The global result and statistics
425  file << "Objective Value\tRoot Mean Square\tStandard Deviation" << std::endl;
426  file << mpProblem->getSolutionValue() << "\t";
427  file << mpProblem->getRMS() << "\t";
428  file << mpProblem->getStdDeviation() << std::endl;
429 
430  file << "Function Evaluations\tCPU Time [s]\tEvaluations/second [1/s]" << std::endl;
431  const unsigned C_INT32 & FunctionEvaluations = mpProblem->getFunctionEvaluations();
432  const C_FLOAT64 & ExecutionTime = mpProblem->getExecutionTime();
433  file << FunctionEvaluations << "\t";
434  file << ExecutionTime << "\t";
435  file << FunctionEvaluations / ExecutionTime << std::endl << std::endl;
436 
437  if (mpParameters->isEnabled())
438  {
439  // Set up the parameters table
440  file << "Parameters:" << std::endl;
441  file << "Parameter\tLower Bound\tStart Value\tValue\tUpper Bound\tStd. Deviation\tCoeff. of Variation [%]\tGradient" << std::endl;
442 
443  // Loop over the optimization items
444  imax = mpParameters->rowCount();
445 
446  for (i = 0; i != imax; i++)
447  {
448  file << TO_UTF8(mpParameters->item((int) i, 0)->text()) << "\t";
449  file << TO_UTF8(mpParameters->item((int) i, 1)->text()) << "\t";
450  file << TO_UTF8(mpParameters->item((int) i, 2)->text()) << "\t";
451  file << TO_UTF8(mpParameters->item((int) i, 3)->text()) << "\t";
452  file << TO_UTF8(mpParameters->item((int) i, 4)->text()) << "\t";
453  file << TO_UTF8(mpParameters->item((int) i, 5)->text()) << "\t";
454  file << TO_UTF8(mpParameters->item((int) i, 6)->text()) << "\t";
455  file << TO_UTF8(mpParameters->item((int) i, 7)->text()) << std::endl;
456  }
457 
458  file << std::endl;
459  }
460 
461  if (mpExperiments->isEnabled())
462  {
463  // Set up the experiments table
464  file << "Experiments:" << std::endl;
465  file << "Experiment\tObjective Value\tRoot Mean Square\tError Mean\tError Mean Std. Deviation" << std::endl;
466 
467  // Loop over the experiments
468  imax = mpExperiments->rowCount();
469 
470  for (i = 0; i != imax; i++)
471  {
472  file << TO_UTF8(mpExperiments->item((int) i, 0)->text()) << "\t";
473  file << TO_UTF8(mpExperiments->item((int) i, 1)->text()) << "\t";
474  file << TO_UTF8(mpExperiments->item((int) i, 2)->text()) << "\t";
475  file << TO_UTF8(mpExperiments->item((int) i, 3)->text()) << "\t";
476  file << TO_UTF8(mpExperiments->item((int) i, 4)->text()) << std::endl;
477  }
478 
479  file << std::endl;
480  }
481 
482  if (mpValues->isEnabled())
483  {
484  // Set up the fitted values table
485  file << "Fitted Values:" << std::endl;
486  file << "Fitted Value\tObjective Value\tRoot Mean Square\tError Mean\tError Mean Std. Deviation" << std::endl;
487 
488  // Loop over the fitted values objects
489  imax = mpValues->rowCount();
490 
491  for (i = 0; i != imax; i++)
492  {
493  file << TO_UTF8(mpValues->item((int) i, 0)->text()) << "\t";
494  file << TO_UTF8(mpValues->item((int) i, 1)->text()) << "\t";
495  file << TO_UTF8(mpValues->item((int) i, 2)->text()) << "\t";
496  file << TO_UTF8(mpValues->item((int) i, 3)->text()) << "\t";
497  file << TO_UTF8(mpValues->item((int) i, 4)->text()) << std::endl;
498  }
499 
500  file << std::endl;
501  }
502 
503  // Save the parameter correlations
504  file << mpProblem->getCorrelations() << std::endl;
505 
506  // Save the Fisher information
507  file << mpProblem->getFisherInformation() << std::endl;
508 
509  // Save the Fisher information Eigenvalues
510  file << mpProblem->getFisherInformationEigenvalues() << std::endl;
511 
512  // Save the Fisher information Eigenvectors
513  file << mpProblem->getFisherInformationEigenvectors() << std::endl;
514 
515  // Save the scaled Fisher information
516  file << mpProblem->getScaledFisherInformation() << std::endl;
517 
518  // Save the scaled Fisher information Eigenvalues
519  file << mpProblem->getScaledFisherInformationEigenvalues() << std::endl;
520 
521  // Save the scaled Fisher information Eigenvectors
522  file << mpProblem->getScaledFisherInformationEigenvectors() << std::endl << std::endl;
523 
524  if (mpValues->isEnabled())
525  {
526  // Set up the cross validations table
527  file << "Validations:" << std::endl;
528  file << "Validation Experiment\t Objective Value\tRoot Mean Square\tError Mean\tError Mean Std. Deviation" << std::endl;
529 
530  // Loop over the experiments
531  imax = mpCrossValidations->rowCount();
532 
533  for (i = 0; i != imax; i++)
534  {
535  file << TO_UTF8(mpCrossValidations->item((int) i, 0)->text()) << "\t";
536  file << TO_UTF8(mpCrossValidations->item((int) i, 1)->text()) << "\t";
537  file << TO_UTF8(mpCrossValidations->item((int) i, 2)->text()) << "\t";
538  file << TO_UTF8(mpCrossValidations->item((int) i, 3)->text()) << "\t";
539  file << TO_UTF8(mpCrossValidations->item((int) i, 4)->text()) << std::endl;
540  }
541 
542  file << std::endl;
543  }
544 
545  if (mpValues->isEnabled())
546  {
547  // Set up the fitted values table
548  file << "Validation Fitted Values:" << std::endl;
549  file << "Validation Fitted Value\tObjective Value\tRoot Mean Square\tError Mean\tError Mean Std. Deviation" << std::endl;
550 
551  // Loop over the fitted values objects
552  imax = mpCrossValidationValues->rowCount();
553 
554  for (i = 0; i != imax; i++)
555  {
556  file << TO_UTF8(mpCrossValidationValues->item((int) i, 0)->text()) << "\t";
557  file << TO_UTF8(mpCrossValidationValues->item((int) i, 1)->text()) << "\t";
558  file << TO_UTF8(mpCrossValidationValues->item((int) i, 2)->text()) << "\t";
559  file << TO_UTF8(mpCrossValidationValues->item((int) i, 3)->text()) << "\t";
560  file << TO_UTF8(mpCrossValidationValues->item((int) i, 4)->text()) << std::endl;
561  }
562 
563  file << std::endl;
564  }
565 }
CArrayAnnotation & getScaledFisherInformationEigenvectors() const
#define C_INT32
Definition: copasi.h:90
CArrayAnnotation & getCorrelations() const
CArrayAnnotation & getFisherInformation() const
const C_FLOAT64 & getSolutionValue() const
const C_FLOAT64 & getExecutionTime() const
CArrayAnnotation & getScaledFisherInformation() const
CArrayAnnotation & getFisherInformationEigenvalues() const
C_INT32 checkSelection(const QString &file)
CArrayAnnotation & getFisherInformationEigenvectors() const
CArrayAnnotation & getScaledFisherInformationEigenvalues() const
const C_FLOAT64 & getStdDeviation() const
#define C_FLOAT64
Definition: copasi.h:92
#define TO_UTF8(__x)
Definition: qtUtilities.h:74
static CLocaleString fromUtf8(const std::string &utf8)
const unsigned C_INT32 & getFunctionEvaluations() const
const C_FLOAT64 & getRMS() const
const CFitProblem * mpProblem
static QString getSaveFileName(QWidget *parent=0, const char *name=0, const QString &startWith=QString::null, const QString &filter=QString::null, const QString &caption=QString::null, QString *pSelectedFilter=NULL, QFileDialog::Options options=0)
void CQFittingResult::slotUpdateModel ( )
privateslot

Definition at line 567 of file CQFittingResult.cpp.

References mpProblem.

568 {
569  const_cast< CFitProblem * >(mpProblem)->restoreModel(true);
570 }
const CFitProblem * mpProblem
bool CQFittingResult::update ( ListViews::ObjectType  objectType,
ListViews::Action  action,
const std::string &  key 
)
virtual

Reimplemented from CopasiWidget.

Definition at line 70 of file CQFittingResult.cpp.

73 {
74  // :TODO:
75  return true;
76 }

Member Data Documentation

const CFitProblem* CQFittingResult::mpProblem
private

Definition at line 48 of file CQFittingResult.h.

Referenced by enterProtected(), slotSave(), and slotUpdateModel().

const CFitTask* CQFittingResult::mpTask
private

Definition at line 47 of file CQFittingResult.h.

Referenced by enterProtected().


The documentation for this class was generated from the following files: