| 856 | |
| 857 | template<typename T> |
| 858 | inline 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 | |
| 871 | template<typename T> |
| 872 | inline static bool FindInBitset(const uint32_t* bits, int n, T pos) { |
no test coverage detected