MySQL  8.0.20
Source Code Documentation
histograms::equi_height Namespace Reference

Classes

class  Bucket
 Equi-height bucket. More...
 

Functions

template<class T >
static bool values_are_equal (const T &val1, const T &val2)
 
static std::uint64_t uchar_array_to_64bit_unsigned (const uchar *ptr, size_t len)
 Convert an array of uchar values into an 64bit unsigned integer. More...
 

Function Documentation

◆ uchar_array_to_64bit_unsigned()

static std::uint64_t histograms::equi_height::uchar_array_to_64bit_unsigned ( const uchar ptr,
size_t  len 
)
static

Convert an array of uchar values into an 64bit unsigned integer.

It simply does an bitwise concatenation of the eight first values of the array into a single integer. It will do something like this, given an array of five uchar values {62, 28, 62, 28, 51}:

result: 0000000000000000000000000000000000000000000000000000000000000000 first byte: 00111110 (byte value 62) second byte: | 00011100 (byte value 28) third byte: | | 00111110 (byte value 62) fourth byte: | | | 00011100 (byte value 28) fifth byte: | | | | 00111101 (byte value 51) | | | | | result: 0011111000011100001111100001110000111101000000000000000000000000

Parameters
ptrThe input value to convert.
lenThe length of the input array.
Returns
The converted value.

◆ values_are_equal()

template<class T >
static bool histograms::equi_height::values_are_equal ( const T &  val1,
const T &  val2 
)
static