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/FeatureArray.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/FeatureArray.h')
-rw-r--r--mert/FeatureArray.h102
1 files changed, 63 insertions, 39 deletions
diff --git a/mert/FeatureArray.h b/mert/FeatureArray.h
index d08bf54db..f707d0d98 100644
--- a/mert/FeatureArray.h
+++ b/mert/FeatureArray.h
@@ -27,47 +27,71 @@ using namespace std;
class FeatureArray
{
protected:
- featarray_t array_;
- size_t number_of_features;
- std::string features;
-
+ featarray_t array_;
+ size_t number_of_features;
+ std::string features;
+
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:
- FeatureArray();
-
- ~FeatureArray(){};
-
- inline void clear() { array_.clear(); }
-
- inline std::string getIndex(){ return idx; }
- inline void setIndex(const std::string & value){ idx=value; }
-
- inline FeatureStats& get(size_t i){ return array_.at(i); }
- inline const FeatureStats& get(size_t i)const{ return array_.at(i); }
- void add(FeatureStats e){ array_.push_back(e); }
-
- void merge(FeatureArray& e);
-
- inline size_t size(){ return array_.size(); }
- inline size_t NumberOfFeatures() const{ return number_of_features; }
- inline void NumberOfFeatures(size_t v){ number_of_features = v; }
- inline std::string Features() const{ return features; }
- inline void Features(const std::string f){ features = f; }
-
- void savetxt(ofstream& outFile);
- void savebin(ofstream& outFile);
- void save(ofstream& outFile, bool bin=false);
- void save(const std::string &file, bool bin=false);
- inline void save(bool bin=false){ save("/dev/stdout",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();
+ FeatureArray();
+
+ ~FeatureArray() {};
+
+ inline void clear() {
+ array_.clear();
+ }
+
+ inline std::string getIndex() {
+ return idx;
+ }
+ inline void setIndex(const std::string & value) {
+ idx=value;
+ }
+
+ inline FeatureStats& get(size_t i) {
+ return array_.at(i);
+ }
+ inline const FeatureStats& get(size_t i)const {
+ return array_.at(i);
+ }
+ void add(FeatureStats e) {
+ array_.push_back(e);
+ }
+
+ void merge(FeatureArray& e);
+
+ inline size_t size() {
+ return array_.size();
+ }
+ inline size_t NumberOfFeatures() const {
+ return number_of_features;
+ }
+ inline void NumberOfFeatures(size_t v) {
+ number_of_features = v;
+ }
+ inline std::string Features() const {
+ return features;
+ }
+ inline void Features(const std::string f) {
+ features = f;
+ }
+
+ void savetxt(ofstream& outFile);
+ void savebin(ofstream& outFile);
+ void save(ofstream& outFile, bool bin=false);
+ void save(const std::string &file, bool bin=false);
+ inline void save(bool bin=false) {
+ save("/dev/stdout",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();
};