COPASI API  4.16.103
COptMethodTruncatedNewton.h
Go to the documentation of this file.
1 // Begin CVS Header
2 // $Source: /Volumes/Home/Users/shoops/cvs/copasi_dev/copasi/optimization/COptMethodTruncatedNewton.h,v $
3 // $Revision: 1.2 $
4 // $Name: $
5 // $Author: shoops $
6 // $Date: 2008/03/11 23:32:54 $
7 // End CVS Header
8 
9 // Copyright (C) 2008 by Pedro Mendes, Virginia Tech Intellectual
10 // Properties, Inc., EML Research, gGmbH, University of Heidelberg,
11 // and The University 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  * COptMethodTruncatedNewton class
20  */
21 
22 #ifndef COPASI_COptMethodTruncatedNewton
23 #define COPASI_COptMethodTruncatedNewton
24 
25 #include <vector>
26 #include "utilities/CMatrix.h"
28 
29 #include "CTruncatedNewton.h"
30 
31 class FTruncatedNewton;
32 class CTruncatedNewton;
33 
35  {
37 
38  // Operations
39  public:
40  /**
41  * Copy Constructor
42  * @param const COptMethodTruncatedNewton & src
43  * @param const CCopasiContainer * pParent (default: NULL)
44  */
46  const CCopasiContainer * pParent = NULL);
47 
48  /**
49  * Destructor
50  */
52 
53  /**
54  * Execute the optimization algorithm calling simulation routine
55  * when needed. It is noted that this procedure can give feedback
56  * of its progress by the callback function set with SetCallback.
57  * @ return success;
58  */
59  virtual bool optimise();
60 
61  private:
62  /**
63  * Default Constructor
64  * @param const CCopasiContainer * pParent (default: NULL)
65  */
66  COptMethodTruncatedNewton(const CCopasiContainer * pParent = NULL);
67 
68  /**
69  * Initialize contained objects.
70  */
71  void initObjects();
72 
73  /**
74  * Initialize arrays and pointer.
75  * @return bool success
76  */
77  virtual bool initialize();
78 
79  /**
80  * Cleanup arrays and pointers.
81  * @return bool success
82  */
83  virtual bool cleanup();
84 
85  /**
86  * The tolerance
87  */
88  // C_FLOAT64 mTolerance;
89 
90  /**
91  * The number of iterations
92  */
93  unsigned C_INT32 mIteration;
94 
95  /**
96  * Handle to the process report item "Current Iteration"
97  */
98  unsigned C_INT32 mhIteration;
99 
100  /**
101  * number of parameters
102  */
104 
105  /**
106  * The current solution guess
107  */
109 
110  /**
111  * The gradient
112  */
114 
115  /**
116  * The last individual
117  */
119 
120  /**
121  * The best value found so far
122  */
124 
125  /**
126  * The result of a function evaluation
127  */
129 
130  /**
131  * Flag indicating whether the computation shall continue
132  */
133  bool mContinue;
134 
135  /**
136  * Functor pointing to the Truncated Newton method.
137  */
139 
140  /**
141  * CTruncatedNewton function.
142  */
144 
145  /**
146  * callback function for evaluation of objective function and its gradient
147  */
149 
150  /**
151  * objective function evaluation for specified parameters
152  */
153  bool evaluateFunction(C_INT *n, C_FLOAT64 *x, C_FLOAT64 *f);
154 
155  /**
156  * Evaluate the objective function
157  * @return bool continue
158  */
159  const C_FLOAT64 & evaluate();
160  };
161 
162 #endif // COPASI_COptMethodTruncatedNewton
#define C_INT
Definition: copasi.h:115
bool evaluateFunction(C_INT *n, C_FLOAT64 *x, C_FLOAT64 *f)
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
C_INT sFun(C_INT *, C_FLOAT64 *, C_FLOAT64 *, C_FLOAT64 *)
COptMethodTruncatedNewton(const COptMethodTruncatedNewton &src, const CCopasiContainer *pParent=NULL)