COPASI API  4.16.103
COptMethodSteepestDescent.h
Go to the documentation of this file.
1 /* Begin CVS Header
2  $Source: /Volumes/Home/Users/shoops/cvs/copasi_dev/copasi/optimization/COptMethodSteepestDescent.h,v $
3  $Revision: 1.12 $
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) 2008 by Pedro Mendes, Virginia Tech Intellectual
15 // Properties, Inc., EML Research, gGmbH, University of Heidelberg,
16 // and The University of Manchester.
17 // All rights reserved.
18 
19 // Copyright (C) 2001 - 2007 by Pedro Mendes, Virginia Tech Intellectual
20 // Properties, Inc. and EML Research, gGmbH.
21 // All rights reserved.
22 
23 #ifndef COPASI_COptMethodSteepestDescent
24 #define COPASI_COptMethodSteepestDescent
25 
27 
28 #include "utilities/CVector.h"
29 
30 class FDescent;
31 
33 {
35 
36  // Operations
37 private:
38 
39  /**
40  * Default Constructor
41  */
42  COptMethodSteepestDescent(const CCopasiContainer * pParent = NULL);
43 
44  /**
45  * Initialize arrays and pointer.
46  * @return bool success
47  */
48  virtual bool initialize();
49 
50  /**
51  * Cleanup arrays and pointers.
52  * @return bool success
53  */
54  virtual bool cleanup();
55 
56  /**
57  * Evaluate the objective function for the current parameters
58  * @return const C_FLOAT64 & objectiveValue
59  */
60  const C_FLOAT64 & evaluate();
61 
62  /**
63  * Calculate the gradient of the objective at the current parameters
64  */
65  void gradient();
66 
67  /**
68  * Descent int the direction of the gradient with step x
69  * and evaluate the objective function
70  * @param const C_FLOAT64 & x
71  * @return const C_FLOAT64 objectiveValue
72  */
73  C_FLOAT64 descentLine(const C_FLOAT64 & x);
74 
75  /**
76  * Initialize contained objects.
77  */
78  void initObjects();
79 
80 public:
81  /**
82  * Copy Constructor
83  * @param const COptMethodSteepestDescent & src
84  */
86  const CCopasiContainer * pParent = NULL);
87 
88  /**
89  * Destructor
90  */
92 
93  /**
94  * Execute the optimization algorithm calling simulation routine
95  * when needed. It is noted that this procedure can give feedback
96  * of its progress by the callback function set with SetCallback.
97  */
98 
99  virtual bool optimise();
100 
101 private :
102 
103  // variables
104 
105  /**
106  * The maximum number of iterations.
107  */
109 
110  /**
111  * The tolerance
112  */
113  C_FLOAT64 mTolerance; // length of steps taken
114 
115  /**
116  * Indicates whether there the executions shall continue
117  */
118  bool mContinue;
119 
120  /**
121  * The best value found so far.
122  */
124 
125  /**
126  * array of values of objective function f/ individuals
127  */
129 
130  /**
131  * number of parameters
132  */
134 
135  /**
136  * A vector of parameters of the current individual
137  */
139 
140  /**
141  * The gradient vector for the objective function
142  */
144 
145  /**
146  * Functor pointing to the descent method.
147  */
149 
150  /**
151  * The current iteration
152  */
154 };
155 
156 #endif // COPASI_COptMethodSteepestDescent
static COptMethod * createMethod(CCopasiMethod::SubType subType=CCopasiMethod::RandomSearch)
Definition: COptMethod.cpp:50
#define C_INT32
Definition: copasi.h:90
COptMethodSteepestDescent(const CCopasiContainer *pParent=NULL)
#define C_FLOAT64
Definition: copasi.h:92
C_FLOAT64 descentLine(const C_FLOAT64 &x)