Add probabability distribution utility code.

Add probabability distribution utility code that enables generation of
random deviates drawn from normal, Chi-square, and Gamma distributions.

Fix format strings in several of the assert_* macros (remove a %s).

Clean up header issues; it's critical that system headers are not
included after internal definitions potentially do things like:

  #define inline

Fix the build system to incorporate header dependencies for the test
library C files.
This commit is contained in:
Jason Evans 2013-12-09 23:36:37 -08:00
parent 80061b6df0
commit b1941c6150
11 changed files with 731 additions and 48 deletions

View file

@ -131,7 +131,7 @@
if (!(a_ == true)) { \
p_test_fail( \
"%s:%s:%d: Failed assertion: " \
"(%s) == true --> %s != true: %s\n", \
"(%s) == true --> %s != true: ", \
__func__, __FILE__, __LINE__, \
#a, a_ ? "true" : "false", fmt); \
} \
@ -141,7 +141,7 @@
if (!(a_ == false)) { \
p_test_fail( \
"%s:%s:%d: Failed assertion: " \
"(%s) == false --> %s != false: %s\n", \
"(%s) == false --> %s != false: ", \
__func__, __FILE__, __LINE__, \
#a, a_ ? "true" : "false", fmt); \
} \
@ -152,7 +152,7 @@
p_test_fail( \
"%s:%s:%d: Failed assertion: " \
"(%s) same as (%s) --> " \
"\"%s\" differs from \"%s\": %s\n", \
"\"%s\" differs from \"%s\": ", \
__func__, __FILE__, __LINE__, #a, #b, a, b, fmt); \
} \
} while (0)
@ -161,7 +161,7 @@
p_test_fail( \
"%s:%s:%d: Failed assertion: " \
"(%s) differs from (%s) --> " \
"\"%s\" same as \"%s\": %s\n", \
"\"%s\" same as \"%s\": ", \
__func__, __FILE__, __LINE__, #a, #b, a, b, fmt); \
} \
} while (0)