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:
authorHieu Hoang <hieuhoang@gmail.com>2013-11-19 22:52:15 +0400
committerHieu Hoang <hieuhoang@gmail.com>2013-11-19 22:52:15 +0400
commitc2ffc022eab102fc2e1593c435c1eaa389583278 (patch)
tree528d30540bde0dce46349b1e9a3f0cd122afcbbf /moses/Util.h
parent22864c2b4b154b2c69518bf773fe73f4c557af0a (diff)
replace CHECK with UTIL_THROW_IF in Moses
Diffstat (limited to 'moses/Util.h')
-rw-r--r--moses/Util.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/moses/Util.h b/moses/Util.h
index 422449d43..3345dc3f3 100644
--- a/moses/Util.h
+++ b/moses/Util.h
@@ -28,11 +28,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#include <string>
#include <vector>
#include <cmath>
+#include <cassert>
#include <limits>
#include <map>
#include <cstdlib>
#include <cstring>
-#include "util/check.hh"
+#include "util/exception.hh"
#include "TypeDef.h"
namespace Moses
@@ -314,7 +315,8 @@ inline float FloorScore(float logScore)
inline float CalcTranslationScore(const std::vector<float> &probVector,
const std::vector<float> &weightT)
{
- CHECK(weightT.size()==probVector.size());
+ UTIL_THROW_IF(weightT.size() != probVector.size(), util::Exception,
+ "Weight and score vector sizes not the same");
float rv=0.0;
for(float const *sb=&probVector[0],*se=sb+probVector.size(),*wb=&weightT[0];
sb!=se; ++sb, ++wb)
@@ -371,7 +373,7 @@ inline void ShrinkToFit(T& v)
{
if(v.capacity()>v.size())
T(v).swap(v);
- CHECK(v.capacity()==v.size());
+ assert(v.capacity()==v.size());
}
bool FileExists(const std::string& filePath);