MCPcopy Create free account
hub / github.com/antmachineintelligence/mtgbmcode / InsertBitset

Function InsertBitset

include/LightGBM/utils/common.h:847–855  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

845
846template<typename T>
847inline static void InsertBitset(std::vector<uint32_t>* vec, const T val) {
848 auto& ref_v = *vec;
849 int i1 = val / 32;
850 int i2 = val % 32;
851 if (static_cast<int>(vec->size()) < i1 + 1) {
852 vec->resize(i1 + 1, 0);
853 }
854 ref_v[i1] |= (1 << i2);
855}
856
857template<typename T>
858inline static std::vector<uint32_t> ConstructBitset(const T* vals, int n) {

Callers 2

UpdateLeafBestSplitsMethod · 0.50
UpdateLeafBestSplitsMethod · 0.50

Calls 2

sizeMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected