Loading...
Searching...
No Matches
zipf.h File Reference

Zipf random number distribution. More...

Functions

struct spdk_zipf * spdk_zipf_create (uint64_t range, double theta, uint32_t seed)
 Create a zipf random number generator.
 
void spdk_zipf_free (struct spdk_zipf **zipfp)
 Free a zipf generator and set the pointer to NULL.
 
uint64_t spdk_zipf_generate (struct spdk_zipf *zipf)
 Generate a value from the zipf generator.
 

Detailed Description

Zipf random number distribution.

Function Documentation

◆ spdk_zipf_create()

struct spdk_zipf * spdk_zipf_create ( uint64_t range,
double theta,
uint32_t seed )

Create a zipf random number generator.

Numbers from [0, range) will be returned by the generator when calling spdk_zipf_generate.

Parameters
rangeRange of values for the zipf distribution.
thetaTheta distribution parameter.
seedSeed value for the random number generator.
Returns
a pointer to the new zipf generator.

◆ spdk_zipf_free()

void spdk_zipf_free ( struct spdk_zipf ** zipfp)

Free a zipf generator and set the pointer to NULL.

Parameters
zipfpZipf generator to free.

◆ spdk_zipf_generate()

uint64_t spdk_zipf_generate ( struct spdk_zipf * zipf)

Generate a value from the zipf generator.

Parameters
zipfZipf generator to generate the value from.
Returns
value in the range [0, range)