MCPcopy Create free account
hub / github.com/activeloopai/deeplake / operator~

Function operator~

cpp/icm/bit_vector.hpp:1599–1613  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1597}
1598
1599inline bit_vector operator~(const bit_vector& a)
1600{
1601 bit_vector result = a;
1602 // Flip all bits
1603 for (size_t i = 0; i < result.num_blocks(); i++) {
1604 result.data()[i] = ~result.data()[i];
1605 }
1606 // Clear unused bits in last block
1607 if (result.size() % 64 != 0) {
1608 size_t unused_bits = 64 - (result.size() % 64);
1609 result.data()[result.num_blocks() - 1] =
1610 result.data()[result.num_blocks() - 1] & ((uint64_t(1) << (result.size() % 64)) - 1);
1611 }
1612 return result;
1613}
1614
1615// Comparison operators
1616inline bool operator==(const bit_vector& a, const bit_vector& b)

Callers

nothing calls this directly

Calls 3

num_blocksMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected