lSR

This function returns the lower square root of the given input. It is needed by the indexing functions high(x), low(x) and index(x,y) of elements in the tree. Also, this is the universe size of a child of a node. The lower square root is defined by 2^{\lfloor(\lgu)/2\rfloor}

@nogc nothrow
size_t
lSR
(
size_t value
)

Examples

auto currentSeed = unpredictableSeed();
static if(vdebug){write("UT: lSR               "); 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 lSR = lSR(M); 

assert((lSR & (lSR - 1)) == 0); 
assert(lSR * lSR < M);
auto check = powersOfTwo.find(lSR); 

if(lSR < halfSizeT.max) assert((check.drop(1).front) > sqrt(to!float(M))); 

Meta