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>2012-03-10 12:12:34 +0400
committerTetsuo Kiso <tetsuo-s@is.naist.jp>2012-03-10 12:12:34 +0400
commite7a2483b2296be98441a8df286612fe3f37ef613 (patch)
tree60dd9e1fc444391437237df6a68b2806d1156446 /mert/FeatureArray.h
parented6e6f00b1b73a99d9177b984835af063ccf690f (diff)
mert: Prefix private members with "m_" except TER.
Squashed commit of the following: - Clean up PRO. - Clean up ScoreStats. - Clean up ScoreData. - Clean up ScoreArray. - Remove unnecessary headers. - Clean up ScopedVector. - Clean up Point. - Clean up PerScorer. - Clean up Optimizer. - Clean up MergeScorer. - Clean up InterpolatedScorer. - Clean up FileStream. - Clean up FeatureStats. - Remove inefficient string concatenation. - Clean up FeatureData. - Clean up FeatureArray. - Clean up Data.
Diffstat (limited to 'mert/FeatureArray.h')
-rw-r--r--mert/FeatureArray.h42
1 files changed, 20 insertions, 22 deletions
diff --git a/mert/FeatureArray.h b/mert/FeatureArray.h
index b4b305e39..fa5590ac1 100644
--- a/mert/FeatureArray.h
+++ b/mert/FeatureArray.h
@@ -26,69 +26,67 @@ class FeatureArray
private:
// idx to identify the utterance. It can differ from
// the index inside the vector.
- std::string idx;
-
-protected:
- featarray_t array_;
- size_t number_of_features;
- std::string features;
- bool _sparse_flag;
+ std::string m_index;
+ featarray_t m_array;
+ size_t m_num_features;
+ std::string m_features;
+ bool m_sparse_flag;
public:
FeatureArray();
~FeatureArray();
inline void clear() {
- array_.clear();
+ m_array.clear();
}
inline bool hasSparseFeatures() const {
- return _sparse_flag;
+ return m_sparse_flag;
}
inline std::string getIndex() const {
- return idx;
+ return m_index;
}
inline void setIndex(const std::string& value) {
- idx = value;
+ m_index = value;
}
inline FeatureStats& get(size_t i) {
- return array_.at(i);
+ return m_array.at(i);
}
inline const FeatureStats& get(size_t i)const {
- return array_.at(i);
+ return m_array.at(i);
}
void add(FeatureStats& e) {
- array_.push_back(e);
+ m_array.push_back(e);
}
//ADDED BY TS
void swap(size_t i, size_t j) {
- std::swap(array_[i],array_[j]);
+ std::swap(m_array[i], m_array[j]);
}
-
+
void resize(size_t new_size) {
- array_.resize(std::min(new_size,array_.size()));
+ m_array.resize(std::min(new_size, m_array.size()));
}
//END_ADDED
void merge(FeatureArray& e);
inline size_t size() const {
- return array_.size();
+ return m_array.size();
}
inline size_t NumberOfFeatures() const {
- return number_of_features;
+ return m_num_features;
}
inline void NumberOfFeatures(size_t v) {
- number_of_features = v;
+ m_num_features = v;
}
inline std::string Features() const {
- return features;
+ return m_features;
}
inline void Features(const std::string& f) {
- features = f;
+ m_features = f;
}
void savetxt(ofstream& outFile);