hSR

This function returns the higher square root of the given input. It is needed in the initialization step of the VEB tree to calculate the number of children of a given layer. And this is the universe size of the summary of a node. The upper square root is defined by 2^{\lceil(\lg u)/2\rceil}

@nogc nothrow
size_t
hSR
(
size_t value
)

Examples

auto currentSeed = unpredictableSeed();
static if(vdebug){write("UT: hSR               "); writeln("seed: ", currentSeed);} 
rndGenInUse.seed(currentSeed); //initialize the random generator
size_t M = uniform(1U,halfSizeT.max, rndGenInUse); //set universe size to some integer. 
auto hSR = hSR(M); 

assert((hSR & (hSR - 1)) == 0); 
if(hSR < halfSizeT.max) assert(hSR >= sqrt(to!float(M)));

auto check = powersOfTwo.until(hSR).array; 
assert((check[$-1]) * (check[$-1]) < M); 

Meta