Google OR-Tools: ortools/base/bitmap.cc Source File

Go to the documentation of this file.

1

2

3

4

5

6

7

8

9

10

11

12

13

15

16#include <cstdint>

17

19

22 const uint32_t old_max_size = max_size_;

23 if (new_array_size <= array_size_) {

24 max_size_ = size;

25 } else {

26 const uint32_t old_array_size = array_size_;

27 array_size_ = new_array_size;

28 max_size_ = size;

29 uint64_t* new_map = new uint64_t[array_size_];

30 memcpy(new_map, map_, old_array_size * sizeof(*map_));

31 delete[] map_;

32 map_ = new_map;

33 }

34

35 for (uint32_t index = old_max_size; index < size; ++index) {

36 Set(index, fill);

37 }

38}

39}

void Resize(uint32_t size, bool fill=false)

Definition bitmap.cc:20

void Set(uint32_t index, bool value)

uint64_t BitLength64(uint64_t size)