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:
authorhieuhoang1972 <hieuhoang1972@1f5c12ca-751b-0410-a591-d2e778427230>2011-02-24 15:42:19 +0300
committerhieuhoang1972 <hieuhoang1972@1f5c12ca-751b-0410-a591-d2e778427230>2011-02-24 15:42:19 +0300
commit148c1e8305fbcf8dc0acd021fe5825842e0b3c8d (patch)
tree04041cbc625ff61db8d94471c6d2d1c61264f653 /mert/ScoreArray.h
parenta59ad11b58acf5dd64ec6f5990bb4ef5b74ebf28 (diff)
run beautify.perl. Consistent formatting for .h & .cpp files
git-svn-id: https://mosesdecoder.svn.sourceforge.net/svnroot/mosesdecoder/trunk@3899 1f5c12ca-751b-0410-a591-d2e778427230
Diffstat (limited to 'mert/ScoreArray.h')
-rw-r--r--mert/ScoreArray.h106
1 files changed, 65 insertions, 41 deletions
diff --git a/mert/ScoreArray.h b/mert/ScoreArray.h
index b3294b56f..71ea2b51a 100644
--- a/mert/ScoreArray.h
+++ b/mert/ScoreArray.h
@@ -27,52 +27,76 @@ using namespace std;
class ScoreArray
{
protected:
- scorearray_t array_;
- std::string score_type;
- size_t number_of_scores;
-
+ scorearray_t array_;
+ std::string score_type;
+ size_t number_of_scores;
+
private:
- std::string idx; // idx to identify the utterance, it can differ from the index inside the vector
+ std::string idx; // idx to identify the utterance, it can differ from the index inside the vector
+
-
public:
- ScoreArray();
-
- ~ScoreArray(){};
-
- inline void clear() { array_.clear(); }
-
- inline std::string getIndex(){ return idx; }
- inline void setIndex(const std::string& value){ idx=value; }
+ ScoreArray();
+
+ ~ScoreArray() {};
+
+ inline void clear() {
+ array_.clear();
+ }
+
+ inline std::string getIndex() {
+ return idx;
+ }
+ inline void setIndex(const std::string& value) {
+ idx=value;
+ }
// inline ScoreStats get(size_t i){ return array_.at(i); }
-
- inline ScoreStats& get(size_t i){ return array_.at(i); }
- inline const ScoreStats& get(size_t i)const{ return array_.at(i); }
-
- void add(const ScoreStats& e){ array_.push_back(e); }
-
- void merge(ScoreArray& e);
-
- inline std::string name() const{ return score_type; };
- inline void name(std::string &sctype){ score_type = sctype; };
-
- inline size_t size(){ return array_.size(); }
- inline size_t NumberOfScores() const{ return number_of_scores; }
- inline void NumberOfScores(size_t v){ number_of_scores = v; }
-
- void savetxt(ofstream& outFile, const std::string& sctype);
- void savebin(ofstream& outFile, const std::string& sctype);
- void save(ofstream& outFile, const std::string& sctype, bool bin=false);
- void save(const std::string &file, const std::string& sctype, bool bin=false);
- inline void save(const std::string& sctype, bool bin=false){ save("/dev/stdout", sctype, bin); }
-
- void loadtxt(ifstream& inFile, size_t n);
- void loadbin(ifstream& inFile, size_t n);
- void load(ifstream& inFile);
- void load(const std::string &file);
-
- bool check_consistency();
+
+ inline ScoreStats& get(size_t i) {
+ return array_.at(i);
+ }
+ inline const ScoreStats& get(size_t i)const {
+ return array_.at(i);
+ }
+
+ void add(const ScoreStats& e) {
+ array_.push_back(e);
+ }
+
+ void merge(ScoreArray& e);
+
+ inline std::string name() const {
+ return score_type;
+ };
+ inline void name(std::string &sctype) {
+ score_type = sctype;
+ };
+
+ inline size_t size() {
+ return array_.size();
+ }
+ inline size_t NumberOfScores() const {
+ return number_of_scores;
+ }
+ inline void NumberOfScores(size_t v) {
+ number_of_scores = v;
+ }
+
+ void savetxt(ofstream& outFile, const std::string& sctype);
+ void savebin(ofstream& outFile, const std::string& sctype);
+ void save(ofstream& outFile, const std::string& sctype, bool bin=false);
+ void save(const std::string &file, const std::string& sctype, bool bin=false);
+ inline void save(const std::string& sctype, bool bin=false) {
+ save("/dev/stdout", sctype, bin);
+ }
+
+ void loadtxt(ifstream& inFile, size_t n);
+ void loadbin(ifstream& inFile, size_t n);
+ void load(ifstream& inFile);
+ void load(const std::string &file);
+
+ bool check_consistency();
};