--- trunk/gadget/optinfo.h 2015/07/23 19:00:38 11 +++ trunk/gadget/optinfo.h 2015/07/24 18:36:24 12 @@ -41,9 +41,14 @@ * \brief This is the function used to call the optimisation algorithms */ virtual void OptimiseLikelihood() {}; - //FIXME doc + /** + * \brief This is the function used to call the optimisation algorithms parallelized with OpenMP of the reproducible version + */ virtual void OptimiseLikelihoodOMP() {}; - //FIXME doc + /** + * \brief This function set the seeds used in SA + * \param val array of unsigned int with the seeds + */ void setSeed(unsigned* val) {seed = val[0]; seedM = val[1]; seedP = val[2];}; /** * \brief This will return the type of optimisation class @@ -67,9 +72,17 @@ * \brief This denotes what type of optimisation class has been created */ OptType type; - //FIXME doc + /** + * \brief This is the seed used for the calculation of the new value of the parameters + */ unsigned seed; + /** + * \brief This is the seed used for the acceptance of the metropolis + */ unsigned seedM; + /** + * \brief This is the seed used to change the order of the parameters + */ unsigned seedP; }; @@ -109,7 +122,9 @@ */ virtual void OptimiseLikelihood(); #ifdef GADGET_OPENMP - //TODO doc + /** + * \brief This is the function that will calculate the likelihood score using the Hooke & Jeeves optimiser parallelized with the reproducible version implemented OpenMP + */ virtual void OptimiseLikelihoodOMP(); #endif private: @@ -122,8 +137,23 @@ * \return the best function value found from the search */ double bestNearby(DoubleVector& delta, DoubleVector& point, double prevbest, IntVector& param); - //TODO doc + /** + * \brief This function implemented the reproducible version with OpenMP will calculate the best point that can be found close to the current point + * \param delta is the DoubleVector of the steps to take when looking for the best point + * \param point is the DoubleVector that will contain the parameters corresponding to the best function value found from the search + * \param prevbest is the current best point value + * \param param is the IntVector containing the order that the parameters should be searched in + * \return the best function value found from the search + */ double bestNearbyOMP(DoubleVector& delta, DoubleVector& point, double prevbest, IntVector& param); + /** + * \brief This function implemented the speculative version with OpenMP will calculate the best point that can be found close to the current point + * \param delta is the DoubleVector of the steps to take when looking for the best point + * \param point is the DoubleVector that will contain the parameters corresponding to the best function value found from the search + * \param prevbest is the current best point value + * \param param is the IntVector containing the order that the parameters should be searched in + * \return the best function value found from the search + */ double bestNearbyOMP2(DoubleVector& delta, DoubleVector& point, double prevbest, IntVector& param); /** * \brief This is the maximum number of iterations for the Hooke & Jeeves optimisation @@ -181,17 +211,25 @@ * \brief This is the function that will calculate the likelihood score using the Simulated Annealing optimiser */ virtual void OptimiseLikelihood(); - //FIXME doc #ifdef GADGET_OPENMP + /** + * \brief This is the function that will calculate the likelihood score using the Simulated Annealing optimiser parallelized with the reproducible version implemented OpenMP + */ virtual void OptimiseLikelihoodOMP(); #endif -//FIXME doc + /** + * \brief This function calculate a new valor for the parameter l + * \param nvars the number of variables to be optimised + * \param l the parameter to change + * \param param IntVector with the order of the parameters + * \param trialx DoubleVector that storage the values of the parameters to evaluate during this iteration + * \param x DoubleVector that storage the best values of the parameters + * \param lowerb DoubleVector with the lower bounds of the variables to be optimised + * \param upperb DoubleVector with the upper bounds of the variables to be optimised + * \param vm DoubleVector with the value for the maximum step length for each parameter + */ virtual void newValue(int nvars, int l, IntVector& param, DoubleVector& trialx, 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); private: /** * \brief This is the temperature reduction factor @@ -277,8 +315,10 @@ * \brief This is the function that will calculate the likelihood score using the BFGS optimiser */ virtual void OptimiseLikelihood(); - //FIXME doc #ifdef GADGET_OPENMP + /** + * \brief This function call the sequential function. BFGS isn't implemented with OpenMP + */ virtual void OptimiseLikelihoodOMP(); #endif private: