|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
38 #ifndef included_random_h
39 #define included_random_h
71 *seed = (1664525 * *seed) + 1013904223;
98 #ifdef CLIB_LINUX_KERNEL
100 #include <linux/sched.h>
111 #ifdef CLIB_STANDALONE
128 *seed = 6364136223846793005ULL * *seed + 1442695040888963407ULL;
159 u8 *alphabet = (
u8 *)
"abcdefghijklmnopqrstuvwxyz";
static f64 random_f64(u32 *seed)
Generate f64 random number in the interval [0,1].
static u32 random_u32_max(void)
Maximum value returned by random_u32()
static u32 random_u32(u32 *seed)
32-bit random number generator
static u8 * random_string(u32 *seed, uword len)
Generate random character vector.
sll srl srl sll sra u16x4 i
u32 standalone_random_default_seed
Default random seed for standalone version of library.
static u64 random_u64(u64 *seed)
64-bit random number generator Again, constants courtesy of Donald Knuth.
#define vec_resize(V, N)
Resize a vector (no header, unspecified alignment) Add N elements to end of given vector V,...
f64 clib_chisquare(u64 *values)
Compute the X2 test statistic for a vector of counts.
int test_random_main(unformat_input_t *input)
static uword random_uword(u32 *seed)
machine word size random number generator
static uword random_default_seed(void)
Default random seed (unix/linux user-mode)