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/ScoreStats.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/ScoreStats.h')
-rw-r--r--mert/ScoreStats.h107
1 files changed, 64 insertions, 43 deletions
diff --git a/mert/ScoreStats.h b/mert/ScoreStats.h
index 147fcef18..9ceee4c6b 100644
--- a/mert/ScoreStats.h
+++ b/mert/ScoreStats.h
@@ -26,51 +26,72 @@ using namespace std;
class ScoreStats
{
private:
- scorestats_t array_;
- size_t entries_;
- size_t available_;
-
+ scorestats_t array_;
+ size_t entries_;
+ size_t available_;
+
public:
- ScoreStats();
+ ScoreStats();
ScoreStats(const size_t size);
- ScoreStats(const ScoreStats &stats);
- ScoreStats(std::string &theString);
- ScoreStats& operator=(const ScoreStats &stats);
-
- ~ScoreStats();
-
- bool isfull(){return (entries_ < available_)?0:1; }
- void expand();
- void add(ScoreStatsType v);
-
- inline void clear() { memset((void*) array_,0,scorebytes_); }
-
- inline ScoreStatsType get(size_t i){ return array_[i]; }
- inline ScoreStatsType get(size_t i)const{ return array_[i]; }
- inline scorestats_t getArray() const { return array_; }
-
- void set(std::string &theString);
-
- inline size_t bytes() const{ return scorebytes_; }
- inline size_t size() const{ return entries_; }
- inline size_t available() const{ return available_; }
-
- void savetxt(const std::string &file);
- void savetxt(ofstream& outFile);
- void savebin(ofstream& outFile);
- inline void savetxt(){ savetxt("/dev/stdout"); }
-
-
-
- void loadtxt(const std::string &file);
- void loadtxt(ifstream& inFile);
- void loadbin(ifstream& inFile);
-
-
- inline void reset(){ entries_ = 0; clear(); }
-
- /**write the whole object to a stream*/
- friend ostream& operator<<(ostream& o, const ScoreStats& e);
+ ScoreStats(const ScoreStats &stats);
+ ScoreStats(std::string &theString);
+ ScoreStats& operator=(const ScoreStats &stats);
+
+ ~ScoreStats();
+
+ bool isfull() {
+ return (entries_ < available_)?0:1;
+ }
+ void expand();
+ void add(ScoreStatsType v);
+
+ inline void clear() {
+ memset((void*) array_,0,scorebytes_);
+ }
+
+ inline ScoreStatsType get(size_t i) {
+ return array_[i];
+ }
+ inline ScoreStatsType get(size_t i)const {
+ return array_[i];
+ }
+ inline scorestats_t getArray() const {
+ return array_;
+ }
+
+ void set(std::string &theString);
+
+ inline size_t bytes() const {
+ return scorebytes_;
+ }
+ inline size_t size() const {
+ return entries_;
+ }
+ inline size_t available() const {
+ return available_;
+ }
+
+ void savetxt(const std::string &file);
+ void savetxt(ofstream& outFile);
+ void savebin(ofstream& outFile);
+ inline void savetxt() {
+ savetxt("/dev/stdout");
+ }
+
+
+
+ void loadtxt(const std::string &file);
+ void loadtxt(ifstream& inFile);
+ void loadbin(ifstream& inFile);
+
+
+ inline void reset() {
+ entries_ = 0;
+ clear();
+ }
+
+ /**write the whole object to a stream*/
+ friend ostream& operator<<(ostream& o, const ScoreStats& e);
};