MCPcopy Create free account
hub / github.com/dmlc/xgboost / ExpectPruneMatchesReference

Function ExpectPruneMatchesReference

tests/cpp/common/test_quantile.cc:185–196  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

183}
184
185void ExpectPruneMatchesReference(std::vector<WQSummary<>::Entry> const& source,
186 std::size_t maxsize) {
187 auto expected = ReferencePrune({source.data(), source.size()}, maxsize);
188
189 WQSummaryContainer actual;
190 actual.Reserve(source.size());
191 std::copy(source.cbegin(), source.cend(), actual.space.begin());
192 actual.SetSize(source.size());
193 actual.SetPrune(maxsize);
194
195 ExpectEntriesEq(actual.Entries(), expected);
196}
197
198auto RandomSummaryEntries(std::size_t size, std::uint32_t seed) -> std::vector<WQSummary<>::Entry> {
199 using Entry = WQSummary<>::Entry;

Callers 1

TESTFunction · 0.85

Calls 11

ReferencePruneFunction · 0.85
ExpectEntriesEqFunction · 0.85
ReserveMethod · 0.80
SetSizeMethod · 0.80
SetPruneMethod · 0.80
dataMethod · 0.45
sizeMethod · 0.45
cbeginMethod · 0.45
cendMethod · 0.45
beginMethod · 0.45
EntriesMethod · 0.45

Tested by

no test coverage detected