diff options
author | Kenneth Heafield <github@kheafield.com> | 2011-11-18 16:07:41 +0400 |
---|---|---|
committer | Kenneth Heafield <github@kheafield.com> | 2011-11-18 16:07:41 +0400 |
commit | bf78f7a1acbadbab8da23502d96eb382b60a6b6e (patch) | |
tree | b3ca4bb831bf5f8ea6cd53bbadff2749faa8bca4 /mert/Point.cpp | |
parent | 1192e6f2b045e00fe74060277e7a797a02b53075 (diff) |
Replace assert with CHECK until people learn how to use assert properly
Diffstat (limited to 'mert/Point.cpp')
-rw-r--r-- | mert/Point.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/mert/Point.cpp b/mert/Point.cpp index 71338966a..322f10f77 100644 --- a/mert/Point.cpp +++ b/mert/Point.cpp @@ -2,7 +2,7 @@ #include <cmath> #include <cstdlib> -#include <cassert> +#include "util/check.hh" #include <limits> #include "FeatureStats.h" @@ -37,7 +37,7 @@ Point::Point(const vector<parameter_t>& init, m_max[i] = max[i]; } } else { - assert(init.size()==pdim); + CHECK(init.size()==pdim); for (unsigned int i=0; i<Point::dim; i++) { operator[](i)=init[optindices[i]]; m_min[i] = min[optindices[i]]; @@ -50,8 +50,8 @@ Point::~Point() {} void Point::Randomize() { - assert(m_min.size()==Point::dim); - assert(m_max.size()==Point::dim); + CHECK(m_min.size()==Point::dim); + CHECK(m_max.size()==Point::dim); for (unsigned int i=0; i<size(); i++) { operator[](i) = m_min[i] + (float)random()/(float)RAND_MAX * (float)(m_max[i]-m_min[i]); @@ -76,7 +76,7 @@ double Point::operator*(const FeatureStats& F) const Point Point::operator+(const Point& p2) const { - assert(p2.size() == size()); + CHECK(p2.size() == size()); Point Res(*this); for (unsigned i = 0; i < size(); i++) { Res[i] += p2[i]; @@ -88,7 +88,7 @@ Point Point::operator+(const Point& p2) const void Point::operator+=(const Point& p2) { - assert(p2.size() == size()); + CHECK(p2.size() == size()); for (unsigned i = 0; i < size(); i++) { operator[](i) += p2[i]; } |