Cleanup on device sketch. (#5874)

* Remove old functions.

* Merge weighted and un-weighted into a common interface.
This commit is contained in:
Jiaming Yuan
2020-07-14 10:15:54 +08:00
committed by GitHub
parent 9f85e92602
commit dd445af56e
10 changed files with 97 additions and 209 deletions

View File

@@ -486,30 +486,6 @@ class QuantileSketchTemplate {
this->data = dmlc::BeginPtr(space);
}
}
/*!
* \brief set the space to be merge of all Summary arrays
* \param begin beginning position in the summary array
* \param end ending position in the Summary array
*/
inline void SetMerge(const Summary *begin,
const Summary *end) {
CHECK(begin < end) << "can not set combine to empty instance";
size_t len = end - begin;
if (len == 1) {
this->Reserve(begin[0].size);
this->CopyFrom(begin[0]);
} else if (len == 2) {
this->Reserve(begin[0].size + begin[1].size);
this->SetMerge(begin[0], begin[1]);
} else {
// recursive merge
SummaryContainer lhs, rhs;
lhs.SetCombine(begin, begin + len / 2);
rhs.SetCombine(begin + len / 2, end);
this->Reserve(lhs.size + rhs.size);
this->SetCombine(lhs, rhs);
}
}
/*!
* \brief do elementwise combination of summary array
* this[i] = combine(this[i], src[i]) for each i