COPASI API  4.16.103
COptMethodNelderMead.h
Go to the documentation of this file.
1 /* Begin CVS Header
2  $Source: /Volumes/Home/Users/shoops/cvs/copasi_dev/copasi/optimization/COptMethodNelderMead.h,v $
3  $Revision: 1.3 $
4  $Name: $
5  $Author: shoops $
6  $Date: 2011/03/07 19:31:27 $
7  End CVS Header */
8 
9 // Copyright (C) 2011 - 2010 by Pedro Mendes, Virginia Tech Intellectual
10 // Properties, Inc., University of Heidelberg, and The University
11 // of Manchester.
12 // All rights reserved.
13 
14 // Copyright (C) 2001 - 2007 by Pedro Mendes, Virginia Tech Intellectual
15 // Properties, Inc. and EML Research, gGmbH.
16 // All rights reserved.
17 
18 /**
19  * COptMethodNelderMead class
20  */
21 
22 #ifndef COPASI_COptMethodNelderMead
23 #define COPASI_COptMethodNelderMead
24 
25 #include <vector>
26 #include "utilities/CMatrix.h"
28 
29 class CRandom;
30 
32 {
34 
35  // Operations
36 public:
37  /**
38  * Copy Constructor
39  * @param const COptMethodNelderMead & src
40  * @param const CCopasiContainer * pParent (default: NULL)
41  */
43  const CCopasiContainer * pParent = NULL);
44 
45  /**
46  * Destructor
47  */
48  virtual ~COptMethodNelderMead();
49 
50  /**
51  * Execute the optimization algorithm calling simulation routine
52  * when needed. It is noted that this procedure can give feedback
53  * of its progress by the callback function set with SetCallback.
54  * @ return success;
55  */
56  virtual bool optimise();
57 
58 private:
59  /**
60  * Default Constructor
61  * @param const CCopasiContainer * pParent (default: NULL)
62  */
63  COptMethodNelderMead(const CCopasiContainer * pParent = NULL);
64 
65  /**
66  * Initialize contained objects.
67  */
68  void initObjects();
69 
70  /**
71  * Initialize arrays and pointer.
72  * @return bool success
73  */
74  virtual bool initialize();
75 
76  /**
77  * Cleanup arrays and pointers.
78  * @return bool success
79  */
80  virtual bool cleanup();
81 
82  /**
83  * Evaluate the objective function
84  * @return bool continue
85  */
86  const C_FLOAT64 & evaluate();
87 
88  // Attributes
89 private:
90 
91  /**
92  * The maximum number of iterations
93  */
95 
96  /**
97  * The tolerance
98  */
100 
101  /**
102  * The scale
103  */
105 
106  /**
107  * The number of iterations
108  */
109  unsigned C_INT32 mIteration;
110 
111  /**
112  * Handle to the process report item "Current Iteration"
113  */
114  size_t mhIteration;
115 
116  /**
117  * number of parameters
118  */
120 
121  /**
122  * The simplex
123  */
125 
126  /**
127  * Array of values of objective function for each corner of the simplex
128  */
130 
131  /**
132  * The centroid of the simplex
133  */
135 
136  /**
137  * The current solution guess
138  */
140 
141  /**
142  * The step taken
143  */
145 
146  /**
147  * The best value found so far
148  */
150 
151  /**
152  * The result of a function evaluation
153  */
155 
156  /**
157  * Flag indicating whether the computation shall continue
158  */
159  bool mContinue;
160 };
161 
162 #endif // COPASI_COptMethodNelderMead
CMatrix< C_FLOAT64 > mSimplex
unsigned C_INT32 mIteration
COptMethodNelderMead(const COptMethodNelderMead &src, const CCopasiContainer *pParent=NULL)
static COptMethod * createMethod(CCopasiMethod::SubType subType=CCopasiMethod::RandomSearch)
Definition: COptMethod.cpp:50
unsigned C_INT32 mIterationLimit
CVector< C_FLOAT64 > mStep
CVector< C_FLOAT64 > mValue
#define C_INT32
Definition: copasi.h:90
CVector< C_FLOAT64 > mCentroid
const C_FLOAT64 & evaluate()
#define C_FLOAT64
Definition: copasi.h:92
CVector< C_FLOAT64 > mCurrent