MinLCA algorithms
optimisation-profiler.hh
Go to the documentation of this file.
1 #ifndef __MINLCA_MINLCA_OPT_PROFILER_HH
2 #define __MINLCA_MINLCA_OPT_PROFILER_HH
3 
4 #include <minlca/profiler.hh>
5 #include <minlca/optimisation.hh>
6 
9 
10 namespace minlca
11 {
12 
14 template<class LCAOpt>
15 class MinLCAOptProfiler : public MinLCAProfiler<LCAOpt>
16 {
17 protected:
19  typedef LCAOpt Base;
20  using ProfilerBase::_t;
23 
24 public:
26  template<typename... Args>
28  Args &&...
29  args
30  )
31  : ProfilerBase(std::forward<Args>(args)...)
32  {
34  }
35 
36  virtual void initialSolution(const typename LCAOpt::Colouring &c)
37  {
38  _t.restart();
39  Base::initialSolution(c);
40  _initial_sol_time = _t.elapsed();
41  }
42 
47  {
48  return _initial_sol_time;
49  }
50 };
51 }
52 
53 #endif
double initialSolutionTime()
Retrieve the duration of setting the initial solution.
MinLCAOptProfiler(Args &&...args)
Constructor.
double _initial_sol_time
Duration of setting initial solution.
LCAOpt Base
Base MinLCA class.
Default namespace Default namespace for MinLCA algorithms.
Definition: base.hh:15
utils::Timer _t
Timer used to count the durations.
Definition: profiler.hh:20
Class for timing MinLCA algorithms.
Definition: profiler.hh:16
double _creation_time
Duration of object creation.
Definition: profiler.hh:21
MinLCAProfiler< LCAOpt > ProfilerBase
Base profiler.
Defines the base class for MinLCA optimisation algorithms.
Contains the definitions for timing MinLCA algorithms.
double elapsed() const
Retrieve elapsed time.
Definition: timer.cc:20
Class for timing MinLCA optimisation algorithms.
void restart()
Restart the timer.
Definition: timer.cc:15