--- trunk/gadget/optinfo.h 2015/06/10 13:01:42 10 +++ trunk/gadget/optinfo.h 2015/07/23 19:00:38 11 @@ -5,6 +5,7 @@ #include "doublematrix.h" #include "doublevector.h" #include "intvector.h" +#include "seq_optimize_template.h" enum OptType { OPTHOOKE = 1, OPTSIMANN, OPTBFGS }; @@ -40,6 +41,10 @@ * \brief This is the function used to call the optimisation algorithms */ virtual void OptimiseLikelihood() {}; + //FIXME doc + virtual void OptimiseLikelihoodOMP() {}; + //FIXME doc + void setSeed(unsigned* val) {seed = val[0]; seedM = val[1]; seedP = val[2];}; /** * \brief This will return the type of optimisation class * \return type @@ -62,6 +67,10 @@ * \brief This denotes what type of optimisation class has been created */ OptType type; + //FIXME doc + unsigned seed; + unsigned seedM; + unsigned seedP; }; /** @@ -99,6 +108,10 @@ * \brief This is the function that will calculate the likelihood score using the Hooke & Jeeves optimiser */ virtual void OptimiseLikelihood(); +#ifdef GADGET_OPENMP + //TODO doc + virtual void OptimiseLikelihoodOMP(); +#endif private: /** * \brief This function will calculate the best point that can be found close to the current point @@ -109,6 +122,9 @@ * \return the best function value found from the search */ double bestNearby(DoubleVector& delta, DoubleVector& point, double prevbest, IntVector& param); + //TODO doc + double bestNearbyOMP(DoubleVector& delta, DoubleVector& point, double prevbest, IntVector& param); + double bestNearbyOMP2(DoubleVector& delta, DoubleVector& point, double prevbest, IntVector& param); /** * \brief This is the maximum number of iterations for the Hooke & Jeeves optimisation */ @@ -165,6 +181,17 @@ * \brief This is the function that will calculate the likelihood score using the Simulated Annealing optimiser */ virtual void OptimiseLikelihood(); + //FIXME doc +#ifdef GADGET_OPENMP + virtual void OptimiseLikelihoodOMP(); +#endif +//FIXME doc + 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 @@ -250,6 +277,10 @@ * \brief This is the function that will calculate the likelihood score using the BFGS optimiser */ virtual void OptimiseLikelihood(); + //FIXME doc +#ifdef GADGET_OPENMP + virtual void OptimiseLikelihoodOMP(); +#endif private: /** * \brief This function will numerically calculate the gradient of the function at the current point