2012-03-18 08:08:38 +04:00
|
|
|
#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
|
|
|
|
};
|
|
|
|
|
2012-05-10 02:51:05 +04:00
|
|
|
static std::vector<std::string> GetTypeNames();
|
2012-03-18 08:08:38 +04:00
|
|
|
|
|
|
|
// 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,
|
2012-05-10 02:51:05 +04:00
|
|
|
const std::vector<bool>& positive,
|
2012-03-18 08:08:38 +04:00
|
|
|
const std::vector<parameter_t>& start,
|
|
|
|
const std::string& type,
|
|
|
|
unsigned int nrandom);
|
|
|
|
|
|
|
|
private:
|
|
|
|
OptimizerFactory() {}
|
|
|
|
~OptimizerFactory() {}
|
|
|
|
|
2012-05-10 02:51:05 +04:00
|
|
|
static std::vector<std::string> m_type_names;
|
2012-03-18 08:08:38 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // MERT_OPTIMIZER_FACTORY_H_
|