COPASI API  4.16.103
COptMethodLevenbergMarquardt.h
Go to the documentation of this file.
1 /* Begin CVS Header
2  $Source: /Volumes/Home/Users/shoops/cvs/copasi_dev/copasi/optimization/COptMethodLevenbergMarquardt.h,v $
3  $Revision: 1.7 $
4  $Name: $
5  $Author: mendes $
6  $Date: 2012/06/04 14:12:37 $
7  End CVS Header */
8 
9 // Copyright (C) 2012 - 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  * COptMethodLevenbergMarquardt class
20  */
21 
22 #ifndef COPASI_COptMethodLevenbergMarquardt
23 #define COPASI_COptMethodLevenbergMarquardt
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 COptMethodLevenbergMarquardt & src
40  * @param const CCopasiContainer * pParent (default: NULL)
41  */
43  const CCopasiContainer * pParent = NULL);
44 
45  /**
46  * Destructor
47  */
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  COptMethodLevenbergMarquardt(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  /**
89  * Calculate the gradient of the objective at the current parameters
90  */
91  void gradient();
92 
93  /**
94  * Calculate the Hessian of the objective at the current point
95  */
96  void hessian();
97 
98  // Attributes
99 private:
100 
101  /**
102  * The maximum number of iterations
103  */
105 
106  /**
107  * The tolerance
108  */
110 
111  /**
112  * The modulation factor
113  */
115 
116  /**
117  * The number of iterations
118  */
119  unsigned C_INT32 mIteration;
120 
121  /**
122  * Handle to the process report item "Current Iteration"
123  */
124  size_t mhIteration;
125 
126  /**
127  * number of parameters
128  */
130 
131  /**
132  * The current solution guess
133  */
135 
136  /**
137  * The last individual
138  */
140 
141  /**
142  * The gradient
143  */
145 
146  /**
147  * The step taken
148  */
150 
151  /**
152  * The Hessian matrix
153  */
155 
156  /**
157  * The Hessian matrix modified according to Levenberg-Marquardt
158  */
160 
161  /**
162  * Vector for temporary values
163  */
165 
166  /**
167  * The best value found so far
168  */
170 
171  /**
172  * The result of a function evaluation
173  */
175 
176  /**
177  * Flag indicating whether the computation shall continue
178  */
179  bool mContinue;
180 
181  /**
182  * Indicate whether we have access to the residuals, i.e., it is a
183  * fitting problem we are working on.
184  */
186 
187  /**
188  * The transpose jacobian of the residuals.
189  */
191 };
192 
193 #endif // COPASI_COptMethodLevenbergMarquardt
static COptMethod * createMethod(CCopasiMethod::SubType subType=CCopasiMethod::RandomSearch)
Definition: COptMethod.cpp:50
#define C_INT32
Definition: copasi.h:90
#define C_FLOAT64
Definition: copasi.h:92
COptMethodLevenbergMarquardt(const COptMethodLevenbergMarquardt &src, const CCopasiContainer *pParent=NULL)