star-sp

Random number generators and distributions
git clone git://git.meso-star.fr/star-sp.git
Log | Files | Refs | README | LICENSE

commit 8b1aa179a7ed924669914eebdbb7a238500b0645
parent 1d574ef813d6c6d171aa08e882b65bba02cb7e82
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Fri, 21 Aug 2015 21:37:35 +0200

Push further the tests on the uniform triangle sampling

Diffstat:
Msrc/test_ssp_ran_triangle.c | 10++++++++++
1 file changed, 10 insertions(+), 0 deletions(-)

diff --git a/src/test_ssp_ran_triangle.c b/src/test_ssp_ran_triangle.c @@ -102,6 +102,16 @@ main(int argc, char** argv) } CHECK(labs((long)(counter[1] - counter[0])) < 100, 1); + counter[0] = counter[1] = 0; + FOR_EACH(i, 0, nsteps) { + ssp_ran_triangle_uniform(rng, A, B, C, samps[0]); + if(samps[0][1] < 1 - 1/sqrt(2)) + counter[0] += 1; + else + counter[1] += 1; + } + CHECK(labs((long)(counter[1] - counter[0])) < 100, 1); + ssp_rng_ref_put(rng); check_memory_allocator(&allocator); mem_shutdown_proxy_allocator(&allocator);