Split up column matrix initialization. (#8060)

* Split up column matrix initialization.

This PR splits the column matrix initialization into 2 steps, the first one initializes
the storage while the second one does the transpose. By doing so, we can reuse the code
for Quantile DMatrix.
This commit is contained in:
Jiaming Yuan
2022-07-14 10:34:47 +08:00
committed by GitHub
parent 36cf979b82
commit 8dd96013f1
4 changed files with 104 additions and 80 deletions

View File

@@ -109,9 +109,8 @@ class GHistIndexMatrix {
*/
size_t RowIdx(size_t ridx) const { return row_ptr[ridx - base_rowid]; }
bst_row_t Size() const {
return row_ptr.empty() ? 0 : row_ptr.size() - 1;
}
bst_row_t Size() const { return row_ptr.empty() ? 0 : row_ptr.size() - 1; }
bst_feature_t Features() const { return cut.Ptrs().size() - 1; }
bool ReadColumnPage(dmlc::SeekStream* fi);
size_t WriteColumnPage(dmlc::Stream* fo) const;