MCPcopy Create free account
hub / github.com/apache/cloudberry / sampler_random_init_state

Function sampler_random_init_state

src/backend/utils/misc/sampling.c:311–317  ·  view source on GitHub ↗

---------- * Random number generator used by sampling *---------- */

Source from the content-addressed store, hash-verified

309 *----------
310 */
311void
312sampler_random_init_state(long seed, SamplerRandomState randstate)
313{
314 randstate[0] = 0x330e; /* same as pg_erand48, but could be anything */
315 randstate[1] = (unsigned short) seed;
316 randstate[2] = (unsigned short) (seed >> 16);
317}
318
319/* Select a random value R uniformly distributed in (0 - 1) */
320double

Callers 7

BlockSampler_InitFunction · 0.85
RowSampler_InitFunction · 0.85
anl_random_fractFunction · 0.85
anl_init_selection_stateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected