1/*-------------------------------------------------------------------------
4 * definitions for sampling functions
6 * Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
7 * Portions Copyright (c) 1994, Regents of the University of California
9 * src/include/utils/sampling.h
11 *-------------------------------------------------------------------------
20/* Random generator for sampling code */
25/* Block sampling methods */
27/* Data structure for Algorithm S from Knuth 3.4.2 */
31 int n;
/* desired sample size */
33 int m;
/* blocks selected so far */
40 int samplesize,
uint32 randseed);
44/* Reservoir sampling methods */
57/* Old API, still in use by assorted FDWs */
58/* For backwards compatibility, these declarations are duplicated in vacuum.h */
64#endif /* SAMPLING_H */
BlockNumber BlockSampler_Init(BlockSampler bs, BlockNumber nblocks, int samplesize, uint32 randseed)
void reservoir_init_selection_state(ReservoirState rs, int n)
double anl_get_next_S(double t, int n, double *stateptr)
double sampler_random_fract(pg_prng_state *randstate)
bool BlockSampler_HasMore(BlockSampler bs)
ReservoirStateData * ReservoirState
BlockNumber BlockSampler_Next(BlockSampler bs)
double anl_init_selection_state(int n)
void sampler_random_init_state(uint32 seed, pg_prng_state *randstate)
BlockSamplerData * BlockSampler
double anl_random_fract(void)
double reservoir_get_next_S(ReservoirState rs, double t, int n)