5 |
#include "doublematrix.h" |
#include "doublematrix.h" |
6 |
#include "doublevector.h" |
#include "doublevector.h" |
7 |
#include "intvector.h" |
#include "intvector.h" |
8 |
|
#include "seq_optimize_template.h" |
9 |
|
|
10 |
enum OptType { OPTHOOKE = 1, OPTSIMANN, OPTBFGS }; |
enum OptType { OPTHOOKE = 1, OPTSIMANN, OPTBFGS }; |
11 |
|
|
41 |
* \brief This is the function used to call the optimisation algorithms |
* \brief This is the function used to call the optimisation algorithms |
42 |
*/ |
*/ |
43 |
virtual void OptimiseLikelihood() {}; |
virtual void OptimiseLikelihood() {}; |
44 |
|
//FIXME doc |
45 |
|
virtual void OptimiseLikelihoodOMP() {}; |
46 |
|
//FIXME doc |
47 |
|
void setSeed(unsigned* val) {seed = val[0]; seedM = val[1]; seedP = val[2];}; |
48 |
/** |
/** |
49 |
* \brief This will return the type of optimisation class |
* \brief This will return the type of optimisation class |
50 |
* \return type |
* \return type |
67 |
* \brief This denotes what type of optimisation class has been created |
* \brief This denotes what type of optimisation class has been created |
68 |
*/ |
*/ |
69 |
OptType type; |
OptType type; |
70 |
|
//FIXME doc |
71 |
|
unsigned seed; |
72 |
|
unsigned seedM; |
73 |
|
unsigned seedP; |
74 |
}; |
}; |
75 |
|
|
76 |
/** |
/** |
108 |
* \brief This is the function that will calculate the likelihood score using the Hooke & Jeeves optimiser |
* \brief This is the function that will calculate the likelihood score using the Hooke & Jeeves optimiser |
109 |
*/ |
*/ |
110 |
virtual void OptimiseLikelihood(); |
virtual void OptimiseLikelihood(); |
111 |
|
#ifdef GADGET_OPENMP |
112 |
|
//TODO doc |
113 |
|
virtual void OptimiseLikelihoodOMP(); |
114 |
|
#endif |
115 |
private: |
private: |
116 |
/** |
/** |
117 |
* \brief This function will calculate the best point that can be found close to the current point |
* \brief This function will calculate the best point that can be found close to the current point |
122 |
* \return the best function value found from the search |
* \return the best function value found from the search |
123 |
*/ |
*/ |
124 |
double bestNearby(DoubleVector& delta, DoubleVector& point, double prevbest, IntVector& param); |
double bestNearby(DoubleVector& delta, DoubleVector& point, double prevbest, IntVector& param); |
125 |
|
//TODO doc |
126 |
|
double bestNearbyOMP(DoubleVector& delta, DoubleVector& point, double prevbest, IntVector& param); |
127 |
|
double bestNearbyOMP2(DoubleVector& delta, DoubleVector& point, double prevbest, IntVector& param); |
128 |
/** |
/** |
129 |
* \brief This is the maximum number of iterations for the Hooke & Jeeves optimisation |
* \brief This is the maximum number of iterations for the Hooke & Jeeves optimisation |
130 |
*/ |
*/ |
181 |
* \brief This is the function that will calculate the likelihood score using the Simulated Annealing optimiser |
* \brief This is the function that will calculate the likelihood score using the Simulated Annealing optimiser |
182 |
*/ |
*/ |
183 |
virtual void OptimiseLikelihood(); |
virtual void OptimiseLikelihood(); |
184 |
|
//FIXME doc |
185 |
|
#ifdef GADGET_OPENMP |
186 |
|
virtual void OptimiseLikelihoodOMP(); |
187 |
|
#endif |
188 |
|
//FIXME doc |
189 |
|
virtual void newValue(int nvars, int l, IntVector& param, DoubleVector& trialx, |
190 |
|
DoubleVector& x, DoubleVector& lowerb, DoubleVector& upperb, DoubleVector& vm); |
191 |
|
// //FIXME doc |
192 |
|
// virtual void buildNewParams_f(Siman& seed, DoubleVector& params); |
193 |
|
// virtual void adjustVm(Siman& seed); |
194 |
|
// virtual void temperature(Siman& seed); |
195 |
private: |
private: |
196 |
/** |
/** |
197 |
* \brief This is the temperature reduction factor |
* \brief This is the temperature reduction factor |
277 |
* \brief This is the function that will calculate the likelihood score using the BFGS optimiser |
* \brief This is the function that will calculate the likelihood score using the BFGS optimiser |
278 |
*/ |
*/ |
279 |
virtual void OptimiseLikelihood(); |
virtual void OptimiseLikelihood(); |
280 |
|
//FIXME doc |
281 |
|
#ifdef GADGET_OPENMP |
282 |
|
virtual void OptimiseLikelihoodOMP(); |
283 |
|
#endif |
284 |
private: |
private: |
285 |
/** |
/** |
286 |
* \brief This function will numerically calculate the gradient of the function at the current point |
* \brief This function will numerically calculate the gradient of the function at the current point |