diff options
author | nicolabertoldi <nicolabertoldi@1f5c12ca-751b-0410-a591-d2e778427230> | 2008-06-05 15:42:00 +0400 |
---|---|---|
committer | nicolabertoldi <nicolabertoldi@1f5c12ca-751b-0410-a591-d2e778427230> | 2008-06-05 15:42:00 +0400 |
commit | 8e96e68476e4e07108a6e83a3cd54c67858d8c18 (patch) | |
tree | 8d51ff87fdf178719892b9919ce2a717729ce9b6 /mert | |
parent | 930e67c5e305fb15c234f24fc58992f0bc062d2e (diff) |
overall change of a variable name: array_ instead of array2_
git-svn-id: https://mosesdecoder.svn.sourceforge.net/svnroot/mosesdecoder/trunk@1823 1f5c12ca-751b-0410-a591-d2e778427230
Diffstat (limited to 'mert')
-rw-r--r-- | mert/FeatureStats.cpp | 30 | ||||
-rw-r--r-- | mert/FeatureStats.h | 10 |
2 files changed, 20 insertions, 20 deletions
diff --git a/mert/FeatureStats.cpp b/mert/FeatureStats.cpp index bbceff135..395778d0c 100644 --- a/mert/FeatureStats.cpp +++ b/mert/FeatureStats.cpp @@ -16,28 +16,28 @@ FeatureStats::FeatureStats() { available_ = AVAILABLE_; entries_ = 0; - array2_ = new FeatureStatsType[available_]; + array_ = new FeatureStatsType[available_]; }; FeatureStats::~FeatureStats() { - delete array2_; + delete array_; }; FeatureStats::FeatureStats(const FeatureStats &stats) { available_ = stats.available(); entries_ = stats.size(); - array2_ = new FeatureStatsType[available_]; - memcpy(array2_,stats.getArray(),bytes_); + array_ = new FeatureStatsType[available_]; + memcpy(array_,stats.getArray(),bytes_); }; FeatureStats::FeatureStats(const size_t size) { available_ = size; entries_ = size; - array2_ = new FeatureStatsType[available_]; - memset(array2_,0,bytes_); + array_ = new FeatureStatsType[available_]; + memset(array_,0,bytes_); }; @@ -50,15 +50,15 @@ void FeatureStats::expand() { available_*=2; featstats_t t_ = new FeatureStatsType[available_]; - memcpy(t_,array2_,bytes_); - delete array2_; - array2_=t_; + memcpy(t_,array_,bytes_); + delete array_; + array_=t_; } void FeatureStats::add(FeatureStatsType v) { if (isfull()) expand(); - array2_[entries_++]=v; + array_[entries_++]=v; } void FeatureStats::set(std::string &theString) @@ -75,7 +75,7 @@ void FeatureStats::set(std::string &theString) void FeatureStats::loadbin(std::ifstream& inFile) { - inFile.read((char*) array2_, bytes_); + inFile.read((char*) array_, bytes_); } void FeatureStats::loadtxt(std::ifstream& inFile) @@ -113,16 +113,16 @@ void FeatureStats::savetxt(std::ofstream& outFile) void FeatureStats::savebin(std::ofstream& outFile) { - outFile.write((char*) array2_, bytes_); + outFile.write((char*) array_, bytes_); } FeatureStats& FeatureStats::operator=(const FeatureStats &stats) { - delete array2_; + delete array_; available_ = stats.available(); entries_ = stats.size(); - array2_ = new FeatureStatsType[available_]; - memcpy(array2_,stats.getArray(),bytes_); + array_ = new FeatureStatsType[available_]; + memcpy(array_,stats.getArray(),bytes_); return *this; } diff --git a/mert/FeatureStats.h b/mert/FeatureStats.h index 804b0b828..e6526a526 100644 --- a/mert/FeatureStats.h +++ b/mert/FeatureStats.h @@ -25,7 +25,7 @@ using namespace std; class FeatureStats { private: - featstats_t array2_; + featstats_t array_; size_t entries_; size_t available_; @@ -42,11 +42,11 @@ public: void expand(); void add(FeatureStatsType v); - inline void clear() { memset((void*) array2_,0,bytes_); } + inline void clear() { memset((void*) array_,0,bytes_); } - inline FeatureStatsType get(size_t i){ return array2_[i]; } - inline FeatureStatsType get(size_t i)const{ return array2_[i]; } - inline featstats_t getArray() const { return array2_; } + inline FeatureStatsType get(size_t i){ return array_[i]; } + inline FeatureStatsType get(size_t i)const{ return array_[i]; } + inline featstats_t getArray() const { return array_; } void set(std::string &theString); |