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

Function ConstructBitset

include/LightGBM/utils/common.h:858–869  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

856
857template<typename T>
858inline static std::vector<uint32_t> ConstructBitset(const T* vals, int n) {
859 std::vector<uint32_t> ret;
860 for (int i = 0; i < n; ++i) {
861 int i1 = vals[i] / 32;
862 int i2 = vals[i] % 32;
863 if (static_cast<int>(ret.size()) < i1 + 1) {
864 ret.resize(i1 + 1, 0);
865 }
866 ret[i1] |= (1 << i2);
867 }
868 return ret;
869}
870
871template<typename T>
872inline static bool FindInBitset(const uint32_t* bits, int n, T pos) {

Callers 4

ForceSplitsMethod · 0.50
SplitMethod · 0.50
ForceSplitsMethod · 0.50
SplitMethod · 0.50

Calls 2

sizeMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected