blob: 7d5e023236210da212aec9ea186a347a845d7904 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
#ifndef MERT_OPTIMIZER_FACTORY_H_
#define MERT_OPTIMIZER_FACTORY_H_
#include <vector>
#include "Types.h"
class Optimizer;
class OptimizerFactory
{
public:
// NOTE: Add new optimizer here BEFORE NOPTIMZER
enum OptimizerType {
POWELL = 0,
RANDOM_DIRECTION = 1,
RANDOM,
NOPTIMIZER
};
static std::vector<std::string> GetTypeNames();
// Setup optimization types.
static void SetTypeNames();
// Get optimizer type.
static OptimizerType GetOptimizerType(const std::string& type);
static Optimizer* BuildOptimizer(unsigned dim,
const std::vector<unsigned>& to_optimize,
const std::vector<bool>& positive,
const std::vector<parameter_t>& start,
const std::string& type,
unsigned int nrandom);
private:
OptimizerFactory() {}
~OptimizerFactory() {}
static std::vector<std::string> m_type_names;
};
#endif // MERT_OPTIMIZER_FACTORY_H_
|