Commits

Ruben Martinez-Cantin committed 65fad57 Merge

Merging

  • Participants
  • Parent commits add0480, 0983cdd

Comments (0)

Files changed (1)

File src/bayesoptbase.cpp

 #include "log.hpp"
 #include "posteriormodel.hpp"
 
+#define BAYESOPT_TIME_IT 1
+
 namespace bayesopt
 {
 
 
   void BayesOptBase::optimize(vectord &bestPoint)
   {
+#if BAYESOPT_TIME_IT
+    double curr_t, prev_t = (double)clock() / CLOCKS_PER_SEC;
+#endif
     initializeOptimization();
     assert(mDims == bestPoint.size());
     
     for (size_t ii = 0; ii < mParameters.n_iterations; ++ii)
       {      
 	stepOptimization();
+#if BAYESOPT_TIME_IT
+	curr_t = (double)clock() / CLOCKS_PER_SEC;
+	std::cout << "Time:" << curr_t - prev_t << std::endl;
+	prev_t = curr_t;
+#endif
       }
    
     bestPoint = getFinalResult();