Commit 88b84436 authored by Guolin Ke's avatar Guolin Ke Committed by GitHub
Browse files

fix bug in CSR get row function

parent f56699eb
......@@ -660,7 +660,7 @@ RowFunctionFromCSR(const void* indptr, int indptr_type, const int32_t* indices,
std::vector<std::pair<int, double>> ret;
int64_t start = ptr_indptr[idx];
int64_t end = ptr_indptr[idx + 1];
for (int64_t i = start; i <= end; ++i) {
for (int64_t i = start; i < end; ++i) {
ret.emplace_back(indices[i], data_ptr[i]);
}
return ret;
......@@ -671,7 +671,7 @@ RowFunctionFromCSR(const void* indptr, int indptr_type, const int32_t* indices,
std::vector<std::pair<int, double>> ret;
int64_t start = ptr_indptr[idx];
int64_t end = ptr_indptr[idx + 1];
for (int64_t i = start; i <= end; ++i) {
for (int64_t i = start; i < end; ++i) {
ret.emplace_back(indices[i], data_ptr[i]);
}
return ret;
......@@ -685,7 +685,7 @@ RowFunctionFromCSR(const void* indptr, int indptr_type, const int32_t* indices,
std::vector<std::pair<int, double>> ret;
int64_t start = ptr_indptr[idx];
int64_t end = ptr_indptr[idx + 1];
for (int64_t i = start; i <= end; ++i) {
for (int64_t i = start; i < end; ++i) {
ret.emplace_back(indices[i], data_ptr[i]);
}
return ret;
......@@ -696,7 +696,7 @@ RowFunctionFromCSR(const void* indptr, int indptr_type, const int32_t* indices,
std::vector<std::pair<int, double>> ret;
int64_t start = ptr_indptr[idx];
int64_t end = ptr_indptr[idx + 1];
for (int64_t i = start; i <= end; ++i) {
for (int64_t i = start; i < end; ++i) {
ret.emplace_back(indices[i], data_ptr[i]);
}
return ret;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment