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 |
|
* \brief This is the function used to call the optimisation algorithms parallelized with OpenMP of the reproducible version |
46 |
|
*/ |
47 |
virtual void OptimiseLikelihoodOMP() {}; |
virtual void OptimiseLikelihoodOMP() {}; |
48 |
//FIXME doc |
/** |
49 |
|
* \brief This function set the seeds used in SA |
50 |
|
* \param val array of unsigned int with the seeds |
51 |
|
*/ |
52 |
void setSeed(unsigned* val) {seed = val[0]; seedM = val[1]; seedP = val[2];}; |
void setSeed(unsigned* val) {seed = val[0]; seedM = val[1]; seedP = val[2];}; |
53 |
/** |
/** |
54 |
* \brief This will return the type of optimisation class |
* \brief This will return the type of optimisation class |
72 |
* \brief This denotes what type of optimisation class has been created |
* \brief This denotes what type of optimisation class has been created |
73 |
*/ |
*/ |
74 |
OptType type; |
OptType type; |
75 |
//FIXME doc |
/** |
76 |
|
* \brief This is the seed used for the calculation of the new value of the parameters |
77 |
|
*/ |
78 |
unsigned seed; |
unsigned seed; |
79 |
|
/** |
80 |
|
* \brief This is the seed used for the acceptance of the metropolis |
81 |
|
*/ |
82 |
unsigned seedM; |
unsigned seedM; |
83 |
|
/** |
84 |
|
* \brief This is the seed used to change the order of the parameters |
85 |
|
*/ |
86 |
unsigned seedP; |
unsigned seedP; |
87 |
}; |
}; |
88 |
|
|
122 |
*/ |
*/ |
123 |
virtual void OptimiseLikelihood(); |
virtual void OptimiseLikelihood(); |
124 |
#ifdef GADGET_OPENMP |
#ifdef GADGET_OPENMP |
125 |
//TODO doc |
/** |
126 |
|
* \brief This is the function that will calculate the likelihood score using the Hooke & Jeeves optimiser parallelized with the reproducible version implemented OpenMP |
127 |
|
*/ |
128 |
virtual void OptimiseLikelihoodOMP(); |
virtual void OptimiseLikelihoodOMP(); |
129 |
#endif |
#endif |
130 |
private: |
private: |
137 |
* \return the best function value found from the search |
* \return the best function value found from the search |
138 |
*/ |
*/ |
139 |
double bestNearby(DoubleVector& delta, DoubleVector& point, double prevbest, IntVector& param); |
double bestNearby(DoubleVector& delta, DoubleVector& point, double prevbest, IntVector& param); |
140 |
//TODO doc |
/** |
141 |
|
* \brief This function implemented the reproducible version with OpenMP will calculate the best point that can be found close to the current point |
142 |
|
* \param delta is the DoubleVector of the steps to take when looking for the best point |
143 |
|
* \param point is the DoubleVector that will contain the parameters corresponding to the best function value found from the search |
144 |
|
* \param prevbest is the current best point value |
145 |
|
* \param param is the IntVector containing the order that the parameters should be searched in |
146 |
|
* \return the best function value found from the search |
147 |
|
*/ |
148 |
double bestNearbyOMP(DoubleVector& delta, DoubleVector& point, double prevbest, IntVector& param); |
double bestNearbyOMP(DoubleVector& delta, DoubleVector& point, double prevbest, IntVector& param); |
149 |
|
/** |
150 |
|
* \brief This function implemented the speculative version with OpenMP will calculate the best point that can be found close to the current point |
151 |
|
* \param delta is the DoubleVector of the steps to take when looking for the best point |
152 |
|
* \param point is the DoubleVector that will contain the parameters corresponding to the best function value found from the search |
153 |
|
* \param prevbest is the current best point value |
154 |
|
* \param param is the IntVector containing the order that the parameters should be searched in |
155 |
|
* \return the best function value found from the search |
156 |
|
*/ |
157 |
double bestNearbyOMP2(DoubleVector& delta, DoubleVector& point, double prevbest, IntVector& param); |
double bestNearbyOMP2(DoubleVector& delta, DoubleVector& point, double prevbest, IntVector& param); |
158 |
/** |
/** |
159 |
* \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 |
211 |
* \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 |
212 |
*/ |
*/ |
213 |
virtual void OptimiseLikelihood(); |
virtual void OptimiseLikelihood(); |
|
//FIXME doc |
|
214 |
#ifdef GADGET_OPENMP |
#ifdef GADGET_OPENMP |
215 |
|
/** |
216 |
|
* \brief This is the function that will calculate the likelihood score using the Simulated Annealing optimiser parallelized with the reproducible version implemented OpenMP |
217 |
|
*/ |
218 |
virtual void OptimiseLikelihoodOMP(); |
virtual void OptimiseLikelihoodOMP(); |
219 |
#endif |
#endif |
220 |
//FIXME doc |
/** |
221 |
|
* \brief This function calculate a new valor for the parameter l |
222 |
|
* \param nvars the number of variables to be optimised |
223 |
|
* \param l the parameter to change |
224 |
|
* \param param IntVector with the order of the parameters |
225 |
|
* \param trialx DoubleVector that storage the values of the parameters to evaluate during this iteration |
226 |
|
* \param x DoubleVector that storage the best values of the parameters |
227 |
|
* \param lowerb DoubleVector with the lower bounds of the variables to be optimised |
228 |
|
* \param upperb DoubleVector with the upper bounds of the variables to be optimised |
229 |
|
* \param vm DoubleVector with the value for the maximum step length for each parameter |
230 |
|
*/ |
231 |
virtual void newValue(int nvars, int l, IntVector& param, DoubleVector& trialx, |
virtual void newValue(int nvars, int l, IntVector& param, DoubleVector& trialx, |
232 |
DoubleVector& x, DoubleVector& lowerb, DoubleVector& upperb, DoubleVector& vm); |
DoubleVector& x, DoubleVector& lowerb, DoubleVector& upperb, DoubleVector& vm); |
|
// //FIXME doc |
|
|
// virtual void buildNewParams_f(Siman& seed, DoubleVector& params); |
|
|
// virtual void adjustVm(Siman& seed); |
|
|
// virtual void temperature(Siman& seed); |
|
233 |
private: |
private: |
234 |
/** |
/** |
235 |
* \brief This is the temperature reduction factor |
* \brief This is the temperature reduction factor |
315 |
* \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 |
316 |
*/ |
*/ |
317 |
virtual void OptimiseLikelihood(); |
virtual void OptimiseLikelihood(); |
|
//FIXME doc |
|
318 |
#ifdef GADGET_OPENMP |
#ifdef GADGET_OPENMP |
319 |
|
/** |
320 |
|
* \brief This function call the sequential function. BFGS isn't implemented with OpenMP |
321 |
|
*/ |
322 |
virtual void OptimiseLikelihoodOMP(); |
virtual void OptimiseLikelihoodOMP(); |
323 |
#endif |
#endif |
324 |
private: |
private: |