MCPcopy Create free account
hub / github.com/apache/arrow / GetNumBytes

Function GetNumBytes

cpp/src/arrow/util/bpacking_benchmark.cc:40–46  ·  view source on GitHub ↗

Get the number of bytes associate with a packing.

Source from the content-addressed store, hash-verified

38
39/// Get the number of bytes associate with a packing.
40constexpr int32_t GetNumBytes(int32_t num_values, int32_t bit_width) {
41 const auto num_bits = num_values * bit_width;
42 if (num_bits % 8 != 0) {
43 throw std::invalid_argument("Must pack a multiple of 8 bits.");
44 }
45 return num_bits / 8;
46}
47
48/// Generate random bytes as packed integers.
49std::vector<uint8_t> GenerateRandomPackedValues(int32_t num_values, int32_t bit_width) {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected