aboutsummaryrefslogtreecommitdiffstats
path: root/VPP_REPO_URL
AgeCommit message (Expand)AuthorFilesLines
2018-09-13CSIT-1282 Migrate from Nexus.fd.io to packagecloud.ioPeter Mikus1-1/+1
2016-10-14CSIT-351: Testing Ubuntu 16.04.1 changespmikus1-1/+1
2016-06-21Change VPP repo URLpmikus1-1/+1
2016-06-17Change VPP repo URLpmikus1-1/+1
2016-06-17Use common file names to store VPP stable build data in branchesJan Gelety1-0/+1
Value can be overridden by platform code from e.g. machine's clock count register. */ u32 standalone_random_default_seed = 1; /** * \brief 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. * * @param[in] values vector of histogram bucket values * @return d - Pearson's X2 test statistic */ f64 clib_chisquare (u64 * values) { u32 i, len; f64 d, delta_d, actual_frequency, expected_frequency; u64 n_observations = 0; len = vec_len (values); /* * Shut up coverity. Return a huge number which should always exceed * the X2 critical value. */ if (len == 0) return (f64) 1e70; for (i = 0; i < len; i++) n_observations += values[i]; expected_frequency = (1.0 / (f64) len) * (f64) n_observations; d = 0.0; for (i = 0; i < len; i++) { actual_frequency = ((f64) values[i]); delta_d = ((actual_frequency - expected_frequency) * (actual_frequency - expected_frequency)) / expected_frequency; d += delta_d; } return d; } /* * fd.io coding-style-patch-verification: ON * * Local Variables: * eval: (c-set-style "gnu") * End: */