diff options
author | Tetsuo Kiso <tetsuo-s@is.naist.jp> | 2012-02-01 11:46:36 +0400 |
---|---|---|
committer | Tetsuo Kiso <tetsuo-s@is.naist.jp> | 2012-02-01 11:46:36 +0400 |
commit | 8e1bf6d7d1e4b596b8eab7b267adcf0e39cd9fc7 (patch) | |
tree | 5b2f1494ea601d9faca883781dcf26c60fb5e161 /mert/Optimizer.h | |
parent | b399dfc9067c55945f59d04e23631589ae755a63 (diff) |
Pass std::string objects by const reference instead of by value.
Diffstat (limited to 'mert/Optimizer.h')
-rw-r--r-- | mert/Optimizer.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/mert/Optimizer.h b/mert/Optimizer.h index aa588994d..7cc785337 100644 --- a/mert/Optimizer.h +++ b/mert/Optimizer.h @@ -108,7 +108,7 @@ class OptimizerFactory { public: static vector<string> GetTypeNames(); - static Optimizer* BuildOptimizer(unsigned dim, vector<unsigned> tooptimize, vector<parameter_t> start, string type, unsigned int nrandom); + static Optimizer* BuildOptimizer(unsigned dim, vector<unsigned> tooptimize, vector<parameter_t> start, const string& type, unsigned int nrandom); private: OptimizerFactory() {} @@ -122,9 +122,13 @@ private: NOPTIMIZER }; - static OptType GetOType(string); - static vector<string> typenames; + // Get optimizer type. + static OptType GetOType(const string& type); + + // Setup optimization types. static void SetTypeNames(); + + static vector<string> typenames; }; #endif // OPTIMIZER_H |