Fix and cleanup for column matrix. (#7901)

* Fix missed type dispatching for dense columns with missing values.
* Code cleanup to reduce special cases.
* Reduce memory usage.
This commit is contained in:
Jiaming Yuan
2022-05-16 21:11:50 +08:00
committed by GitHub
parent 1496789561
commit 4fcfd9c96e
10 changed files with 124 additions and 136 deletions

View File

@@ -28,7 +28,7 @@ void EncodeTreeLeafHost(RegTree const& tree, std::vector<bst_node_t> const& posi
sorted_pos[i] = position[ridx[i]];
}
// find the first non-sampled row
auto begin_pos =
size_t begin_pos =
std::distance(sorted_pos.cbegin(), std::find_if(sorted_pos.cbegin(), sorted_pos.cend(),
[](bst_node_t nidx) { return nidx >= 0; }));
CHECK_LE(begin_pos, sorted_pos.size());