OPTK  0.1.2
Toolkit for global optimisation algorithms
benchmark.hpp
Go to the documentation of this file.
1 
22 #ifndef __BENCHMARK_H_
23 #define __BENCHMARK_H_
24 
25 #include <string>
26 
27 #include <optk/types.hpp>
28 #include <optk/optimiser.hpp>
29 
30 namespace optk {
31 
32 class benchmark_set;
33 typedef std::vector<benchmark_set *> bench_list;
34 
38 class benchmark {
39  public:
44  benchmark (const std::string &name);
45 
49  std::string get_name();
50 
56  virtual sspace::sspace_t *get_search_space () = 0;
57 
69  virtual double evaluate (inst::set x) = 0;
70 
71  protected:
72  std::string m_name;
73 };
74 
82  public:
88  benchmark_set (const std::string &n) {
89  m_name = n;
90  };
91 
95  virtual ~benchmark_set ();
96 
102  virtual void run (optk::optimisers *opts, optk::ctx_t *ctx) = 0;
103 
104  std::string get_name () { return m_name; }
105 
106  private:
107  std::string m_name;
108 };
109 
115 class benchmarks {
116  public:
117  benchmarks ();
118 
123  ~benchmarks ();
124 
131  void register_benchmark (benchmark_set *b);
132 
136  optk::bench_list *collection();
137 
138  private:
140  bench_list m_arr;
141 };
142 
143 } // namespace optk
144 
145 #endif // __BENCHMARK_H_
std::vector< param_t * > sspace_t
Definition: types.hpp:318
Definition: types.hpp:150
virtual sspace::sspace_t * get_search_space()=0
virtual double evaluate(inst::set x)=0
Definition: optimiser.hpp:147
Definition: benchmark.hpp:38
Defines the main types used in the program.
Definition: types.hpp:47
Definition: core.cpp:26
benchmark_set(const std::string &n)
Definition: benchmark.hpp:88
Definition: benchmark.hpp:81
std::string get_name()
Definition: benchmark.cpp:32
Definition: benchmark.hpp:115
bench_list m_arr
Definition: benchmark.hpp:140
benchmark(const std::string &name)
Definition: benchmark.cpp:26
This file defines the base class for optimisers.