Span class. (#3548)

* Add basic Span class based on ISO++20.

* Use Span<Entry const> instead of Inst in SparsePage.

* Add DeviceSpan in HostDeviceVector, use it in regression obj.
This commit is contained in:
trivialfis
2018-08-14 13:58:11 +08:00
committed by Rory Mitchell
parent 2b7a1c5780
commit 2c502784ff
28 changed files with 1927 additions and 138 deletions

View File

@@ -59,10 +59,10 @@ TEST(c_api, XGDMatrixCreateFromMat_omp) {
auto batch = iter->Value();
for (int i = 0; i < batch.Size(); i++) {
auto inst = batch[i];
for (int j = 0; i < inst.length; i++) {
for (int j = 0; i < inst.size(); i++) {
ASSERT_EQ(inst[j].fvalue, 1.5);
}
}
}
}
}
}