diff options
Diffstat (limited to 'moses/TranslationModel/DynSAInclude')
-rw-r--r-- | moses/TranslationModel/DynSAInclude/FileHandler.cpp | 8 | ||||
-rw-r--r-- | moses/TranslationModel/DynSAInclude/RandLMFilter.h | 10 | ||||
-rw-r--r-- | moses/TranslationModel/DynSAInclude/onlineRLM.h | 6 | ||||
-rw-r--r-- | moses/TranslationModel/DynSAInclude/params.cpp | 4 | ||||
-rw-r--r-- | moses/TranslationModel/DynSAInclude/quantizer.h | 6 | ||||
-rw-r--r-- | moses/TranslationModel/DynSAInclude/vocab.cpp | 2 |
6 files changed, 18 insertions, 18 deletions
diff --git a/moses/TranslationModel/DynSAInclude/FileHandler.cpp b/moses/TranslationModel/DynSAInclude/FileHandler.cpp index 4e92ad907..5f9cd7c45 100644 --- a/moses/TranslationModel/DynSAInclude/FileHandler.cpp +++ b/moses/TranslationModel/DynSAInclude/FileHandler.cpp @@ -71,13 +71,13 @@ bool FileHandler::setStreamBuffer(bool checkExists) { // redirect stdin or stdout if necesary if (path_ == FileHandler::kStdInDescriptor) { - UTIL_THROW_IF2(flags_ & std::ios::in == 0, - "Incorrect flags: " << flags_); + UTIL_THROW_IF2(flags_ & std::ios::in == 0, + "Incorrect flags: " << flags_); std::streambuf* sb = std::cin.rdbuf(); buffer_ = sb; } else if (path_ == FileHandler::kStdOutDescriptor) { - UTIL_THROW_IF2(flags_ & std::ios::out == 0, - "Incorrect flags: " << flags_); + UTIL_THROW_IF2(flags_ & std::ios::out == 0, + "Incorrect flags: " << flags_); std::streambuf* sb = std::cout.rdbuf(); buffer_ = sb; } else { diff --git a/moses/TranslationModel/DynSAInclude/RandLMFilter.h b/moses/TranslationModel/DynSAInclude/RandLMFilter.h index e8defb110..19566ff40 100644 --- a/moses/TranslationModel/DynSAInclude/RandLMFilter.h +++ b/moses/TranslationModel/DynSAInclude/RandLMFilter.h @@ -62,9 +62,9 @@ public: address_mask_ = full_mask_ >> first_bit_; } Filter(FileHandler* fin, bool loaddata = true) : data_(NULL) { - assert(loadHeader(fin)); + assert(loadHeader(fin)); if (loaddata) - assert(loadData(fin)); + assert(loadData(fin)); } virtual ~Filter() { delete[] data_; @@ -80,7 +80,7 @@ public: } // read / write functions inline bool read(uint64_t address, T* value) { - assert(address <= addresses_); + assert(address <= addresses_); // copy address to 'value' uint64_t data_bit = address * width_; uint32_t data_cell = (data_bit >> log_cell_width_); // % cells_; @@ -102,7 +102,7 @@ public: return true; } inline T read(uint64_t address) { - assert(address <= addresses_); + assert(address <= addresses_); // return value at address T value = 0; uint64_t data_bit = address * width_; @@ -124,7 +124,7 @@ public: return value; } inline bool write(uint64_t address, T value) { - assert(address <= addresses_); + assert(address <= addresses_); assert(log2(value) <= width_); // write 'value' to address uint64_t data_bit = address * width_; diff --git a/moses/TranslationModel/DynSAInclude/onlineRLM.h b/moses/TranslationModel/DynSAInclude/onlineRLM.h index 929602399..cd9ed8a87 100644 --- a/moses/TranslationModel/DynSAInclude/onlineRLM.h +++ b/moses/TranslationModel/DynSAInclude/onlineRLM.h @@ -148,8 +148,8 @@ int OnlineRLM<T>::query(const wordID_t* IDs, int len) //markQueried(hpdItr); // mark this event as "hit" value -= ((value & this->hitMask_) != 0) ? this->hitMask_ : 0; // check for previous hit marks } else { - UTIL_THROW_IF2(filterIdx >= this->cells_, - "Out of bound: " << filterIdx); + UTIL_THROW_IF2(filterIdx >= this->cells_, + "Out of bound: " << filterIdx); //markQueried(filterIdx); } } @@ -341,7 +341,7 @@ const void* OnlineRLM<T>::getContext(const wordID_t* ngram, int len) int dummy(0); float**addresses = new float*[len]; // only interested in addresses of cache UTIL_THROW_IF2(cache_->getCache2(ngram, len, &addresses[0], &dummy) != len, - "Error"); + "Error"); // return address of cache node float *addr0 = addresses[0]; diff --git a/moses/TranslationModel/DynSAInclude/params.cpp b/moses/TranslationModel/DynSAInclude/params.cpp index 27cf06a51..4696258f8 100644 --- a/moses/TranslationModel/DynSAInclude/params.cpp +++ b/moses/TranslationModel/DynSAInclude/params.cpp @@ -65,10 +65,10 @@ bool Parameters::loadParams(int argc, char ** argv) if( getValueType(param) == kBoolValue ) { jumpBy = 1; UTIL_THROW_IF2(!setParamValue(param, kTrueValue), - "Couldn't set parameter " << param); + "Couldn't set parameter " << param); } else { //not of type bool so must have corresponding value UTIL_THROW_IF2(i+1 >= argc, - "Out of bound error: " << i+1); + "Out of bound error: " << i+1); jumpBy = 2; std::string val = argv[i+1]; diff --git a/moses/TranslationModel/DynSAInclude/quantizer.h b/moses/TranslationModel/DynSAInclude/quantizer.h index 002535dd0..6dbcc3cc4 100644 --- a/moses/TranslationModel/DynSAInclude/quantizer.h +++ b/moses/TranslationModel/DynSAInclude/quantizer.h @@ -17,7 +17,7 @@ class LogQtizer { public: LogQtizer(float i): base_(pow(2, 1 / i)) { - UTIL_THROW_IF2(base_ <= 1, "Can't calculate log base less than 1"); + UTIL_THROW_IF2(base_ <= 1, "Can't calculate log base less than 1"); max_code_ = 0; float value = 1; // code = 1 -> value = 1 for any base std::vector<float> code_to_value_vec; @@ -40,13 +40,13 @@ public: std::cerr << "Initialized quantization (size = " << max_code_ + 1 << ")" << std::endl; } LogQtizer(FileHandler* fin) { - UTIL_THROW_IF2(fin == NULL, "Null file handle"); + UTIL_THROW_IF2(fin == NULL, "Null file handle"); load(fin); } int code(float value) { // should just be: return log_b(value) UTIL_THROW_IF2(value < min_value_ || value > max_value_, - "Value " << value << " out of bound"); + "Value " << value << " out of bound"); // but binary search removes errors due to floor operator above int code = static_cast<int>(std::lower_bound(code_to_value_, code_to_value_+ max_code_, diff --git a/moses/TranslationModel/DynSAInclude/vocab.cpp b/moses/TranslationModel/DynSAInclude/vocab.cpp index 1e6c92203..b717f533c 100644 --- a/moses/TranslationModel/DynSAInclude/vocab.cpp +++ b/moses/TranslationModel/DynSAInclude/vocab.cpp @@ -134,7 +134,7 @@ bool Vocab::Load(FileHandler* vcbin, const FactorDirection& direction, if (id == 0 && word != GetkOOVWord()) id = m_ids2words.size() + 1; // assign ids sequentially starting from 1 UTIL_THROW_IF2(m_ids2words.count(id) != 0 || m_words2ids.count(word) != 0, - "Error"); + "Error"); m_ids2words[id] = word; m_words2ids[word] = id; |