DEBUG_SAME_INT -> DEBUG_SAME_SIZE
This commit is contained in:
@@ -239,9 +239,9 @@ const T *poison_ptr(T *&x) {
|
||||
* @param x left-hand side of the equality test
|
||||
* @param y right-hand side of the equality test
|
||||
*/
|
||||
#define DEBUG_SAME_INT(x, y) \
|
||||
#define DEBUG_SAME_SIZE(x, y) \
|
||||
DEBUG_ASSERT_MSG((x) == (y), \
|
||||
"DEBUG_SAME_INT failed: %s = %"L64"d not equal to %s = %"L64"d\n", \
|
||||
"DEBUG_SAME_SIZE failed: %s = %"L64"d not equal to %s = %"L64"d\n", \
|
||||
#x, STATIC_CAST(int64, x), #y, STATIC_CAST(int64, y))
|
||||
|
||||
#endif /* BASE_DEBUG_H */
|
||||
|
||||
@@ -30,6 +30,7 @@ void percent_indicator(const char *name, uint64 num, uint64 den) {
|
||||
VERBOSE_MSG(min_verbosity, msg_params)
|
||||
#define DEBUG_GOT_HERE(min_verbosity) \
|
||||
VERBOSE_GOT_HERE(min_verbosity)
|
||||
#define DEBUG_SAME_INT(a, b) DEBUG_SAME_SIZE(a, b)
|
||||
|
||||
#ifdef __cplusplus
|
||||
/* cc.h */
|
||||
|
||||
@@ -382,7 +382,7 @@ namespace ot {
|
||||
void PointerFreeze(const T& live_object, char *block) {
|
||||
ot__private::ZOTPointerFreezer freezer;
|
||||
freezer.Doit(live_object, block);
|
||||
DEBUG_SAME_INT(freezer.size(), ot::PointerFrozenSize(live_object));
|
||||
DEBUG_SAME_SIZE(freezer.size(), ot::PointerFrozenSize(live_object));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+29
-29
@@ -145,20 +145,20 @@ void TestRangeSet() {
|
||||
set.Union(1, 4);
|
||||
set.Union(10, 16);
|
||||
set.Union(4, 10);
|
||||
DEBUG_SAME_INT(set.size(), 1);
|
||||
DEBUG_SAME_INT(set.ranges()[0].begin, 1);
|
||||
DEBUG_SAME_INT(set.ranges()[0].end, 16);
|
||||
DEBUG_SAME_SIZE(set.size(), 1);
|
||||
DEBUG_SAME_SIZE(set.ranges()[0].begin, 1);
|
||||
DEBUG_SAME_SIZE(set.ranges()[0].end, 16);
|
||||
|
||||
set.Reset();
|
||||
DEBUG_SAME_INT(set.size(), 0);
|
||||
DEBUG_SAME_SIZE(set.size(), 0);
|
||||
set.Union(3, 7);
|
||||
set.Union(50, 100);
|
||||
set.Union(4, 8);
|
||||
DEBUG_SAME_INT(set.size(), 2);
|
||||
DEBUG_SAME_INT(set.ranges()[0].begin, 3);
|
||||
DEBUG_SAME_INT(set.ranges()[0].end, 8);
|
||||
DEBUG_SAME_INT(set.ranges()[1].begin, 50);
|
||||
DEBUG_SAME_INT(set.ranges()[1].end, 100);
|
||||
DEBUG_SAME_SIZE(set.size(), 2);
|
||||
DEBUG_SAME_SIZE(set.ranges()[0].begin, 3);
|
||||
DEBUG_SAME_SIZE(set.ranges()[0].end, 8);
|
||||
DEBUG_SAME_SIZE(set.ranges()[1].begin, 50);
|
||||
DEBUG_SAME_SIZE(set.ranges()[1].end, 100);
|
||||
|
||||
set.Reset();
|
||||
set.Union(1, 5);
|
||||
@@ -171,29 +171,29 @@ void TestRangeSet() {
|
||||
set.Union(18, 19);
|
||||
set.Union(42, 48);
|
||||
set.Union(5, 6);
|
||||
DEBUG_SAME_INT(set.size(), 1);
|
||||
DEBUG_SAME_INT(set.ranges()[0].begin, 1);
|
||||
DEBUG_SAME_INT(set.ranges()[0].end, 79);
|
||||
DEBUG_SAME_SIZE(set.size(), 1);
|
||||
DEBUG_SAME_SIZE(set.ranges()[0].begin, 1);
|
||||
DEBUG_SAME_SIZE(set.ranges()[0].end, 79);
|
||||
set.Union(-55, -52);
|
||||
set.Union(500, 600);
|
||||
set.Union(800, 900);
|
||||
set.Union(550, 801);
|
||||
set.Union(-400, -200);
|
||||
set.Union(6, 81);
|
||||
DEBUG_SAME_INT(set.ranges().size(), 4);
|
||||
DEBUG_SAME_INT(set[0].begin, -400);
|
||||
DEBUG_SAME_INT(set[0].end, -200);
|
||||
DEBUG_SAME_INT(set[1].begin, -55);
|
||||
DEBUG_SAME_INT(set[1].end, -52);
|
||||
DEBUG_SAME_INT(set[2].begin, 1);
|
||||
DEBUG_SAME_INT(set[2].end, 81);
|
||||
DEBUG_SAME_INT(set[3].begin, 500);
|
||||
DEBUG_SAME_INT(set[3].end, 900);
|
||||
DEBUG_SAME_SIZE(set.ranges().size(), 4);
|
||||
DEBUG_SAME_SIZE(set[0].begin, -400);
|
||||
DEBUG_SAME_SIZE(set[0].end, -200);
|
||||
DEBUG_SAME_SIZE(set[1].begin, -55);
|
||||
DEBUG_SAME_SIZE(set[1].end, -52);
|
||||
DEBUG_SAME_SIZE(set[2].begin, 1);
|
||||
DEBUG_SAME_SIZE(set[2].end, 81);
|
||||
DEBUG_SAME_SIZE(set[3].begin, 500);
|
||||
DEBUG_SAME_SIZE(set[3].end, 900);
|
||||
set.Reset();
|
||||
set.Union(3, 5);
|
||||
set.Union(3, 5);
|
||||
set.Union(3, 5);
|
||||
DEBUG_SAME_INT(set.size(), 1);
|
||||
DEBUG_SAME_SIZE(set.size(), 1);
|
||||
}
|
||||
|
||||
void TestQueue() {
|
||||
@@ -206,17 +206,17 @@ void TestQueue() {
|
||||
q.Add(5);
|
||||
*q.Add() = 9;
|
||||
DEBUG_ASSERT(!q.is_empty());
|
||||
DEBUG_SAME_INT(q.top(), 3); q.Pop();
|
||||
DEBUG_SAME_INT(q.top(), 1); q.Pop();
|
||||
DEBUG_SAME_INT(q.top(), 4); q.PopOnly();
|
||||
DEBUG_SAME_INT(q.Pop(), 1);
|
||||
DEBUG_SAME_INT(q.Pop(), 5);
|
||||
DEBUG_SAME_SIZE(q.top(), 3); q.Pop();
|
||||
DEBUG_SAME_SIZE(q.top(), 1); q.Pop();
|
||||
DEBUG_SAME_SIZE(q.top(), 4); q.PopOnly();
|
||||
DEBUG_SAME_SIZE(q.Pop(), 1);
|
||||
DEBUG_SAME_SIZE(q.Pop(), 5);
|
||||
DEBUG_ASSERT(!q.is_empty());
|
||||
DEBUG_SAME_INT(q.top(), 9); q.Pop();
|
||||
DEBUG_SAME_SIZE(q.top(), 9); q.Pop();
|
||||
DEBUG_ASSERT(q.is_empty());
|
||||
*q.Add() = 551;
|
||||
DEBUG_ASSERT(!q.is_empty());
|
||||
DEBUG_SAME_INT(q.top(), 551); q.PopOnly();
|
||||
DEBUG_SAME_SIZE(q.top(), 551); q.PopOnly();
|
||||
DEBUG_ASSERT(q.is_empty());
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -35,7 +35,7 @@ namespace la {
|
||||
* Finds the Euclidean distance squared between two vectors.
|
||||
*/
|
||||
inline double DistanceSqEuclidean(const Vector& x, const Vector& y) {
|
||||
DEBUG_SAME_INT(x.length(), y.length());
|
||||
DEBUG_SAME_SIZE(x.length(), y.length());
|
||||
return DistanceSqEuclidean(x.length(), x.ptr(), y.ptr());
|
||||
}
|
||||
/**
|
||||
|
||||
+41
-41
@@ -11,12 +11,12 @@
|
||||
#include "col/arraylist.h"
|
||||
|
||||
#define DEBUG_VECSIZE(a, b) \
|
||||
DEBUG_SAME_INT((a).length(), (b).length())
|
||||
DEBUG_SAME_SIZE((a).length(), (b).length())
|
||||
#define DEBUG_MATSIZE(a, b) \
|
||||
DEBUG_SAME_INT((a).n_rows(), (b).n_rows());\
|
||||
DEBUG_SAME_INT((a).n_cols(), (b).n_cols())
|
||||
DEBUG_SAME_SIZE((a).n_rows(), (b).n_rows());\
|
||||
DEBUG_SAME_SIZE((a).n_cols(), (b).n_cols())
|
||||
#define DEBUG_MATSQUARE(a) \
|
||||
DEBUG_SAME_INT((a).n_rows(), (a).n_cols())
|
||||
DEBUG_SAME_SIZE((a).n_rows(), (a).n_cols())
|
||||
|
||||
/*
|
||||
* TODO: this could an overhaul; LAPACK failures may mean either input
|
||||
@@ -276,7 +276,7 @@ namespace la {
|
||||
* (\f$\vec{x} \cdot \vec{y}\f$).
|
||||
*/
|
||||
inline double Dot(const Vector &x, const Vector &y) {
|
||||
DEBUG_SAME_INT(x.length(), y.length());
|
||||
DEBUG_SAME_SIZE(x.length(), y.length());
|
||||
return Dot(x.length(), x.ptr(), y.ptr());
|
||||
}
|
||||
|
||||
@@ -305,7 +305,7 @@ namespace la {
|
||||
* @param X the matrix to scale
|
||||
*/
|
||||
inline void ScaleRows(const Vector& d, Matrix *X) {
|
||||
DEBUG_SAME_INT(d.length(), X->n_rows());
|
||||
DEBUG_SAME_SIZE(d.length(), X->n_rows());
|
||||
ScaleRows(d.length(), X->n_cols(), d.ptr(), X->ptr());
|
||||
}
|
||||
|
||||
@@ -314,7 +314,7 @@ namespace la {
|
||||
* (\f$\vec{y} \gets \alpha \vec{x}\f$).
|
||||
*/
|
||||
inline void ScaleOverwrite(double alpha, const Vector &x, Vector *y) {
|
||||
DEBUG_SAME_INT(x.length(), y->length());
|
||||
DEBUG_SAME_SIZE(x.length(), y->length());
|
||||
ScaleOverwrite(x.length(), alpha, x.ptr(), y->ptr());
|
||||
}
|
||||
/**
|
||||
@@ -322,8 +322,8 @@ namespace la {
|
||||
* (\f$Y \gets \alpha X\f$).
|
||||
*/
|
||||
inline void ScaleOverwrite(double alpha, const Matrix &X, Matrix *Y) {
|
||||
DEBUG_SAME_INT(X.n_rows(), Y->n_rows());
|
||||
DEBUG_SAME_INT(X.n_cols(), Y->n_cols());
|
||||
DEBUG_SAME_SIZE(X.n_rows(), Y->n_rows());
|
||||
DEBUG_SAME_SIZE(X.n_cols(), Y->n_cols());
|
||||
ScaleOverwrite(X.n_elements(), alpha, X.ptr(), Y->ptr());
|
||||
}
|
||||
|
||||
@@ -351,7 +351,7 @@ namespace la {
|
||||
* (\f$\vec{y} \gets \vec{y} + \alpha \vec{x}\f$).
|
||||
*/
|
||||
inline void AddExpert(double alpha, const Vector &x, Vector *y) {
|
||||
DEBUG_SAME_INT(x.length(), y->length());
|
||||
DEBUG_SAME_SIZE(x.length(), y->length());
|
||||
AddExpert(x.length(), alpha, x.ptr(), y->ptr());
|
||||
}
|
||||
/**
|
||||
@@ -359,8 +359,8 @@ namespace la {
|
||||
* (\f$Y \gets Y + \alpha X\f$).
|
||||
*/
|
||||
inline void AddExpert(double alpha, const Matrix &X, Matrix *Y) {
|
||||
DEBUG_SAME_INT(X.n_rows(), Y->n_rows());
|
||||
DEBUG_SAME_INT(X.n_cols(), Y->n_cols());
|
||||
DEBUG_SAME_SIZE(X.n_rows(), Y->n_rows());
|
||||
DEBUG_SAME_SIZE(X.n_cols(), Y->n_cols());
|
||||
AddExpert(X.n_elements(), alpha, X.ptr(), Y->ptr());
|
||||
}
|
||||
|
||||
@@ -371,7 +371,7 @@ namespace la {
|
||||
* (\f$\vec{y} \gets \vec{y} + \vec{x}\f$);
|
||||
*/
|
||||
inline void AddTo(const Vector &x, Vector *y) {
|
||||
DEBUG_SAME_INT(x.length(), y->length());
|
||||
DEBUG_SAME_SIZE(x.length(), y->length());
|
||||
AddTo(x.length(), x.ptr(), y->ptr());
|
||||
}
|
||||
/**
|
||||
@@ -379,8 +379,8 @@ namespace la {
|
||||
* (\f$Y \gets Y + X\f$);
|
||||
*/
|
||||
inline void AddTo(const Matrix &X, Matrix *Y) {
|
||||
DEBUG_SAME_INT(X.n_rows(), Y->n_rows());
|
||||
DEBUG_SAME_INT(X.n_cols(), Y->n_cols());
|
||||
DEBUG_SAME_SIZE(X.n_rows(), Y->n_rows());
|
||||
DEBUG_SAME_SIZE(X.n_cols(), Y->n_cols());
|
||||
AddTo(X.n_elements(), X.ptr(), Y->ptr());
|
||||
}
|
||||
|
||||
@@ -389,8 +389,8 @@ namespace la {
|
||||
* (\f$\vec{z} \gets \vec{y} + \vec{x}\f$).
|
||||
*/
|
||||
inline void AddOverwrite(const Vector &x, const Vector &y, Vector *z) {
|
||||
DEBUG_SAME_INT(x.length(), y.length());
|
||||
DEBUG_SAME_INT(z->length(), y.length());
|
||||
DEBUG_SAME_SIZE(x.length(), y.length());
|
||||
DEBUG_SAME_SIZE(z->length(), y.length());
|
||||
AddOverwrite(x.length(), x.ptr(), y.ptr(), z->ptr());
|
||||
}
|
||||
/**
|
||||
@@ -398,10 +398,10 @@ namespace la {
|
||||
* (\f$Z \gets Y + X\f$).
|
||||
*/
|
||||
inline void AddOverwrite(const Matrix &X, const Matrix &Y, Matrix *Z) {
|
||||
DEBUG_SAME_INT(X.n_rows(), Y.n_rows());
|
||||
DEBUG_SAME_INT(X.n_cols(), Y.n_cols());
|
||||
DEBUG_SAME_INT(Z->n_rows(), Y.n_rows());
|
||||
DEBUG_SAME_INT(Z->n_cols(), Y.n_cols());
|
||||
DEBUG_SAME_SIZE(X.n_rows(), Y.n_rows());
|
||||
DEBUG_SAME_SIZE(X.n_cols(), Y.n_cols());
|
||||
DEBUG_SAME_SIZE(Z->n_rows(), Y.n_rows());
|
||||
DEBUG_SAME_SIZE(Z->n_cols(), Y.n_cols());
|
||||
AddOverwrite(X.n_elements(), X.ptr(), Y.ptr(), Z->ptr());
|
||||
}
|
||||
|
||||
@@ -429,7 +429,7 @@ namespace la {
|
||||
* (\f$\vec{y} \gets \vec{y} - \vec{x}\f$).
|
||||
*/
|
||||
inline void SubFrom(const Vector &x, Vector *y) {
|
||||
DEBUG_SAME_INT(x.length(), y->length());
|
||||
DEBUG_SAME_SIZE(x.length(), y->length());
|
||||
SubFrom(x.length(), x.ptr(), y->ptr());
|
||||
}
|
||||
/**
|
||||
@@ -437,8 +437,8 @@ namespace la {
|
||||
* (\f$Y \gets Y - X\f$).
|
||||
*/
|
||||
inline void SubFrom(const Matrix &X, Matrix *Y) {
|
||||
DEBUG_SAME_INT(X.n_rows(), Y->n_rows());
|
||||
DEBUG_SAME_INT(X.n_cols(), Y->n_cols());
|
||||
DEBUG_SAME_SIZE(X.n_rows(), Y->n_rows());
|
||||
DEBUG_SAME_SIZE(X.n_cols(), Y->n_cols());
|
||||
SubFrom(X.n_elements(), X.ptr(), Y->ptr());
|
||||
}
|
||||
|
||||
@@ -447,8 +447,8 @@ namespace la {
|
||||
* (\f$\vec{z} \gets \vec{y} - \vec{x}\f$).
|
||||
*/
|
||||
inline void SubOverwrite(const Vector &x, const Vector &y, Vector *z) {
|
||||
DEBUG_SAME_INT(x.length(), y.length());
|
||||
DEBUG_SAME_INT(z->length(), y.length());
|
||||
DEBUG_SAME_SIZE(x.length(), y.length());
|
||||
DEBUG_SAME_SIZE(z->length(), y.length());
|
||||
SubOverwrite(x.length(), x.ptr(), y.ptr(), z->ptr());
|
||||
}
|
||||
/**
|
||||
@@ -456,10 +456,10 @@ namespace la {
|
||||
* (\f$Z \gets Y - X\f$).
|
||||
*/
|
||||
inline void SubOverwrite(const Matrix &X, const Matrix &Y, Matrix *Z) {
|
||||
DEBUG_SAME_INT(X.n_rows(), Y.n_rows());
|
||||
DEBUG_SAME_INT(X.n_cols(), Y.n_cols());
|
||||
DEBUG_SAME_INT(Z->n_rows(), Y.n_rows());
|
||||
DEBUG_SAME_INT(Z->n_cols(), Y.n_cols());
|
||||
DEBUG_SAME_SIZE(X.n_rows(), Y.n_rows());
|
||||
DEBUG_SAME_SIZE(X.n_cols(), Y.n_cols());
|
||||
DEBUG_SAME_SIZE(Z->n_rows(), Y.n_rows());
|
||||
DEBUG_SAME_SIZE(Z->n_cols(), Y.n_cols());
|
||||
SubOverwrite(X.n_elements(), X.ptr(), Y.ptr(), Z->ptr());
|
||||
}
|
||||
|
||||
@@ -508,8 +508,8 @@ namespace la {
|
||||
* (\f$Y \gets X'\f$).
|
||||
*/
|
||||
inline void TransposeOverwrite(const Matrix &X, Matrix *Y) {
|
||||
DEBUG_SAME_INT(X.n_rows(), Y->n_cols());
|
||||
DEBUG_SAME_INT(X.n_cols(), Y->n_rows());
|
||||
DEBUG_SAME_SIZE(X.n_rows(), Y->n_cols());
|
||||
DEBUG_SAME_SIZE(X.n_cols(), Y->n_rows());
|
||||
index_t nr = X.n_rows();
|
||||
index_t nc = X.n_cols();
|
||||
for (index_t r = 0; r < nr; r++) {
|
||||
@@ -546,8 +546,8 @@ namespace la {
|
||||
double alpha, const Matrix &A, const Vector &x,
|
||||
double beta, Vector *y) {
|
||||
DEBUG_ASSERT(x.ptr() != y->ptr());
|
||||
DEBUG_SAME_INT(A.n_cols(), x.length());
|
||||
DEBUG_SAME_INT(A.n_rows(), y->length());
|
||||
DEBUG_SAME_SIZE(A.n_cols(), x.length());
|
||||
DEBUG_SAME_SIZE(A.n_rows(), y->length());
|
||||
F77_FUNC(dgemv)("N", A.n_rows(), A.n_cols(),
|
||||
alpha, A.ptr(), A.n_rows(), x.ptr(), 1,
|
||||
beta, y->ptr(), 1);
|
||||
@@ -605,8 +605,8 @@ namespace la {
|
||||
double alpha, const Vector &x, const Matrix &A,
|
||||
double beta, Vector *y) {
|
||||
DEBUG_ASSERT(x.ptr() != y->ptr());
|
||||
DEBUG_SAME_INT(A.n_rows(), x.length());
|
||||
DEBUG_SAME_INT(A.n_cols(), y->length());
|
||||
DEBUG_SAME_SIZE(A.n_rows(), x.length());
|
||||
DEBUG_SAME_SIZE(A.n_cols(), y->length());
|
||||
F77_FUNC(dgemv)("T", A.n_rows(), A.n_cols(),
|
||||
alpha, A.ptr(), A.n_rows(), x.ptr(), 1,
|
||||
beta, y->ptr(), 1);
|
||||
@@ -660,10 +660,10 @@ namespace la {
|
||||
double beta, Matrix *C) {
|
||||
DEBUG_ASSERT(A.ptr() != C->ptr());
|
||||
DEBUG_ASSERT(B.ptr() != C->ptr());
|
||||
DEBUG_SAME_INT(trans_A ? A.n_rows() : A.n_cols(),
|
||||
DEBUG_SAME_SIZE(trans_A ? A.n_rows() : A.n_cols(),
|
||||
trans_B ? B.n_cols() : B.n_rows());
|
||||
DEBUG_SAME_INT(trans_A ? A.n_cols() : A.n_rows(), C->n_rows());
|
||||
DEBUG_SAME_INT(trans_B ? B.n_rows() : B.n_cols(), C->n_cols());
|
||||
DEBUG_SAME_SIZE(trans_A ? A.n_cols() : A.n_rows(), C->n_rows());
|
||||
DEBUG_SAME_SIZE(trans_B ? B.n_rows() : B.n_cols(), C->n_cols());
|
||||
F77_FUNC(dgemm)(trans_A ? "T" : "N", trans_B ? "T" : "N",
|
||||
C->n_rows(), C->n_cols(), trans_A ? A.n_rows() : A.n_cols(),
|
||||
alpha, A.ptr(), A.n_rows(), B.ptr(), B.n_rows(),
|
||||
@@ -955,7 +955,7 @@ namespace la {
|
||||
*/
|
||||
inline success_t SolveInit(const Matrix &A, const Matrix &B, Matrix *X) {
|
||||
DEBUG_MATSQUARE(A);
|
||||
DEBUG_SAME_INT(A.n_rows(), B.n_rows());
|
||||
DEBUG_SAME_SIZE(A.n_rows(), B.n_rows());
|
||||
Matrix tmp;
|
||||
index_t n = B.n_rows();
|
||||
f77_integer pivots[n];
|
||||
@@ -988,7 +988,7 @@ namespace la {
|
||||
*/
|
||||
inline success_t SolveInit(const Matrix &A, const Vector &b, Vector *x) {
|
||||
DEBUG_MATSQUARE(A);
|
||||
DEBUG_SAME_INT(A.n_rows(), b.length());
|
||||
DEBUG_SAME_SIZE(A.n_rows(), b.length());
|
||||
Matrix tmp;
|
||||
index_t n = b.length();
|
||||
f77_integer pivots[n];
|
||||
|
||||
@@ -243,7 +243,7 @@ void CacheArray<T>::Flush() {
|
||||
cache_->StopRead(blockid);
|
||||
}
|
||||
|
||||
DEBUG_SAME_INT(metadata->lock_count, 0);
|
||||
DEBUG_SAME_SIZE(metadata->lock_count, 0);
|
||||
metadata->data = NULL;
|
||||
fifo_[i] = -1;
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ DistributedCache::~DistributedCache() {
|
||||
|
||||
#ifdef DEBUG
|
||||
for (index_t i = 0; i < blocks_.size(); i++) {
|
||||
DEBUG_SAME_INT(blocks_[i].locks, 0);
|
||||
DEBUG_SAME_SIZE(blocks_[i].locks, 0);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -141,7 +141,7 @@ index_t KdTreeHybridBuilder<TPoint, TNode, TParam>::Build_(
|
||||
} else {
|
||||
node->set_leaf();
|
||||
// ensure leaves don't straddle block boundaries
|
||||
DEBUG_SAME_INT(node->begin() / points_.n_block_elems(),
|
||||
DEBUG_SAME_SIZE(node->begin() / points_.n_block_elems(),
|
||||
(node->end() - 1) / points_.n_block_elems());
|
||||
for (index_t i = node->begin(); i < node->end(); i++) {
|
||||
CacheRead<Point> point(&points_, i);
|
||||
|
||||
@@ -973,7 +973,7 @@ bool SockConnection::TryRead() {
|
||||
read_buffer_pos_ += bytes;
|
||||
|
||||
if (read_buffer_pos_ == sizeof(Header)) {
|
||||
DEBUG_SAME_INT(read_header_.magic, MAGIC);
|
||||
DEBUG_SAME_SIZE(read_header_.magic, MAGIC);
|
||||
// When we read in a message, we don't need to allocate space for the
|
||||
// read_header_ (since we have already read it successfully).
|
||||
read_message_ = new Message();
|
||||
|
||||
+11
-11
@@ -123,7 +123,7 @@ class DHrectBound {
|
||||
* Calculates minimum bound-to-point squared distance.
|
||||
*/
|
||||
double MinDistanceSq(const Vector& point) const {
|
||||
DEBUG_SAME_INT(point.length(), dim_);
|
||||
DEBUG_SAME_SIZE(point.length(), dim_);
|
||||
return MinDistanceSq(point.ptr());
|
||||
}
|
||||
|
||||
@@ -138,7 +138,7 @@ class DHrectBound {
|
||||
const DRange *b = other.bounds_;
|
||||
index_t mdim = dim_;
|
||||
|
||||
DEBUG_SAME_INT(dim_, other.dim_);
|
||||
DEBUG_SAME_SIZE(dim_, other.dim_);
|
||||
|
||||
for (index_t d = 0; d < mdim; d++) {
|
||||
double v1 = b[d].lo - a[d].hi;
|
||||
@@ -160,7 +160,7 @@ class DHrectBound {
|
||||
double MaxDistanceSq(const Vector& point) const {
|
||||
double sum = 0;
|
||||
|
||||
DEBUG_SAME_INT(point.length(), dim_);
|
||||
DEBUG_SAME_SIZE(point.length(), dim_);
|
||||
|
||||
for (index_t d = 0; d < dim_; d++) {
|
||||
double v = std::max(point[d] - bounds_[d].lo, bounds_[d].hi - point[d]);
|
||||
@@ -178,7 +178,7 @@ class DHrectBound {
|
||||
const DRange *a = this->bounds_;
|
||||
const DRange *b = other.bounds_;
|
||||
|
||||
DEBUG_SAME_INT(dim_, other.dim_);
|
||||
DEBUG_SAME_SIZE(dim_, other.dim_);
|
||||
|
||||
for (index_t d = 0; d < dim_; d++) {
|
||||
double v = std::max(b[d].hi - a[d].lo, a[d].hi - b[d].lo);
|
||||
@@ -198,7 +198,7 @@ class DHrectBound {
|
||||
const DRange *b = other.bounds_;
|
||||
index_t mdim = dim_;
|
||||
|
||||
DEBUG_SAME_INT(dim_, other.dim_);
|
||||
DEBUG_SAME_SIZE(dim_, other.dim_);
|
||||
|
||||
for (index_t d = 0; d < mdim; d++) {
|
||||
double v1 = b[d].lo - a[d].hi;
|
||||
@@ -226,7 +226,7 @@ class DHrectBound {
|
||||
const double *mpoint = point.ptr();
|
||||
const DRange *mbound = bounds_;
|
||||
|
||||
DEBUG_SAME_INT(point.length(), dim_);
|
||||
DEBUG_SAME_SIZE(point.length(), dim_);
|
||||
|
||||
index_t d = dim_;
|
||||
do {
|
||||
@@ -261,7 +261,7 @@ class DHrectBound {
|
||||
const DRange *a = this->bounds_;
|
||||
const DRange *b = other.bounds_;
|
||||
|
||||
DEBUG_SAME_INT(dim_, other.dim_);
|
||||
DEBUG_SAME_SIZE(dim_, other.dim_);
|
||||
|
||||
for (index_t d = 0; d < dim_; d++) {
|
||||
double v = b->mid();
|
||||
@@ -288,7 +288,7 @@ class DHrectBound {
|
||||
const DRange *b = other.bounds_;
|
||||
index_t mdim = dim_;
|
||||
|
||||
DEBUG_SAME_INT(dim_, other.dim_);
|
||||
DEBUG_SAME_SIZE(dim_, other.dim_);
|
||||
|
||||
for (index_t d = 0; d < mdim; d++) {
|
||||
double v1 = b[d].hi - a[d].hi;
|
||||
@@ -309,7 +309,7 @@ class DHrectBound {
|
||||
const DRange *a = this->bounds_;
|
||||
const DRange *b = other.bounds_;
|
||||
|
||||
DEBUG_SAME_INT(dim_, other.dim_);
|
||||
DEBUG_SAME_SIZE(dim_, other.dim_);
|
||||
|
||||
for (index_t d = 0; d < dim_; d++) {
|
||||
sum += math::PowAbs<t_pow, 1>(a[d].hi + a[d].lo - b[d].hi - b[d].lo);
|
||||
@@ -322,7 +322,7 @@ class DHrectBound {
|
||||
* Expands this region to include a new point.
|
||||
*/
|
||||
DHrectBound& operator |= (const Vector& vector) {
|
||||
DEBUG_SAME_INT(vector.length(), dim_);
|
||||
DEBUG_SAME_SIZE(vector.length(), dim_);
|
||||
|
||||
for (index_t i = 0; i < dim_; i++) {
|
||||
bounds_[i] |= vector[i];
|
||||
@@ -335,7 +335,7 @@ class DHrectBound {
|
||||
* Expands this region to encompass another bound.
|
||||
*/
|
||||
DHrectBound& operator |= (const DHrectBound& other) {
|
||||
DEBUG_SAME_INT(other.dim_, dim_);
|
||||
DEBUG_SAME_SIZE(other.dim_, dim_);
|
||||
|
||||
for (index_t i = 0; i < dim_; i++) {
|
||||
bounds_[i] |= other.bounds_[i];
|
||||
|
||||
@@ -94,7 +94,7 @@ void HashedRemoteBlockDevice::Read(blockid_t blockid,
|
||||
|
||||
Rpc<BlockResponse> response(channel_, dest, request);
|
||||
memcpy(data, response->payload.begin(), response->payload.size());
|
||||
DEBUG_SAME_INT(size_t(response->payload.size()), size_t(end - begin));
|
||||
DEBUG_SAME_SIZE(size_t(response->payload.size()), size_t(end - begin));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ class ArrayInCore {
|
||||
~ArrayInCore() {
|
||||
delete[] ptr_;
|
||||
DEBUG_ONLY(ptr_ = BIG_BAD_NUMBER);
|
||||
DEBUG_SAME_INT(live_, 0);
|
||||
DEBUG_SAME_SIZE(live_, 0);
|
||||
}
|
||||
|
||||
void Init(index_t size_in) {
|
||||
|
||||
Reference in New Issue
Block a user