Move GHistIndex into DMatrix. (#7064)

This commit is contained in:
Jiaming Yuan
2021-07-01 00:44:49 +08:00
committed by GitHub
parent 1c8fdf2218
commit 1cd20efe68
17 changed files with 386 additions and 320 deletions

View File

@@ -12,6 +12,7 @@
#include <vector>
#include <memory>
#include "hist_util.h"
#include "../data/gradient_index.h"
namespace xgboost {
namespace common {
@@ -262,9 +263,10 @@ class ColumnMatrix {
return res;
}
template<typename T>
inline void SetIndexAllDense(T* index, const GHistIndexMatrix& gmat, const size_t nrow,
const size_t nfeature, const bool noMissingValues) {
template <typename T>
inline void SetIndexAllDense(T *index, const GHistIndexMatrix &gmat,
const size_t nrow, const size_t nfeature,
const bool noMissingValues) {
T* local_index = reinterpret_cast<T*>(&index_[0]);
/* missing values make sense only for column with type kDenseColumn,