MCPcopy Create free account
hub / github.com/activeloopai/deeplake / lower_bound

Method lower_bound

cpp/icm/shape_array.hpp:41–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39
40private:
41 auto lower_bound(T index) const noexcept
42 {
43 T count = span_.size() / stride_;
44 T step = count / 2;
45 T first = 0;
46 T it = 0;
47 while (count > 0) {
48 it = first;
49 step = count / 2;
50 it += step;
51 if (span_[(it + 1) * stride_ - 1] < index) {
52 first = ++it;
53 count -= step + 1;
54 } else {
55 count = step;
56 }
57 }
58 return first;
59 }
60
61private:
62 base::memory_buffer buffer_;

Callers

nothing calls this directly

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected