COPASI API  4.16.103
CQFittingResultTab1.cpp
Go to the documentation of this file.
1 // Copyright (C) 2010 - 2013 by Pedro Mendes, Virginia Tech Intellectual
2 // Properties, Inc., University of Heidelberg, and The University
3 // of Manchester.
4 // All rights reserved.
5 
6 // Copyright (C) 2008 - 2009 by Pedro Mendes, Virginia Tech Intellectual
7 // Properties, Inc., EML Research, gGmbH, University of Heidelberg,
8 // and The University of Manchester.
9 // All rights reserved.
10 
11 // Copyright (C) 2006 - 2007 by Pedro Mendes, Virginia Tech Intellectual
12 // Properties, Inc. and EML Research, gGmbH.
13 // All rights reserved.
14 
15 #include "CQFittingResultTab1.h"
16 #include "copasi.h"
17 
22 
23 #include "UI/qtUtilities.h"
24 
25 /*
26  * Constructs a CQFittingResultTab1 which is a child of 'parent', with the
27  * name 'name'.'
28  */
29 CQFittingResultTab1::CQFittingResultTab1(QWidget* parent, const char* name, Qt::WindowFlags fl)
30  : QWidget(parent, fl)
31 {
32  setObjectName(QString::fromUtf8(name));
33  setupUi(this);
34 
35  init();
36 }
37 
38 /*
39  * Destroys the object and frees any allocated resources
40  */
42 {
43  // no need to delete child widgets, Qt does it all for us
44 }
45 
46 void CQFittingResultTab1::load(const CFitProblem * pProblem)
47 {
48  mpEditObjectiveValue->setText(QString::number(pProblem->getSolutionValue()));
49  mpEditRMS->setText(QString::number(pProblem->getRMS()));
50  mpEditStdDeviation->setText(QString::number(pProblem->getStdDeviation()));
51 
52  bool Enable = (pProblem->getCrossValidationSet().getExperimentCount() > 0);
53 
54  mpLblCVObjectiveValue->setEnabled(Enable);
55  mpEditCVObjectiveValue->setEnabled(Enable);
56  mpLblCVRMS->setEnabled(Enable);
57  mpEditCVRMS->setEnabled(Enable);
58  mpLblCVStdDeviation->setEnabled(Enable);
59  mpEditCVStdDeviation->setEnabled(Enable);
60 
61  if (Enable)
62  {
63  mpEditCVObjectiveValue->setText(QString::number(pProblem->getCrossValidationSolutionValue()));
64  mpEditCVRMS->setText(QString::number(pProblem->getCrossValidationRMS()));
65  mpEditCVStdDeviation->setText(QString::number(pProblem->getCrossValidationSD()));
66  }
67  else
68  {
69  mpEditCVObjectiveValue->setText("");
70  mpEditCVRMS->setText("");
71  mpEditCVStdDeviation->setText("");
72  }
73 
74  const unsigned C_INT32 & FunctionEvaluations = pProblem->getFunctionEvaluations();
75 
76  mpEditEvaluations->setText(QString::number(FunctionEvaluations));
77 
78  const C_FLOAT64 & ExecutionTime = pProblem->getExecutionTime();
79 
80  mpEditCPUTime->setText(QString::number(ExecutionTime));
81 
82  mpEditSpeed->setText(QString::number(FunctionEvaluations / ExecutionTime));
83 }
84 
86 {}
void load(const CFitProblem *pProblem)
const C_FLOAT64 & getCrossValidationSolutionValue() const
#define C_INT32
Definition: copasi.h:90
const C_FLOAT64 & getCrossValidationRMS() const
const C_FLOAT64 & getSolutionValue() const
CQFittingResultTab1(QWidget *parent=0, const char *name=0, Qt::WindowFlags fl=0)
const C_FLOAT64 & getExecutionTime() const
const CCrossValidationSet & getCrossValidationSet() const
const C_FLOAT64 & getStdDeviation() const
#define C_FLOAT64
Definition: copasi.h:92
bool fl(const C_FLOAT64 &d1, const C_FLOAT64 &d2)
const C_FLOAT64 & getCrossValidationSD() const
const unsigned C_INT32 & getFunctionEvaluations() const
const C_FLOAT64 & getRMS() const
size_t getExperimentCount() const