add small boundary checking

This commit is contained in:
tqchen 2015-04-10 10:55:42 -07:00
parent 0ea28c35c4
commit 91a7a5f2e2

View File

@ -498,6 +498,9 @@ class ColMaker: public IUpdater {
#pragma omp parallel for schedule(static) #pragma omp parallel for schedule(static)
for (bst_omp_uint i = 0; i < ndata; ++i) { for (bst_omp_uint i = 0; i < ndata; ++i) {
const bst_uint ridx = rowset[i]; const bst_uint ridx = rowset[i];
if (ridx >= position.size()) {
utils::Printf("ridx exceed bound\n");
}
const int nid = this->DecodePosition(ridx); const int nid = this->DecodePosition(ridx);
if (tree[nid].is_leaf()) { if (tree[nid].is_leaf()) {
// mark finish when it is not a fresh leaf // mark finish when it is not a fresh leaf