diff options
author | Tetsuo Kiso <tetsuo-s@is.naist.jp> | 2012-03-18 08:08:38 +0400 |
---|---|---|
committer | Tetsuo Kiso <tetsuo-s@is.naist.jp> | 2012-03-18 08:08:38 +0400 |
commit | 54233d327052793807fc44583334dd3b396176e5 (patch) | |
tree | db01a4c85371b5d9669d2e82e366af42504b42fd /mert/OptimizerFactory.h | |
parent | 38c662d4e036558ce07cc4c469d11631b8186be8 (diff) |
Create files for OptimizerFactory class; add the unit test.
Diffstat (limited to 'mert/OptimizerFactory.h')
-rw-r--r-- | mert/OptimizerFactory.h | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/mert/OptimizerFactory.h b/mert/OptimizerFactory.h new file mode 100644 index 000000000..4c90c962f --- /dev/null +++ b/mert/OptimizerFactory.h @@ -0,0 +1,41 @@ +#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<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<parameter_t>& start, + const std::string& type, + unsigned int nrandom); + + private: + OptimizerFactory() {} + ~OptimizerFactory() {} + + static vector<string> m_type_names; +}; + +#endif // MERT_OPTIMIZER_FACTORY_H_ |