FD.io VPP  v19.04.4-rc0-5-ge88582fac
Vector Packet Processing
random.c File Reference
+ Include dependency graph for random.c:

Go to the source code of this file.

Functions

f64 clib_chisquare (u64 *values)
 Compute the X2 test statistic for a vector of counts. More...
 

Variables

u32 standalone_random_default_seed = 1
 Default random seed for standalone version of library. More...
 

Function Documentation

◆ clib_chisquare()

f64 clib_chisquare ( u64 values)

Compute the X2 test statistic for a vector of counts.

Each value element corresponds to a histogram bucket.

Typical use-case: test the hypothesis that a set of octets are uniformly distributed (aka random).

In a 1-dimensional use-case, the result should be compared with the critical value from chi square tables with vec_len(values) - 1 degrees of freedom.

Parameters
[in]valuesvector of histogram bucket values
Returns
d - Pearson's X2 test statistic

Definition at line 64 of file random.c.

+ Here is the caller graph for this function:

Variable Documentation

◆ standalone_random_default_seed

u32 standalone_random_default_seed = 1

Default random seed for standalone version of library.

Value can be overridden by platform code from e.g. machine's clock count register.

Definition at line 46 of file random.c.