diff options
author | Tetsuo Kiso <tetsuo-s@is.naist.jp> | 2011-11-12 05:16:31 +0400 |
---|---|---|
committer | Tetsuo Kiso <tetsuo-s@is.naist.jp> | 2011-11-12 05:16:31 +0400 |
commit | 43beb88df52977ed84ced6cb431d21d616fb757a (patch) | |
tree | d2ef8904f0429ba74936df7036820b255b007f2f /mert/Optimizer.h | |
parent | fdb83b0f6d7a5b95a4f3c617e5212877d0699eae (diff) |
Fix constructors of scorer classes and optimizer classes.
Using public const members is not good idea.
It should be initialized in private by constructors.
Diffstat (limited to 'mert/Optimizer.h')
-rw-r--r-- | mert/Optimizer.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/mert/Optimizer.h b/mert/Optimizer.h index d0f738804..ad2553426 100644 --- a/mert/Optimizer.h +++ b/mert/Optimizer.h @@ -74,9 +74,9 @@ public: class SimpleOptimizer: public Optimizer { private: - static float eps; + const float kEPS; public: - SimpleOptimizer(unsigned dim,vector<unsigned> i2O,vector<parameter_t> start,unsigned int nrandom): Optimizer(dim, i2O, start,nrandom) {} + SimpleOptimizer(unsigned dim,vector<unsigned> i2O,vector<parameter_t> start,unsigned int nrandom): Optimizer(dim, i2O, start,nrandom), kEPS(0.0001) {} virtual statscore_t TrueRun(Point&)const; }; @@ -86,9 +86,9 @@ public: class RandomDirectionOptimizer: public Optimizer { private: - static float eps; + const float kEPS; public: - RandomDirectionOptimizer(unsigned dim,vector<unsigned> i2O,vector<parameter_t> start,unsigned int nrandom): Optimizer(dim,i2O,start,nrandom) {} + RandomDirectionOptimizer(unsigned dim,vector<unsigned> i2O,vector<parameter_t> start,unsigned int nrandom): Optimizer(dim,i2O,start,nrandom), kEPS(0.0001) {} virtual statscore_t TrueRun(Point&)const; }; |