Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTetsuo Kiso <tetsuo-s@is.naist.jp>2011-11-12 11:39:57 +0400
committerTetsuo Kiso <tetsuo-s@is.naist.jp>2011-11-12 11:39:57 +0400
commitdf0874df89429dc940df75b125a02362e3b1b539 (patch)
treebb4717e3b488c8be15b813395514dfa07a9921d1 /mert/Point.h
parentfdcd148cac32bca8993e5e8b10e56f86f5f7e522 (diff)
Make Point::score a private by defining accessor/mutator.
Diffstat (limited to 'mert/Point.h')
-rw-r--r--mert/Point.h21
1 files changed, 11 insertions, 10 deletions
diff --git a/mert/Point.h b/mert/Point.h
index 4e06bfd26..a836a94b1 100644
--- a/mert/Point.h
+++ b/mert/Point.h
@@ -4,8 +4,6 @@
#include <vector>
#include "Types.h"
#include "FeatureStats.h"
-#include <cassert>
-
class Optimizer;
@@ -45,6 +43,8 @@ private:
static vector<parameter_t> m_min;
static vector<parameter_t> m_max;
+ statscore_t score_;
+
public:
static unsigned int getdim() {
return dim;
@@ -62,8 +62,6 @@ public:
return fixedweights.empty();
}
- statscore_t score;
-
Point() : vector<parameter_t>(dim) {}
Point(const vector<parameter_t>& init,
const vector<parameter_t>& min,
@@ -71,10 +69,10 @@ public:
void Randomize();
// Compute the feature function
- double operator*(const FeatureStats&)const;
- Point operator+(const Point&)const;
+ double operator*(const FeatureStats&) const;
+ Point operator+(const Point&) const;
void operator+=(const Point&);
- Point operator*(float)const;
+ Point operator*(float) const;
/**
* Write the Whole featureweight to a stream (ie pdim float).
@@ -89,10 +87,13 @@ public:
* Return a vector of size pdim where all weights have been
* put (including fixed ones).
*/
- vector<parameter_t> GetAllWeights()const;
- statscore_t GetScore()const {
- return score;
+ vector<parameter_t> GetAllWeights() const;
+
+ statscore_t GetScore() const {
+ return score_;
}
+
+ void SetScore(statscore_t score) { score_ = score; }
};
#endif // POINT_H