1 /*
2 	file automatically generated by make_test_files.pl
3 	Tue Apr 19 14:01:02 2011
4 */
5 
6 /*****************************************************************************
7  *                                                                           *
8  *          UNU.RAN -- Universal Non-Uniform Random number generator         *
9  *                                                                           *
10  *****************************************************************************/
11 
12 /**
13  ** Tests for GIBBS
14  **/
15 
16 /*---------------------------------------------------------------------------*/
17 #include "testunuran.h"
18 
19 #ifdef UNUR_URNG_DEFAULT_RNGSTREAM
20 #include <RngStream.h>
21 #endif
22 /*---------------------------------------------------------------------------*/
23 
24 /*---------------------------------------------------------------------------*/
25 /* global variables                                                          */
26 
27 static FILE *TESTLOG;               /* test log file                         */
28 static FILE *UNURANLOG;             /* unuran log file                       */
29 
30 static int test_ok = TRUE;          /* all tests ok (boolean)                */
31 static int fullcheck = FALSE;       /* whether all checks are performed      */
32 
33 static TIMER watch;                 /* stop watch                            */
34 
35 /*---------------------------------------------------------------------------*/
36 
37 void run_verify_generator( FILE *LOG, int line, UNUR_PAR *par );
38 
39 int unur_gibbs_set_verify( UNUR_PAR *par, int verify);
40 
41 
42 /*---------------------------------------------------------------------------*/
43 
44 void test_new (void);
45 void test_set (void);
46 void test_get (void);
47 void test_chg (void);
48 void test_init (void);
49 void test_reinit (void);
50 void test_sample (void);
51 void test_validate (void);
52 void test_special(void);
53 
54 /*---------------------------------------------------------------------------*/
55 
56 
57 
58 /* prototypes */
59 
60 int unur_gibbs_set_pedantic( UNUR_PAR *par, int pedantic );
61 
62 #define COMPARE_SAMPLE_SIZE   (9999)
63 #define VIOLATE_SAMPLE_SIZE   (20)
64 
65 /* For running chi2 tests we use a thinning of dimension * THINNING */
66 #define THINNING (2)
67 
68 /* GIBBS is a Markov Chain Monte Carlo method and thus it is likely to   */
69 /* fail the chi-square goodness-of-fit test with the used sample size.   */
70 /* Thus we accept one "hard" failer and more "soft" failures then usual. */
71 #define CHI2_FAILURES_TOLERATED (1010)
72 
73 
74 /* we need marginal distributions for the chi2 tests */
75 #define unur_distr_multicauchy   unur_distr_multicauchy_w_marginals
76 #define unur_distr_multinormal   unur_distr_multinormal_w_marginals
77 #define unur_distr_multistudent  unur_distr_multistudent_w_marginals
78 
79 
80 
81 
82 
83 /*---------------------------------------------------------------------------*/
84 
85 #ifndef CHI2_FAILURES_TOLERATED
86 #  define CHI2_FAILURES_TOLERATED DEFAULT_CHI2_FAILURES_TOLERATED
87 #endif
88 
89 /*---------------------------------------------------------------------------*/
90 /* [verbatim] */
91 
92 
93 
94 /* dummy function */
unur_gibbs_set_pedantic(UNUR_PAR * par ATTRIBUTE__UNUSED,int pedantic ATTRIBUTE__UNUSED)95 int unur_gibbs_set_pedantic( UNUR_PAR *par ATTRIBUTE__UNUSED, int pedantic ATTRIBUTE__UNUSED)
96 { return 1; }
97 
98 
99 /*---------------------------------------------------------------------------*/
100 /* [new] */
101 
test_new(void)102 void test_new (void)
103 {
104         int n_tests_failed;          /* number of failed tests */
105 
106 	/* start test */
107 	printf("[new "); fflush(stdout);
108 	fprintf(TESTLOG,"\n[new]\n");
109 
110 	/* reset counter */
111 	n_tests_failed = 0;
112 
113 	/* set stop watch */
114 	stopwatch_lap(&watch);
115 
116 { /* invalid NULL ptr */
117 UNUR_DISTR *distr = NULL;
118    distr = NULL;
119 
120 
121 unur_reset_errno();
122 n_tests_failed += (check_expected_NULL(TESTLOG,43,(unur_gibbs_new( distr )))==UNUR_SUCCESS)?0:1;
123 n_tests_failed += (check_errorcode(TESTLOG,43,UNUR_ERR_NULL)==UNUR_SUCCESS)?0:1;
124 unur_distr_free(distr);
125 }
126 
127 { /* invalid distribution type */
128 UNUR_DISTR *distr = NULL;
129    distr = unur_distr_discr_new();
130 
131 
132 unur_reset_errno();
133 n_tests_failed += (check_expected_NULL(TESTLOG,50,(unur_gibbs_new( distr )))==UNUR_SUCCESS)?0:1;
134 n_tests_failed += (check_errorcode(TESTLOG,50,UNUR_ERR_DISTR_INVALID)==UNUR_SUCCESS)?0:1;
135 unur_distr_free(distr);
136 }
137 
138 
139 	/* timing */
140 	stopwatch_print(TESTLOG,"\n<*>time = %.3f ms\n\n", stopwatch_lap(&watch));
141 
142 	/* test finished */
143 	test_ok &= (n_tests_failed) ? 0 : 1;
144 	(n_tests_failed) ? printf(" ==> failed] ") : printf(" ==> ok] ");
145 
146 } /* end of test_new() */
147 
148 /*---------------------------------------------------------------------------*/
149 /* [set] */
150 
test_set(void)151 void test_set (void)
152 {
153         int n_tests_failed;          /* number of failed tests */
154 
155 	/* start test */
156 	printf("[set "); fflush(stdout);
157 	fprintf(TESTLOG,"\n[set]\n");
158 
159 	/* reset counter */
160 	n_tests_failed = 0;
161 
162 	/* set stop watch */
163 	stopwatch_lap(&watch);
164 
165 { /* invalid NULL ptr */
166 UNUR_PAR   *par = NULL;
167    double x0[] = {1., 2., 3.};
168    par = NULL;
169 
170 
171 unur_reset_errno();
172 n_tests_failed += (check_expected_setfailed(TESTLOG,62,(unur_gibbs_set_variant_coordinate( par )))==UNUR_SUCCESS)?0:1;
173 n_tests_failed += (check_errorcode(TESTLOG,62,UNUR_ERR_NULL)==UNUR_SUCCESS)?0:1;
174 
175 unur_reset_errno();
176 n_tests_failed += (check_expected_setfailed(TESTLOG,65,(unur_gibbs_set_variant_random_direction( par )))==UNUR_SUCCESS)?0:1;
177 n_tests_failed += (check_errorcode(TESTLOG,65,UNUR_ERR_NULL)==UNUR_SUCCESS)?0:1;
178 
179 unur_reset_errno();
180 n_tests_failed += (check_expected_setfailed(TESTLOG,68,(unur_gibbs_set_startingpoint( par, x0)))==UNUR_SUCCESS)?0:1;
181 n_tests_failed += (check_errorcode(TESTLOG,68,UNUR_ERR_NULL)==UNUR_SUCCESS)?0:1;
182 
183 unur_reset_errno();
184 n_tests_failed += (check_expected_setfailed(TESTLOG,71,(unur_gibbs_set_thinning( par, 3 )))==UNUR_SUCCESS)?0:1;
185 n_tests_failed += (check_errorcode(TESTLOG,71,UNUR_ERR_NULL)==UNUR_SUCCESS)?0:1;
186 
187 unur_reset_errno();
188 n_tests_failed += (check_expected_setfailed(TESTLOG,74,(unur_gibbs_set_burnin( par, 100 )))==UNUR_SUCCESS)?0:1;
189 n_tests_failed += (check_errorcode(TESTLOG,74,UNUR_ERR_NULL)==UNUR_SUCCESS)?0:1;
190 }
191 
192 { /* invalid parameter object */
193 UNUR_DISTR *distr = NULL;
194 UNUR_PAR   *par = NULL;
195    double x0[] = {1., 2., 3.};
196    double fpar[2] = {0.,1.};
197    distr = unur_distr_normal(fpar,2);
198    par = unur_arou_new(distr);
199 
200 
201 unur_reset_errno();
202 n_tests_failed += (check_expected_setfailed(TESTLOG,83,(unur_gibbs_set_variant_coordinate( par )))==UNUR_SUCCESS)?0:1;
203 n_tests_failed += (check_errorcode(TESTLOG,83,UNUR_ERR_PAR_INVALID)==UNUR_SUCCESS)?0:1;
204 
205 unur_reset_errno();
206 n_tests_failed += (check_expected_setfailed(TESTLOG,86,(unur_gibbs_set_variant_random_direction( par )))==UNUR_SUCCESS)?0:1;
207 n_tests_failed += (check_errorcode(TESTLOG,86,UNUR_ERR_PAR_INVALID)==UNUR_SUCCESS)?0:1;
208 
209 unur_reset_errno();
210 n_tests_failed += (check_expected_setfailed(TESTLOG,89,(unur_gibbs_set_startingpoint( par, x0)))==UNUR_SUCCESS)?0:1;
211 n_tests_failed += (check_errorcode(TESTLOG,89,UNUR_ERR_PAR_INVALID)==UNUR_SUCCESS)?0:1;
212 
213 unur_reset_errno();
214 n_tests_failed += (check_expected_setfailed(TESTLOG,92,(unur_gibbs_set_thinning( par, 3 )))==UNUR_SUCCESS)?0:1;
215 n_tests_failed += (check_errorcode(TESTLOG,92,UNUR_ERR_PAR_INVALID)==UNUR_SUCCESS)?0:1;
216 
217 unur_reset_errno();
218 n_tests_failed += (check_expected_setfailed(TESTLOG,95,(unur_gibbs_set_burnin( par, 100 )))==UNUR_SUCCESS)?0:1;
219 n_tests_failed += (check_errorcode(TESTLOG,95,UNUR_ERR_PAR_INVALID)==UNUR_SUCCESS)?0:1;
220 unur_par_free(par);
221 unur_distr_free(distr);
222 }
223 
224 { /* invalid parameters */
225 UNUR_DISTR *distr = NULL;
226 UNUR_PAR   *par = NULL;
227    distr = unur_distr_multinormal( 3, NULL, NULL );
228    par = unur_gibbs_new(distr);
229 
230 
231 unur_reset_errno();
232 n_tests_failed += (check_expected_setfailed(TESTLOG,104,(unur_gibbs_set_thinning( par, 0 )))==UNUR_SUCCESS)?0:1;
233 n_tests_failed += (check_errorcode(TESTLOG,104,UNUR_ERR_PAR_SET)==UNUR_SUCCESS)?0:1;
234 
235 unur_reset_errno();
236 n_tests_failed += (check_expected_setfailed(TESTLOG,107,(unur_gibbs_set_burnin( par, -1 )))==UNUR_SUCCESS)?0:1;
237 n_tests_failed += (check_errorcode(TESTLOG,107,UNUR_ERR_PAR_SET)==UNUR_SUCCESS)?0:1;
238 unur_par_free(par);
239 unur_distr_free(distr);
240 }
241 
242 
243 	/* timing */
244 	stopwatch_print(TESTLOG,"\n<*>time = %.3f ms\n\n", stopwatch_lap(&watch));
245 
246 	/* test finished */
247 	test_ok &= (n_tests_failed) ? 0 : 1;
248 	(n_tests_failed) ? printf(" ==> failed] ") : printf(" ==> ok] ");
249 
250 } /* end of test_set() */
251 
252 /*---------------------------------------------------------------------------*/
253 /* [get] */
254 
test_get(void)255 void test_get (void)
256 {
257         int n_tests_failed;          /* number of failed tests */
258 
259 	/* start test */
260 	printf("[get "); fflush(stdout);
261 	fprintf(TESTLOG,"\n[get]\n");
262 
263 	/* reset counter */
264 	n_tests_failed = 0;
265 
266 	/* set stop watch */
267 	stopwatch_lap(&watch);
268 
269 { /* invalid generator object */
270 UNUR_DISTR *distr = NULL;
271 UNUR_PAR   *par = NULL;
272 UNUR_GEN   *gen = NULL;
273    distr = unur_distr_normal(NULL,0);
274    par = unur_arou_new(distr);
275    gen = unur_init(par);
276 abort_if_NULL(TESTLOG, 118,    gen );
277 
278 
279 unur_reset_errno();
280 n_tests_failed += (check_expected_NULL(TESTLOG,122,(unur_gibbs_get_state(gen)))==UNUR_SUCCESS)?0:1;
281 n_tests_failed += (check_errorcode(TESTLOG,122,UNUR_ERR_GEN_INVALID)==UNUR_SUCCESS)?0:1;
282 unur_distr_free(distr);
283 unur_free(gen);
284 }
285 
286 
287 	/* timing */
288 	stopwatch_print(TESTLOG,"\n<*>time = %.3f ms\n\n", stopwatch_lap(&watch));
289 
290 	/* test finished */
291 	test_ok &= (n_tests_failed) ? 0 : 1;
292 	(n_tests_failed) ? printf(" ==> failed] ") : printf(" ==> ok] ");
293 
294 } /* end of test_get() */
295 
296 /*---------------------------------------------------------------------------*/
297 /* [chg] */
298 
test_chg(void)299 void test_chg (void)
300 {
301         int n_tests_failed;          /* number of failed tests */
302 
303 	/* start test */
304 	printf("[chg "); fflush(stdout);
305 	fprintf(TESTLOG,"\n[chg]\n");
306 
307 	/* reset counter */
308 	n_tests_failed = 0;
309 
310 	/* set stop watch */
311 	stopwatch_lap(&watch);
312 
313 { /* invalid generator object */
314 UNUR_DISTR *distr = NULL;
315 UNUR_PAR   *par = NULL;
316 UNUR_GEN   *gen = NULL;
317    double x[] = {0.,0.};
318    distr = unur_distr_normal(NULL,0);
319    par = unur_ssr_new(distr);
320    gen = unur_init( par );
321 abort_if_NULL(TESTLOG, 132,    gen );
322 
323 
324 unur_reset_errno();
325 n_tests_failed += (check_expected_setfailed(TESTLOG,136,(unur_gibbs_chg_state(gen,x)))==UNUR_SUCCESS)?0:1;
326 n_tests_failed += (check_errorcode(TESTLOG,136,UNUR_ERR_GEN_INVALID)==UNUR_SUCCESS)?0:1;
327 unur_distr_free(distr);
328 unur_free(gen);
329 }
330 
331 { /* invalid NULL */
332 UNUR_DISTR *distr = NULL;
333 UNUR_PAR   *par = NULL;
334 UNUR_GEN   *gen = NULL;
335    distr = unur_distr_multinormal(2,NULL,NULL);
336    par = unur_gibbs_new(distr);
337    gen = unur_init( par );
338 abort_if_NULL(TESTLOG, 140,    gen );
339 
340 
341 unur_reset_errno();
342 n_tests_failed += (check_expected_setfailed(TESTLOG,144,(unur_gibbs_chg_state(gen,NULL)))==UNUR_SUCCESS)?0:1;
343 n_tests_failed += (check_errorcode(TESTLOG,144,UNUR_ERR_NULL)==UNUR_SUCCESS)?0:1;
344 unur_distr_free(distr);
345 unur_free(gen);
346 }
347 
348 
349 	/* timing */
350 	stopwatch_print(TESTLOG,"\n<*>time = %.3f ms\n\n", stopwatch_lap(&watch));
351 
352 	/* test finished */
353 	test_ok &= (n_tests_failed) ? 0 : 1;
354 	(n_tests_failed) ? printf(" ==> failed] ") : printf(" ==> ok] ");
355 
356 } /* end of test_chg() */
357 
358 /*---------------------------------------------------------------------------*/
359 /* [reinit] */
360 
test_reinit(void)361 void test_reinit (void)
362 {
363         int n_tests_failed;          /* number of failed tests */
364 
365 	/* start test */
366 	printf("[reinit "); fflush(stdout);
367 	fprintf(TESTLOG,"\n[reinit]\n");
368 
369 	/* reset counter */
370 	n_tests_failed = 0;
371 
372 	/* set stop watch */
373 	stopwatch_lap(&watch);
374 
375 { /* does not exist */
376 UNUR_DISTR *distr = NULL;
377 UNUR_PAR   *par = NULL;
378 UNUR_GEN   *gen = NULL;
379    double x[3];
380    distr = unur_distr_multinormal(3,NULL,NULL);
381    par = unur_gibbs_new(distr);
382    gen = unur_init( par );
383 abort_if_NULL(TESTLOG, 158,    gen );
384 
385 
386 unur_reset_errno();
387 n_tests_failed += (check_expected_setfailed(TESTLOG,162,(unur_reinit( gen )))==UNUR_SUCCESS)?0:1;
388 n_tests_failed += (check_errorcode(TESTLOG,162,UNUR_ERR_NO_REINIT)==UNUR_SUCCESS)?0:1;
389 
390 unur_reset_errno();
391 unur_sample_vec( gen, x );
392 n_tests_failed += (check_expected_INFINITY(TESTLOG,166,(x[0]))==UNUR_SUCCESS)?0:1;
393 n_tests_failed += (check_errorcode(TESTLOG,166,UNUR_ERR_GEN_CONDITION)==UNUR_SUCCESS)?0:1;
394 unur_distr_free(distr);
395 unur_free(gen);
396 }
397 
398 
399 	/* timing */
400 	stopwatch_print(TESTLOG,"\n<*>time = %.3f ms\n\n", stopwatch_lap(&watch));
401 
402 	/* test finished */
403 	test_ok &= (n_tests_failed) ? 0 : 1;
404 	(n_tests_failed) ? printf(" ==> failed] ") : printf(" ==> ok] ");
405 
406 } /* end of test_reinit() */
407 
408 /*---------------------------------------------------------------------------*/
409 /* [sample] */
410 
test_sample(void)411 void test_sample (void)
412 {
413         int n_tests_failed;          /* number of failed tests */
414 
415 	/* start test */
416 	printf("[sample "); fflush(stdout);
417 	fprintf(TESTLOG,"\n[sample]\n");
418 
419 	/* reset counter */
420 	n_tests_failed = 0;
421 
422 	/* set stop watch */
423 	stopwatch_lap(&watch);
424 
425 { /* test clone */
426 UNUR_DISTR *distr = NULL;
427 UNUR_PAR   *par = NULL;
428 UNUR_GEN   *gen = NULL;
429    const int dim = 3;
430    double mean[] = {1.,2.,3.};
431    double covar[] = { 2., 2., 1.,   2., 4., 3.,   1., 3., 3. };
432    UNUR_GEN *clone;
433    distr = unur_distr_multinormal( dim, mean, covar );
434    par = unur_gibbs_new(distr);
435    /* unur_gibbs_set_variant_random_direction(par); */
436    unur_set_debug(par,1u);
437    gen = unur_init( par );
438 abort_if_NULL(TESTLOG, 181,    gen );
439 
440 
441 unur_reset_errno();
442 /* clone */
443 /* currently we cannot compare clone with original generator. */
444 /* thus we just run it to test whether cloning works without a segfault. */
445 clone = unur_gen_clone(gen);
446 unur_free(gen);
447 gen = clone;
448 unur_gibbs_reset_state(gen);
449 n_tests_failed += (compare_sequence_gen_start(TESTLOG,191,gen,COMPARE_SAMPLE_SIZE)==UNUR_SUCCESS)?0:1;
450 unur_distr_free(distr);
451 unur_free(gen);
452 }
453 
454 
455 	/* timing */
456 	stopwatch_print(TESTLOG,"\n<*>time = %.3f ms\n\n", stopwatch_lap(&watch));
457 
458 	/* test finished */
459 	test_ok &= (n_tests_failed) ? 0 : 1;
460 	(n_tests_failed) ? printf(" ==> failed] ") : printf(" ==> ok] ");
461 
462 } /* end of test_sample() */
463 
464 /*---------------------------------------------------------------------------*/
465 /* [validate] */
466 
467 /*---------------------------------------------------------------------------*/
468 
469 /* [validate] */
470 
test_validate(void)471 void test_validate (void)
472 {
473 	UNUR_DISTR *distr[35];
474 	UNUR_PAR *par;
475 	UNUR_GEN *gen;
476 	int n_tests_failed;
477 	int rcode;
478 	double *darray;
479 	double fpm[10];
480 
481 	rcode = 0;
482 
483 	/* start test */
484 	printf("[validate "); fflush(stdout);
485 	fprintf(TESTLOG,"\n[validate]\n");
486 
487 	/* reset counter */
488 	n_tests_failed = 0;
489 
490 	/* set stop watch */
491 	stopwatch_lap(&watch);
492 
493 
494 /* distributions: 35 */
495 {
496 distr[0] = unur_distr_multinormal(1,NULL,NULL);
497 }
498 
499 {
500 distr[1] = unur_distr_multinormal(2,NULL,NULL);
501 }
502 
503 {
504 distr[2] = unur_distr_multinormal(3,NULL,NULL);
505 }
506 
507 {
508 double mean[]  = { 1., 2., 3. };
509 distr[34] = unur_distr_multinormal(3,mean,NULL);
510 }
511 
512 {
513 double mean[]  = { -1. };
514 double covar[] = { 2. };
515 distr[3] = unur_distr_multinormal(1,mean,covar);
516 unur_distr_cvec_set_center(distr[3],NULL);
517 }
518 
519 {
520 double mean[]  = { 1., 2., 3. };
521 double covar[] = { 2., 2., 1.,   2., 4., 3.,   1., 3., 3. };
522 distr[4] = unur_distr_multinormal(3,mean,covar);
523 }
524 
525 {
526 distr[5] = unur_distr_multinormal_ar1(3,NULL,0.9);
527 }
528 
529 {
530 distr[6] = unur_distr_multinormal_ar1(4,NULL,0.8);
531 }
532 
533 {
534 distr[7] = unur_distr_multinormal_ar1(5,NULL,0.7);
535 }
536 
537 {
538 distr[8] = unur_distr_multinormal_ar1(10,NULL,0.6);
539 }
540 
541 {
542 double mean[]  = { -1., -2., -3., 4., 5., 6., 7., 8., 9., 10. };
543 distr[9] = unur_distr_multinormal_ar1(3,mean,0.9);
544 }
545 
546 {
547 double mean[]  = { -1., -2., -3., 4., 5., 6., 7., 8., 9., 10. };
548 distr[10] = unur_distr_multinormal_ar1(4,mean,0.8);
549 }
550 
551 {
552 double mean[]  = { -1., -2., -3., 4., 5., 6., 7., 8., 9., 10. };
553 distr[11] = unur_distr_multinormal_ar1(5,mean,0.7);
554 }
555 
556 {
557 double mean[]  = { -1., -2., -3., 4., 5., 6., 7., 8., 9., 10. };
558 distr[12] = unur_distr_multinormal_ar1(10,mean,0.6);
559 }
560 
561 {
562 distr[13] = unur_distr_multinormal_constantrho(3,NULL,0.9);
563 }
564 
565 {
566 distr[14] = unur_distr_multinormal_constantrho(4,NULL,0.8);
567 }
568 
569 {
570 distr[15] = unur_distr_multinormal_constantrho(5,NULL,0.7);
571 }
572 
573 {
574 distr[16] = unur_distr_multinormal_constantrho(10,NULL,0.6);
575 }
576 
577 {
578 distr[17] = unur_distr_multicauchy(2,NULL,NULL);
579 }
580 
581 {
582 distr[18] = unur_distr_multicauchy(3,NULL,NULL);
583 }
584 
585 {
586 double mean[]  = { 1., 2., 3. };
587 double covar[] = { 1., 0.5, 0.25,  0.5, 1., 0.5,   0.25, 0.5, 1. };
588 distr[19] = unur_distr_multicauchy(3,mean,covar);
589 }
590 
591 {
592 distr[20] = unur_distr_multicauchy_ar1(3,NULL,0.7);
593 }
594 
595 {
596 distr[21] = unur_distr_multicauchy_ar1(4,NULL,0.6);
597 }
598 
599 {
600 distr[22] = unur_distr_multicauchy_ar1(5,NULL,0.5);
601 }
602 
603 {
604 distr[23] = unur_distr_multicauchy_ar1(10,NULL,0.4);
605 }
606 
607 {
608 distr[24] = unur_distr_multistudent_ar1(2,3.,NULL,0.7);
609 }
610 
611 {
612 distr[25] = unur_distr_multistudent_ar1(2,5.,NULL,0.7);
613 }
614 
615 {
616 distr[26] = unur_distr_multistudent_ar1(2,15.,NULL,0.7);
617 }
618 
619 {
620 distr[27] = unur_distr_multistudent_ar1(2,0.5,NULL,0.7);
621 }
622 
623 {
624 distr[28] = unur_distr_multistudent_ar1(2,1.5,NULL,0.7);
625 }
626 
627 {
628 distr[29] = unur_distr_multistudent_ar1(2,2.5,NULL,0.7);
629 }
630 
631 {
632 double ll[3] = {0.,0.,0.};
633 double ru[3] = {UNUR_INFINITY,UNUR_INFINITY,UNUR_INFINITY};
634 distr[30] = unur_distr_multinormal(3,NULL,NULL);
635 unur_distr_cvec_set_domain_rect(distr[30],ll,ru);
636 }
637 
638 {
639 double ll[3] = {0.,0.,0.};
640 double ru[3] = {1.,UNUR_INFINITY,UNUR_INFINITY};
641 distr[31] = unur_distr_multinormal(3,NULL,NULL);
642 unur_distr_cvec_set_domain_rect(distr[31],ll,ru);
643 }
644 
645 {
646 double ll[3] = {-1.,-1.,1.};
647 double ru[3] = {1.,0.,2.};
648 double center[3] = {0.,-0.5,1.5};
649 distr[32] = unur_distr_multinormal(3,NULL,NULL);
650 unur_distr_cvec_set_domain_rect(distr[32],ll,ru);
651 unur_distr_cvec_set_center(distr[32],center);
652 }
653 
654 {
655 double ll[3] = {-1.,-1.,1.};
656 double ru[3] = {1.,0.,2.};
657 distr[33] = unur_distr_multinormal(3,NULL,NULL);
658 unur_distr_cvec_set_domain_rect(distr[33],ll,ru);
659 }
660 
661 	/* timing */
662 	stopwatch_print(TESTLOG,"\n<*>setup time = %.3f ms\n", stopwatch_lap(&watch));
663 
664 	printf("\n(chi^2) "); fflush(stdout);
665 
666 /* chi^2 tests: 140 */
667 
668 	unur_set_default_debug(~UNUR_DEBUG_SAMPLE);
669 	fprintf( TESTLOG,"\nChi^2 Test:\n");
670 
671 /* distribution [0] */
672 
673 	if(TRUE) {
674 	unur_reset_errno();
675 	do {
676 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[0]);
677 par = unur_gibbs_new(distr_localcopy);
678 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
679 unur_gibbs_set_burnin(par,1000);
680 	gen = unur_init(par);
681 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[0],'+');
682 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
683 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
684 	unur_free(gen);
685 	unur_distr_free(distr_localcopy);
686 	} while (0);
687 	}
688 
689 	if(TRUE) {
690 	unur_reset_errno();
691 	do {
692 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[0]);
693 par = unur_gibbs_new(distr_localcopy);
694 unur_gibbs_set_variant_random_direction(par);
695 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
696 unur_gibbs_set_burnin(par,1000);
697 	gen = unur_init(par);
698 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[0],'+');
699 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
700 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
701 	unur_free(gen);
702 	unur_distr_free(distr_localcopy);
703 	} while (0);
704 	}
705 
706 	if(TRUE) {
707 	unur_reset_errno();
708 	do {
709 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[0]);
710 par = unur_gibbs_new(distr_localcopy);
711 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
712 unur_gibbs_set_c(par,-0.5);
713 	gen = unur_init(par);
714 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[0],'+');
715 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
716 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
717 	unur_free(gen);
718 	unur_distr_free(distr_localcopy);
719 	} while (0);
720 	}
721 
722 	if(TRUE) {
723 	unur_reset_errno();
724 	do {
725 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[0]);
726 par = unur_gibbs_new(distr_localcopy);
727 unur_gibbs_set_variant_random_direction(par);
728 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
729 unur_gibbs_set_c(par,-0.5);
730 	gen = unur_init(par);
731 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[0],'+');
732 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
733 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
734 	unur_free(gen);
735 	unur_distr_free(distr_localcopy);
736 	} while (0);
737 	}
738 
739 /* distribution [1] */
740 
741 	if(TRUE) {
742 	unur_reset_errno();
743 	do {
744 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[1]);
745 par = unur_gibbs_new(distr_localcopy);
746 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
747 unur_gibbs_set_burnin(par,1000);
748 	gen = unur_init(par);
749 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[1],'+');
750 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
751 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
752 	unur_free(gen);
753 	unur_distr_free(distr_localcopy);
754 	} while (0);
755 	}
756 
757 	if(TRUE) {
758 	unur_reset_errno();
759 	do {
760 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[1]);
761 par = unur_gibbs_new(distr_localcopy);
762 unur_gibbs_set_variant_random_direction(par);
763 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
764 unur_gibbs_set_burnin(par,1000);
765 	gen = unur_init(par);
766 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[1],'+');
767 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
768 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
769 	unur_free(gen);
770 	unur_distr_free(distr_localcopy);
771 	} while (0);
772 	}
773 
774 	if(TRUE) {
775 	unur_reset_errno();
776 	do {
777 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[1]);
778 par = unur_gibbs_new(distr_localcopy);
779 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
780 unur_gibbs_set_c(par,-0.5);
781 	gen = unur_init(par);
782 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[1],'+');
783 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
784 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
785 	unur_free(gen);
786 	unur_distr_free(distr_localcopy);
787 	} while (0);
788 	}
789 
790 	if(TRUE) {
791 	unur_reset_errno();
792 	do {
793 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[1]);
794 par = unur_gibbs_new(distr_localcopy);
795 unur_gibbs_set_variant_random_direction(par);
796 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
797 unur_gibbs_set_c(par,-0.5);
798 	gen = unur_init(par);
799 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[1],'+');
800 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
801 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
802 	unur_free(gen);
803 	unur_distr_free(distr_localcopy);
804 	} while (0);
805 	}
806 
807 /* distribution [2] */
808 
809 	if(TRUE) {
810 	unur_reset_errno();
811 	do {
812 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[2]);
813 par = unur_gibbs_new(distr_localcopy);
814 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
815 unur_gibbs_set_burnin(par,1000);
816 	gen = unur_init(par);
817 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[2],'+');
818 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
819 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
820 	unur_free(gen);
821 	unur_distr_free(distr_localcopy);
822 	} while (0);
823 	}
824 
825 	if(TRUE) {
826 	unur_reset_errno();
827 	do {
828 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[2]);
829 par = unur_gibbs_new(distr_localcopy);
830 unur_gibbs_set_variant_random_direction(par);
831 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
832 unur_gibbs_set_burnin(par,1000);
833 	gen = unur_init(par);
834 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[2],'+');
835 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
836 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
837 	unur_free(gen);
838 	unur_distr_free(distr_localcopy);
839 	} while (0);
840 	}
841 
842 	if(fullcheck) {
843 	unur_reset_errno();
844 	do {
845 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[2]);
846 par = unur_gibbs_new(distr_localcopy);
847 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
848 unur_gibbs_set_c(par,-0.5);
849 	gen = unur_init(par);
850 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[2],'+');
851 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
852 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
853 	unur_free(gen);
854 	unur_distr_free(distr_localcopy);
855 	} while (0);
856 	}
857 
858 	if(fullcheck) {
859 	unur_reset_errno();
860 	do {
861 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[2]);
862 par = unur_gibbs_new(distr_localcopy);
863 unur_gibbs_set_variant_random_direction(par);
864 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
865 unur_gibbs_set_c(par,-0.5);
866 	gen = unur_init(par);
867 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[2],'+');
868 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
869 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
870 	unur_free(gen);
871 	unur_distr_free(distr_localcopy);
872 	} while (0);
873 	}
874 
875 /* distribution [34] */
876 
877 	if(TRUE) {
878 	unur_reset_errno();
879 	do {
880 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[34]);
881 par = unur_gibbs_new(distr_localcopy);
882 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
883 unur_gibbs_set_burnin(par,1000);
884 	gen = unur_init(par);
885 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[34],'+');
886 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
887 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
888 	unur_free(gen);
889 	unur_distr_free(distr_localcopy);
890 	} while (0);
891 	}
892 
893 	if(TRUE) {
894 	unur_reset_errno();
895 	do {
896 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[34]);
897 par = unur_gibbs_new(distr_localcopy);
898 unur_gibbs_set_variant_random_direction(par);
899 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
900 unur_gibbs_set_burnin(par,1000);
901 	gen = unur_init(par);
902 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[34],'+');
903 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
904 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
905 	unur_free(gen);
906 	unur_distr_free(distr_localcopy);
907 	} while (0);
908 	}
909 
910 	if(fullcheck) {
911 	unur_reset_errno();
912 	do {
913 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[34]);
914 par = unur_gibbs_new(distr_localcopy);
915 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
916 unur_gibbs_set_c(par,-0.5);
917 	gen = unur_init(par);
918 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[34],'+');
919 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
920 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
921 	unur_free(gen);
922 	unur_distr_free(distr_localcopy);
923 	} while (0);
924 	}
925 
926 	if(fullcheck) {
927 	unur_reset_errno();
928 	do {
929 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[34]);
930 par = unur_gibbs_new(distr_localcopy);
931 unur_gibbs_set_variant_random_direction(par);
932 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
933 unur_gibbs_set_c(par,-0.5);
934 	gen = unur_init(par);
935 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[34],'+');
936 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
937 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
938 	unur_free(gen);
939 	unur_distr_free(distr_localcopy);
940 	} while (0);
941 	}
942 
943 /* distribution [3] */
944 
945 	if(fullcheck) {
946 	unur_reset_errno();
947 	do {
948 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[3]);
949 par = unur_gibbs_new(distr_localcopy);
950 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
951 unur_gibbs_set_burnin(par,1000);
952 	gen = unur_init(par);
953 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[3],'+');
954 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
955 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
956 	unur_free(gen);
957 	unur_distr_free(distr_localcopy);
958 	} while (0);
959 	}
960 
961 	if(fullcheck) {
962 	unur_reset_errno();
963 	do {
964 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[3]);
965 par = unur_gibbs_new(distr_localcopy);
966 unur_gibbs_set_variant_random_direction(par);
967 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
968 unur_gibbs_set_burnin(par,1000);
969 	gen = unur_init(par);
970 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[3],'+');
971 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
972 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
973 	unur_free(gen);
974 	unur_distr_free(distr_localcopy);
975 	} while (0);
976 	}
977 
978 	if(fullcheck) {
979 	unur_reset_errno();
980 	do {
981 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[3]);
982 par = unur_gibbs_new(distr_localcopy);
983 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
984 unur_gibbs_set_c(par,-0.5);
985 	gen = unur_init(par);
986 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[3],'+');
987 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
988 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
989 	unur_free(gen);
990 	unur_distr_free(distr_localcopy);
991 	} while (0);
992 	}
993 
994 	if(fullcheck) {
995 	unur_reset_errno();
996 	do {
997 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[3]);
998 par = unur_gibbs_new(distr_localcopy);
999 unur_gibbs_set_variant_random_direction(par);
1000 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
1001 unur_gibbs_set_c(par,-0.5);
1002 	gen = unur_init(par);
1003 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[3],'+');
1004 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1005 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1006 	unur_free(gen);
1007 	unur_distr_free(distr_localcopy);
1008 	} while (0);
1009 	}
1010 
1011 /* distribution [4] */
1012 
1013 	if(fullcheck) {
1014 	unur_reset_errno();
1015 	do {
1016 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[4]);
1017 par = unur_gibbs_new(distr_localcopy);
1018 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
1019 unur_gibbs_set_burnin(par,1000);
1020 	gen = unur_init(par);
1021 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[4],'+');
1022 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1023 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1024 	unur_free(gen);
1025 	unur_distr_free(distr_localcopy);
1026 	} while (0);
1027 	}
1028 
1029 	if(fullcheck) {
1030 	unur_reset_errno();
1031 	do {
1032 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[4]);
1033 par = unur_gibbs_new(distr_localcopy);
1034 unur_gibbs_set_variant_random_direction(par);
1035 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
1036 unur_gibbs_set_burnin(par,1000);
1037 	gen = unur_init(par);
1038 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[4],'+');
1039 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1040 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1041 	unur_free(gen);
1042 	unur_distr_free(distr_localcopy);
1043 	} while (0);
1044 	}
1045 
1046 	if(fullcheck) {
1047 	unur_reset_errno();
1048 	do {
1049 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[4]);
1050 par = unur_gibbs_new(distr_localcopy);
1051 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
1052 unur_gibbs_set_c(par,-0.5);
1053 	gen = unur_init(par);
1054 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[4],'+');
1055 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1056 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1057 	unur_free(gen);
1058 	unur_distr_free(distr_localcopy);
1059 	} while (0);
1060 	}
1061 
1062 	if(fullcheck) {
1063 	unur_reset_errno();
1064 	do {
1065 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[4]);
1066 par = unur_gibbs_new(distr_localcopy);
1067 unur_gibbs_set_variant_random_direction(par);
1068 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
1069 unur_gibbs_set_c(par,-0.5);
1070 	gen = unur_init(par);
1071 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[4],'+');
1072 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1073 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1074 	unur_free(gen);
1075 	unur_distr_free(distr_localcopy);
1076 	} while (0);
1077 	}
1078 
1079 /* distribution [5] */
1080 
1081 	if(fullcheck) {
1082 	unur_reset_errno();
1083 	do {
1084 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[5]);
1085 par = unur_gibbs_new(distr_localcopy);
1086 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
1087 unur_gibbs_set_burnin(par,1000);
1088 	gen = unur_init(par);
1089 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[5],'+');
1090 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1091 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1092 	unur_free(gen);
1093 	unur_distr_free(distr_localcopy);
1094 	} while (0);
1095 	}
1096 
1097 	if(fullcheck) {
1098 	unur_reset_errno();
1099 	do {
1100 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[5]);
1101 par = unur_gibbs_new(distr_localcopy);
1102 unur_gibbs_set_variant_random_direction(par);
1103 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
1104 unur_gibbs_set_burnin(par,1000);
1105 	gen = unur_init(par);
1106 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[5],'+');
1107 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1108 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1109 	unur_free(gen);
1110 	unur_distr_free(distr_localcopy);
1111 	} while (0);
1112 	}
1113 
1114 	if(fullcheck) {
1115 	unur_reset_errno();
1116 	do {
1117 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[5]);
1118 par = unur_gibbs_new(distr_localcopy);
1119 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
1120 unur_gibbs_set_c(par,-0.5);
1121 	gen = unur_init(par);
1122 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[5],'+');
1123 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1124 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1125 	unur_free(gen);
1126 	unur_distr_free(distr_localcopy);
1127 	} while (0);
1128 	}
1129 
1130 	if(fullcheck) {
1131 	unur_reset_errno();
1132 	do {
1133 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[5]);
1134 par = unur_gibbs_new(distr_localcopy);
1135 unur_gibbs_set_variant_random_direction(par);
1136 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
1137 unur_gibbs_set_c(par,-0.5);
1138 	gen = unur_init(par);
1139 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[5],'+');
1140 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1141 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1142 	unur_free(gen);
1143 	unur_distr_free(distr_localcopy);
1144 	} while (0);
1145 	}
1146 
1147 /* distribution [6] */
1148 
1149 	if(fullcheck) {
1150 	unur_reset_errno();
1151 	do {
1152 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[6]);
1153 par = unur_gibbs_new(distr_localcopy);
1154 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
1155 unur_gibbs_set_burnin(par,1000);
1156 	gen = unur_init(par);
1157 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[6],'+');
1158 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1159 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1160 	unur_free(gen);
1161 	unur_distr_free(distr_localcopy);
1162 	} while (0);
1163 	}
1164 
1165 	if(fullcheck) {
1166 	unur_reset_errno();
1167 	do {
1168 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[6]);
1169 par = unur_gibbs_new(distr_localcopy);
1170 unur_gibbs_set_variant_random_direction(par);
1171 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
1172 unur_gibbs_set_burnin(par,1000);
1173 	gen = unur_init(par);
1174 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[6],'+');
1175 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1176 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1177 	unur_free(gen);
1178 	unur_distr_free(distr_localcopy);
1179 	} while (0);
1180 	}
1181 
1182 	if(fullcheck) {
1183 	printf("."); fflush(stdout);
1184 	}
1185 
1186 	if(fullcheck) {
1187 	printf("."); fflush(stdout);
1188 	}
1189 
1190 /* distribution [7] */
1191 
1192 	if(fullcheck) {
1193 	unur_reset_errno();
1194 	do {
1195 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[7]);
1196 par = unur_gibbs_new(distr_localcopy);
1197 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
1198 unur_gibbs_set_burnin(par,1000);
1199 	gen = unur_init(par);
1200 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[7],'+');
1201 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1202 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1203 	unur_free(gen);
1204 	unur_distr_free(distr_localcopy);
1205 	} while (0);
1206 	}
1207 
1208 	if(fullcheck) {
1209 	unur_reset_errno();
1210 	do {
1211 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[7]);
1212 par = unur_gibbs_new(distr_localcopy);
1213 unur_gibbs_set_variant_random_direction(par);
1214 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
1215 unur_gibbs_set_burnin(par,1000);
1216 	gen = unur_init(par);
1217 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[7],'+');
1218 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1219 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1220 	unur_free(gen);
1221 	unur_distr_free(distr_localcopy);
1222 	} while (0);
1223 	}
1224 
1225 	if(fullcheck) {
1226 	printf("."); fflush(stdout);
1227 	}
1228 
1229 	if(fullcheck) {
1230 	printf("."); fflush(stdout);
1231 	}
1232 
1233 /* distribution [8] */
1234 
1235 	if(fullcheck) {
1236 	unur_reset_errno();
1237 	do {
1238 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[8]);
1239 par = unur_gibbs_new(distr_localcopy);
1240 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
1241 unur_gibbs_set_burnin(par,1000);
1242 	gen = unur_init(par);
1243 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[8],'+');
1244 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1245 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1246 	unur_free(gen);
1247 	unur_distr_free(distr_localcopy);
1248 	} while (0);
1249 	}
1250 
1251 	if(fullcheck) {
1252 	unur_reset_errno();
1253 	do {
1254 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[8]);
1255 par = unur_gibbs_new(distr_localcopy);
1256 unur_gibbs_set_variant_random_direction(par);
1257 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
1258 unur_gibbs_set_burnin(par,1000);
1259 	gen = unur_init(par);
1260 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[8],'+');
1261 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1262 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1263 	unur_free(gen);
1264 	unur_distr_free(distr_localcopy);
1265 	} while (0);
1266 	}
1267 
1268 	if(fullcheck) {
1269 	printf("."); fflush(stdout);
1270 	}
1271 
1272 	if(fullcheck) {
1273 	printf("."); fflush(stdout);
1274 	}
1275 
1276 /* distribution [9] */
1277 
1278 	if(fullcheck) {
1279 	unur_reset_errno();
1280 	do {
1281 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[9]);
1282 par = unur_gibbs_new(distr_localcopy);
1283 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
1284 unur_gibbs_set_burnin(par,1000);
1285 	gen = unur_init(par);
1286 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[9],'+');
1287 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1288 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1289 	unur_free(gen);
1290 	unur_distr_free(distr_localcopy);
1291 	} while (0);
1292 	}
1293 
1294 	if(fullcheck) {
1295 	unur_reset_errno();
1296 	do {
1297 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[9]);
1298 par = unur_gibbs_new(distr_localcopy);
1299 unur_gibbs_set_variant_random_direction(par);
1300 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
1301 unur_gibbs_set_burnin(par,1000);
1302 	gen = unur_init(par);
1303 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[9],'+');
1304 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1305 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1306 	unur_free(gen);
1307 	unur_distr_free(distr_localcopy);
1308 	} while (0);
1309 	}
1310 
1311 	if(fullcheck) {
1312 	printf("."); fflush(stdout);
1313 	}
1314 
1315 	if(fullcheck) {
1316 	printf("."); fflush(stdout);
1317 	}
1318 
1319 /* distribution [10] */
1320 
1321 	if(fullcheck) {
1322 	unur_reset_errno();
1323 	do {
1324 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[10]);
1325 par = unur_gibbs_new(distr_localcopy);
1326 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
1327 unur_gibbs_set_burnin(par,1000);
1328 	gen = unur_init(par);
1329 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[10],'+');
1330 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1331 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1332 	unur_free(gen);
1333 	unur_distr_free(distr_localcopy);
1334 	} while (0);
1335 	}
1336 
1337 	if(fullcheck) {
1338 	unur_reset_errno();
1339 	do {
1340 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[10]);
1341 par = unur_gibbs_new(distr_localcopy);
1342 unur_gibbs_set_variant_random_direction(par);
1343 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
1344 unur_gibbs_set_burnin(par,1000);
1345 	gen = unur_init(par);
1346 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[10],'+');
1347 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1348 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1349 	unur_free(gen);
1350 	unur_distr_free(distr_localcopy);
1351 	} while (0);
1352 	}
1353 
1354 	if(fullcheck) {
1355 	printf("."); fflush(stdout);
1356 	}
1357 
1358 	if(fullcheck) {
1359 	printf("."); fflush(stdout);
1360 	}
1361 
1362 /* distribution [11] */
1363 
1364 	if(fullcheck) {
1365 	unur_reset_errno();
1366 	do {
1367 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[11]);
1368 par = unur_gibbs_new(distr_localcopy);
1369 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
1370 unur_gibbs_set_burnin(par,1000);
1371 	gen = unur_init(par);
1372 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[11],'+');
1373 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1374 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1375 	unur_free(gen);
1376 	unur_distr_free(distr_localcopy);
1377 	} while (0);
1378 	}
1379 
1380 	if(fullcheck) {
1381 	unur_reset_errno();
1382 	do {
1383 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[11]);
1384 par = unur_gibbs_new(distr_localcopy);
1385 unur_gibbs_set_variant_random_direction(par);
1386 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
1387 unur_gibbs_set_burnin(par,1000);
1388 	gen = unur_init(par);
1389 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[11],'+');
1390 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1391 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1392 	unur_free(gen);
1393 	unur_distr_free(distr_localcopy);
1394 	} while (0);
1395 	}
1396 
1397 	if(fullcheck) {
1398 	printf("."); fflush(stdout);
1399 	}
1400 
1401 	if(fullcheck) {
1402 	printf("."); fflush(stdout);
1403 	}
1404 
1405 /* distribution [12] */
1406 
1407 	if(fullcheck) {
1408 	unur_reset_errno();
1409 	do {
1410 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[12]);
1411 par = unur_gibbs_new(distr_localcopy);
1412 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
1413 unur_gibbs_set_burnin(par,1000);
1414 	gen = unur_init(par);
1415 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[12],'+');
1416 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1417 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1418 	unur_free(gen);
1419 	unur_distr_free(distr_localcopy);
1420 	} while (0);
1421 	}
1422 
1423 	if(fullcheck) {
1424 	unur_reset_errno();
1425 	do {
1426 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[12]);
1427 par = unur_gibbs_new(distr_localcopy);
1428 unur_gibbs_set_variant_random_direction(par);
1429 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
1430 unur_gibbs_set_burnin(par,1000);
1431 	gen = unur_init(par);
1432 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[12],'+');
1433 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1434 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1435 	unur_free(gen);
1436 	unur_distr_free(distr_localcopy);
1437 	} while (0);
1438 	}
1439 
1440 	if(fullcheck) {
1441 	unur_reset_errno();
1442 	do {
1443 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[12]);
1444 par = unur_gibbs_new(distr_localcopy);
1445 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
1446 unur_gibbs_set_c(par,-0.5);
1447 	gen = unur_init(par);
1448 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[12],'+');
1449 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1450 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1451 	unur_free(gen);
1452 	unur_distr_free(distr_localcopy);
1453 	} while (0);
1454 	}
1455 
1456 	if(fullcheck) {
1457 	unur_reset_errno();
1458 	do {
1459 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[12]);
1460 par = unur_gibbs_new(distr_localcopy);
1461 unur_gibbs_set_variant_random_direction(par);
1462 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
1463 unur_gibbs_set_c(par,-0.5);
1464 	gen = unur_init(par);
1465 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[12],'+');
1466 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1467 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1468 	unur_free(gen);
1469 	unur_distr_free(distr_localcopy);
1470 	} while (0);
1471 	}
1472 
1473 /* distribution [13] */
1474 
1475 	if(fullcheck) {
1476 	unur_reset_errno();
1477 	do {
1478 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[13]);
1479 par = unur_gibbs_new(distr_localcopy);
1480 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
1481 unur_gibbs_set_burnin(par,1000);
1482 	gen = unur_init(par);
1483 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[13],'+');
1484 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1485 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1486 	unur_free(gen);
1487 	unur_distr_free(distr_localcopy);
1488 	} while (0);
1489 	}
1490 
1491 	if(fullcheck) {
1492 	unur_reset_errno();
1493 	do {
1494 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[13]);
1495 par = unur_gibbs_new(distr_localcopy);
1496 unur_gibbs_set_variant_random_direction(par);
1497 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
1498 unur_gibbs_set_burnin(par,1000);
1499 	gen = unur_init(par);
1500 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[13],'+');
1501 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1502 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1503 	unur_free(gen);
1504 	unur_distr_free(distr_localcopy);
1505 	} while (0);
1506 	}
1507 
1508 	if(fullcheck) {
1509 	printf("."); fflush(stdout);
1510 	}
1511 
1512 	if(fullcheck) {
1513 	printf("."); fflush(stdout);
1514 	}
1515 
1516 /* distribution [14] */
1517 
1518 	if(fullcheck) {
1519 	unur_reset_errno();
1520 	do {
1521 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[14]);
1522 par = unur_gibbs_new(distr_localcopy);
1523 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
1524 unur_gibbs_set_burnin(par,1000);
1525 	gen = unur_init(par);
1526 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[14],'+');
1527 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1528 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1529 	unur_free(gen);
1530 	unur_distr_free(distr_localcopy);
1531 	} while (0);
1532 	}
1533 
1534 	if(fullcheck) {
1535 	unur_reset_errno();
1536 	do {
1537 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[14]);
1538 par = unur_gibbs_new(distr_localcopy);
1539 unur_gibbs_set_variant_random_direction(par);
1540 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
1541 unur_gibbs_set_burnin(par,1000);
1542 	gen = unur_init(par);
1543 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[14],'+');
1544 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1545 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1546 	unur_free(gen);
1547 	unur_distr_free(distr_localcopy);
1548 	} while (0);
1549 	}
1550 
1551 	if(fullcheck) {
1552 	printf("."); fflush(stdout);
1553 	}
1554 
1555 	if(fullcheck) {
1556 	printf("."); fflush(stdout);
1557 	}
1558 
1559 /* distribution [15] */
1560 
1561 	if(fullcheck) {
1562 	unur_reset_errno();
1563 	do {
1564 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[15]);
1565 par = unur_gibbs_new(distr_localcopy);
1566 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
1567 unur_gibbs_set_burnin(par,1000);
1568 	gen = unur_init(par);
1569 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[15],'+');
1570 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1571 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1572 	unur_free(gen);
1573 	unur_distr_free(distr_localcopy);
1574 	} while (0);
1575 	}
1576 
1577 	if(fullcheck) {
1578 	unur_reset_errno();
1579 	do {
1580 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[15]);
1581 par = unur_gibbs_new(distr_localcopy);
1582 unur_gibbs_set_variant_random_direction(par);
1583 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
1584 unur_gibbs_set_burnin(par,1000);
1585 	gen = unur_init(par);
1586 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[15],'+');
1587 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1588 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1589 	unur_free(gen);
1590 	unur_distr_free(distr_localcopy);
1591 	} while (0);
1592 	}
1593 
1594 	if(fullcheck) {
1595 	unur_reset_errno();
1596 	do {
1597 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[15]);
1598 par = unur_gibbs_new(distr_localcopy);
1599 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
1600 unur_gibbs_set_c(par,-0.5);
1601 	gen = unur_init(par);
1602 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[15],'+');
1603 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1604 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1605 	unur_free(gen);
1606 	unur_distr_free(distr_localcopy);
1607 	} while (0);
1608 	}
1609 
1610 	if(fullcheck) {
1611 	unur_reset_errno();
1612 	do {
1613 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[15]);
1614 par = unur_gibbs_new(distr_localcopy);
1615 unur_gibbs_set_variant_random_direction(par);
1616 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
1617 unur_gibbs_set_c(par,-0.5);
1618 	gen = unur_init(par);
1619 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[15],'+');
1620 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1621 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1622 	unur_free(gen);
1623 	unur_distr_free(distr_localcopy);
1624 	} while (0);
1625 	}
1626 
1627 /* distribution [16] */
1628 
1629 	if(fullcheck) {
1630 	unur_reset_errno();
1631 	do {
1632 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[16]);
1633 par = unur_gibbs_new(distr_localcopy);
1634 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
1635 unur_gibbs_set_burnin(par,1000);
1636 	gen = unur_init(par);
1637 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[16],'+');
1638 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1639 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1640 	unur_free(gen);
1641 	unur_distr_free(distr_localcopy);
1642 	} while (0);
1643 	}
1644 
1645 	if(fullcheck) {
1646 	unur_reset_errno();
1647 	do {
1648 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[16]);
1649 par = unur_gibbs_new(distr_localcopy);
1650 unur_gibbs_set_variant_random_direction(par);
1651 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
1652 unur_gibbs_set_burnin(par,1000);
1653 	gen = unur_init(par);
1654 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[16],'+');
1655 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1656 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1657 	unur_free(gen);
1658 	unur_distr_free(distr_localcopy);
1659 	} while (0);
1660 	}
1661 
1662 	if(fullcheck) {
1663 	printf("."); fflush(stdout);
1664 	}
1665 
1666 	if(fullcheck) {
1667 	printf("."); fflush(stdout);
1668 	}
1669 
1670 /* distribution [17] */
1671 
1672 	if(TRUE) {
1673 	unur_reset_errno();
1674 	do {
1675 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[17]);
1676 par = unur_gibbs_new(distr_localcopy);
1677 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
1678 unur_gibbs_set_burnin(par,1000);
1679 	gen = unur_init(par);
1680 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[17],'0');
1681 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1682 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1683 	unur_free(gen);
1684 	unur_distr_free(distr_localcopy);
1685 	} while (0);
1686 	}
1687 
1688 	if(TRUE) {
1689 	unur_reset_errno();
1690 	do {
1691 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[17]);
1692 par = unur_gibbs_new(distr_localcopy);
1693 unur_gibbs_set_variant_random_direction(par);
1694 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
1695 unur_gibbs_set_burnin(par,1000);
1696 	gen = unur_init(par);
1697 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[17],'0');
1698 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1699 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1700 	unur_free(gen);
1701 	unur_distr_free(distr_localcopy);
1702 	} while (0);
1703 	}
1704 
1705 	if(TRUE) {
1706 	unur_reset_errno();
1707 	do {
1708 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[17]);
1709 par = unur_gibbs_new(distr_localcopy);
1710 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
1711 unur_gibbs_set_c(par,-0.5);
1712 	gen = unur_init(par);
1713 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[17],'+');
1714 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1715 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1716 	unur_free(gen);
1717 	unur_distr_free(distr_localcopy);
1718 	} while (0);
1719 	}
1720 
1721 	if(TRUE) {
1722 	unur_reset_errno();
1723 	do {
1724 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[17]);
1725 par = unur_gibbs_new(distr_localcopy);
1726 unur_gibbs_set_variant_random_direction(par);
1727 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
1728 unur_gibbs_set_c(par,-0.5);
1729 	gen = unur_init(par);
1730 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[17],'+');
1731 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1732 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1733 	unur_free(gen);
1734 	unur_distr_free(distr_localcopy);
1735 	} while (0);
1736 	}
1737 
1738 /* distribution [18] */
1739 
1740 	if(TRUE) {
1741 	unur_reset_errno();
1742 	do {
1743 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[18]);
1744 par = unur_gibbs_new(distr_localcopy);
1745 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
1746 unur_gibbs_set_burnin(par,1000);
1747 	gen = unur_init(par);
1748 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[18],'0');
1749 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1750 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1751 	unur_free(gen);
1752 	unur_distr_free(distr_localcopy);
1753 	} while (0);
1754 	}
1755 
1756 	if(TRUE) {
1757 	unur_reset_errno();
1758 	do {
1759 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[18]);
1760 par = unur_gibbs_new(distr_localcopy);
1761 unur_gibbs_set_variant_random_direction(par);
1762 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
1763 unur_gibbs_set_burnin(par,1000);
1764 	gen = unur_init(par);
1765 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[18],'0');
1766 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1767 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1768 	unur_free(gen);
1769 	unur_distr_free(distr_localcopy);
1770 	} while (0);
1771 	}
1772 
1773 	if(TRUE) {
1774 	unur_reset_errno();
1775 	do {
1776 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[18]);
1777 par = unur_gibbs_new(distr_localcopy);
1778 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
1779 unur_gibbs_set_c(par,-0.5);
1780 	gen = unur_init(par);
1781 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[18],'+');
1782 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1783 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1784 	unur_free(gen);
1785 	unur_distr_free(distr_localcopy);
1786 	} while (0);
1787 	}
1788 
1789 	if(TRUE) {
1790 	unur_reset_errno();
1791 	do {
1792 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[18]);
1793 par = unur_gibbs_new(distr_localcopy);
1794 unur_gibbs_set_variant_random_direction(par);
1795 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
1796 unur_gibbs_set_c(par,-0.5);
1797 	gen = unur_init(par);
1798 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[18],'+');
1799 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1800 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1801 	unur_free(gen);
1802 	unur_distr_free(distr_localcopy);
1803 	} while (0);
1804 	}
1805 
1806 /* distribution [19] */
1807 
1808 	if(TRUE) {
1809 	unur_reset_errno();
1810 	do {
1811 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[19]);
1812 par = unur_gibbs_new(distr_localcopy);
1813 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
1814 unur_gibbs_set_burnin(par,1000);
1815 	gen = unur_init(par);
1816 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[19],'0');
1817 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1818 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1819 	unur_free(gen);
1820 	unur_distr_free(distr_localcopy);
1821 	} while (0);
1822 	}
1823 
1824 	if(TRUE) {
1825 	unur_reset_errno();
1826 	do {
1827 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[19]);
1828 par = unur_gibbs_new(distr_localcopy);
1829 unur_gibbs_set_variant_random_direction(par);
1830 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
1831 unur_gibbs_set_burnin(par,1000);
1832 	gen = unur_init(par);
1833 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[19],'0');
1834 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1835 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1836 	unur_free(gen);
1837 	unur_distr_free(distr_localcopy);
1838 	} while (0);
1839 	}
1840 
1841 	if(TRUE) {
1842 	unur_reset_errno();
1843 	do {
1844 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[19]);
1845 par = unur_gibbs_new(distr_localcopy);
1846 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
1847 unur_gibbs_set_c(par,-0.5);
1848 	gen = unur_init(par);
1849 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[19],'+');
1850 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1851 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1852 	unur_free(gen);
1853 	unur_distr_free(distr_localcopy);
1854 	} while (0);
1855 	}
1856 
1857 	if(TRUE) {
1858 	unur_reset_errno();
1859 	do {
1860 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[19]);
1861 par = unur_gibbs_new(distr_localcopy);
1862 unur_gibbs_set_variant_random_direction(par);
1863 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
1864 unur_gibbs_set_c(par,-0.5);
1865 	gen = unur_init(par);
1866 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[19],'+');
1867 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1868 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1869 	unur_free(gen);
1870 	unur_distr_free(distr_localcopy);
1871 	} while (0);
1872 	}
1873 
1874 /* distribution [20] */
1875 
1876 	if(fullcheck) {
1877 	unur_reset_errno();
1878 	do {
1879 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[20]);
1880 par = unur_gibbs_new(distr_localcopy);
1881 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
1882 unur_gibbs_set_burnin(par,1000);
1883 	gen = unur_init(par);
1884 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[20],'0');
1885 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1886 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1887 	unur_free(gen);
1888 	unur_distr_free(distr_localcopy);
1889 	} while (0);
1890 	}
1891 
1892 	if(fullcheck) {
1893 	unur_reset_errno();
1894 	do {
1895 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[20]);
1896 par = unur_gibbs_new(distr_localcopy);
1897 unur_gibbs_set_variant_random_direction(par);
1898 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
1899 unur_gibbs_set_burnin(par,1000);
1900 	gen = unur_init(par);
1901 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[20],'0');
1902 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1903 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1904 	unur_free(gen);
1905 	unur_distr_free(distr_localcopy);
1906 	} while (0);
1907 	}
1908 
1909 	if(fullcheck) {
1910 	unur_reset_errno();
1911 	do {
1912 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[20]);
1913 par = unur_gibbs_new(distr_localcopy);
1914 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
1915 unur_gibbs_set_c(par,-0.5);
1916 	gen = unur_init(par);
1917 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[20],'+');
1918 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1919 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1920 	unur_free(gen);
1921 	unur_distr_free(distr_localcopy);
1922 	} while (0);
1923 	}
1924 
1925 	if(fullcheck) {
1926 	unur_reset_errno();
1927 	do {
1928 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[20]);
1929 par = unur_gibbs_new(distr_localcopy);
1930 unur_gibbs_set_variant_random_direction(par);
1931 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
1932 unur_gibbs_set_c(par,-0.5);
1933 	gen = unur_init(par);
1934 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[20],'+');
1935 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1936 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1937 	unur_free(gen);
1938 	unur_distr_free(distr_localcopy);
1939 	} while (0);
1940 	}
1941 
1942 /* distribution [21] */
1943 
1944 	if(fullcheck) {
1945 	unur_reset_errno();
1946 	do {
1947 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[21]);
1948 par = unur_gibbs_new(distr_localcopy);
1949 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
1950 unur_gibbs_set_burnin(par,1000);
1951 	gen = unur_init(par);
1952 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[21],'0');
1953 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1954 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1955 	unur_free(gen);
1956 	unur_distr_free(distr_localcopy);
1957 	} while (0);
1958 	}
1959 
1960 	if(fullcheck) {
1961 	unur_reset_errno();
1962 	do {
1963 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[21]);
1964 par = unur_gibbs_new(distr_localcopy);
1965 unur_gibbs_set_variant_random_direction(par);
1966 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
1967 unur_gibbs_set_burnin(par,1000);
1968 	gen = unur_init(par);
1969 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[21],'0');
1970 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1971 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1972 	unur_free(gen);
1973 	unur_distr_free(distr_localcopy);
1974 	} while (0);
1975 	}
1976 
1977 	if(fullcheck) {
1978 	unur_reset_errno();
1979 	do {
1980 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[21]);
1981 par = unur_gibbs_new(distr_localcopy);
1982 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
1983 unur_gibbs_set_c(par,-0.5);
1984 	gen = unur_init(par);
1985 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[21],'+');
1986 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1987 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1988 	unur_free(gen);
1989 	unur_distr_free(distr_localcopy);
1990 	} while (0);
1991 	}
1992 
1993 	if(fullcheck) {
1994 	unur_reset_errno();
1995 	do {
1996 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[21]);
1997 par = unur_gibbs_new(distr_localcopy);
1998 unur_gibbs_set_variant_random_direction(par);
1999 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
2000 unur_gibbs_set_c(par,-0.5);
2001 	gen = unur_init(par);
2002 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[21],'+');
2003 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
2004 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
2005 	unur_free(gen);
2006 	unur_distr_free(distr_localcopy);
2007 	} while (0);
2008 	}
2009 
2010 /* distribution [22] */
2011 
2012 	if(fullcheck) {
2013 	unur_reset_errno();
2014 	do {
2015 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[22]);
2016 par = unur_gibbs_new(distr_localcopy);
2017 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
2018 unur_gibbs_set_burnin(par,1000);
2019 	gen = unur_init(par);
2020 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[22],'0');
2021 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
2022 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
2023 	unur_free(gen);
2024 	unur_distr_free(distr_localcopy);
2025 	} while (0);
2026 	}
2027 
2028 	if(fullcheck) {
2029 	unur_reset_errno();
2030 	do {
2031 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[22]);
2032 par = unur_gibbs_new(distr_localcopy);
2033 unur_gibbs_set_variant_random_direction(par);
2034 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
2035 unur_gibbs_set_burnin(par,1000);
2036 	gen = unur_init(par);
2037 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[22],'0');
2038 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
2039 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
2040 	unur_free(gen);
2041 	unur_distr_free(distr_localcopy);
2042 	} while (0);
2043 	}
2044 
2045 	if(fullcheck) {
2046 	unur_reset_errno();
2047 	do {
2048 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[22]);
2049 par = unur_gibbs_new(distr_localcopy);
2050 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
2051 unur_gibbs_set_c(par,-0.5);
2052 	gen = unur_init(par);
2053 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[22],'+');
2054 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
2055 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
2056 	unur_free(gen);
2057 	unur_distr_free(distr_localcopy);
2058 	} while (0);
2059 	}
2060 
2061 	if(fullcheck) {
2062 	unur_reset_errno();
2063 	do {
2064 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[22]);
2065 par = unur_gibbs_new(distr_localcopy);
2066 unur_gibbs_set_variant_random_direction(par);
2067 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
2068 unur_gibbs_set_c(par,-0.5);
2069 	gen = unur_init(par);
2070 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[22],'+');
2071 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
2072 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
2073 	unur_free(gen);
2074 	unur_distr_free(distr_localcopy);
2075 	} while (0);
2076 	}
2077 
2078 /* distribution [23] */
2079 
2080 	if(fullcheck) {
2081 	unur_reset_errno();
2082 	do {
2083 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[23]);
2084 par = unur_gibbs_new(distr_localcopy);
2085 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
2086 unur_gibbs_set_burnin(par,1000);
2087 	gen = unur_init(par);
2088 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[23],'0');
2089 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
2090 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
2091 	unur_free(gen);
2092 	unur_distr_free(distr_localcopy);
2093 	} while (0);
2094 	}
2095 
2096 	if(fullcheck) {
2097 	unur_reset_errno();
2098 	do {
2099 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[23]);
2100 par = unur_gibbs_new(distr_localcopy);
2101 unur_gibbs_set_variant_random_direction(par);
2102 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
2103 unur_gibbs_set_burnin(par,1000);
2104 	gen = unur_init(par);
2105 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[23],'0');
2106 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
2107 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
2108 	unur_free(gen);
2109 	unur_distr_free(distr_localcopy);
2110 	} while (0);
2111 	}
2112 
2113 	if(fullcheck) {
2114 	unur_reset_errno();
2115 	do {
2116 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[23]);
2117 par = unur_gibbs_new(distr_localcopy);
2118 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
2119 unur_gibbs_set_c(par,-0.5);
2120 	gen = unur_init(par);
2121 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[23],'+');
2122 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
2123 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
2124 	unur_free(gen);
2125 	unur_distr_free(distr_localcopy);
2126 	} while (0);
2127 	}
2128 
2129 	if(fullcheck) {
2130 	unur_reset_errno();
2131 	do {
2132 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[23]);
2133 par = unur_gibbs_new(distr_localcopy);
2134 unur_gibbs_set_variant_random_direction(par);
2135 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
2136 unur_gibbs_set_c(par,-0.5);
2137 	gen = unur_init(par);
2138 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[23],'+');
2139 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
2140 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
2141 	unur_free(gen);
2142 	unur_distr_free(distr_localcopy);
2143 	} while (0);
2144 	}
2145 
2146 /* distribution [24] */
2147 
2148 	if(TRUE) {
2149 	unur_reset_errno();
2150 	do {
2151 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[24]);
2152 par = unur_gibbs_new(distr_localcopy);
2153 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
2154 unur_gibbs_set_burnin(par,1000);
2155 	gen = unur_init(par);
2156 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[24],'0');
2157 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
2158 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
2159 	unur_free(gen);
2160 	unur_distr_free(distr_localcopy);
2161 	} while (0);
2162 	}
2163 
2164 	if(TRUE) {
2165 	unur_reset_errno();
2166 	do {
2167 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[24]);
2168 par = unur_gibbs_new(distr_localcopy);
2169 unur_gibbs_set_variant_random_direction(par);
2170 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
2171 unur_gibbs_set_burnin(par,1000);
2172 	gen = unur_init(par);
2173 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[24],'0');
2174 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
2175 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
2176 	unur_free(gen);
2177 	unur_distr_free(distr_localcopy);
2178 	} while (0);
2179 	}
2180 
2181 	if(TRUE) {
2182 	unur_reset_errno();
2183 	do {
2184 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[24]);
2185 par = unur_gibbs_new(distr_localcopy);
2186 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
2187 unur_gibbs_set_c(par,-0.5);
2188 	gen = unur_init(par);
2189 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[24],'+');
2190 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
2191 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
2192 	unur_free(gen);
2193 	unur_distr_free(distr_localcopy);
2194 	} while (0);
2195 	}
2196 
2197 	if(TRUE) {
2198 	unur_reset_errno();
2199 	do {
2200 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[24]);
2201 par = unur_gibbs_new(distr_localcopy);
2202 unur_gibbs_set_variant_random_direction(par);
2203 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
2204 unur_gibbs_set_c(par,-0.5);
2205 	gen = unur_init(par);
2206 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[24],'+');
2207 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
2208 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
2209 	unur_free(gen);
2210 	unur_distr_free(distr_localcopy);
2211 	} while (0);
2212 	}
2213 
2214 /* distribution [25] */
2215 
2216 	if(fullcheck) {
2217 	unur_reset_errno();
2218 	do {
2219 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[25]);
2220 par = unur_gibbs_new(distr_localcopy);
2221 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
2222 unur_gibbs_set_burnin(par,1000);
2223 	gen = unur_init(par);
2224 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[25],'0');
2225 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
2226 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
2227 	unur_free(gen);
2228 	unur_distr_free(distr_localcopy);
2229 	} while (0);
2230 	}
2231 
2232 	if(fullcheck) {
2233 	unur_reset_errno();
2234 	do {
2235 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[25]);
2236 par = unur_gibbs_new(distr_localcopy);
2237 unur_gibbs_set_variant_random_direction(par);
2238 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
2239 unur_gibbs_set_burnin(par,1000);
2240 	gen = unur_init(par);
2241 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[25],'0');
2242 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
2243 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
2244 	unur_free(gen);
2245 	unur_distr_free(distr_localcopy);
2246 	} while (0);
2247 	}
2248 
2249 	if(fullcheck) {
2250 	unur_reset_errno();
2251 	do {
2252 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[25]);
2253 par = unur_gibbs_new(distr_localcopy);
2254 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
2255 unur_gibbs_set_c(par,-0.5);
2256 	gen = unur_init(par);
2257 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[25],'+');
2258 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
2259 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
2260 	unur_free(gen);
2261 	unur_distr_free(distr_localcopy);
2262 	} while (0);
2263 	}
2264 
2265 	if(fullcheck) {
2266 	unur_reset_errno();
2267 	do {
2268 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[25]);
2269 par = unur_gibbs_new(distr_localcopy);
2270 unur_gibbs_set_variant_random_direction(par);
2271 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
2272 unur_gibbs_set_c(par,-0.5);
2273 	gen = unur_init(par);
2274 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[25],'+');
2275 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
2276 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
2277 	unur_free(gen);
2278 	unur_distr_free(distr_localcopy);
2279 	} while (0);
2280 	}
2281 
2282 /* distribution [26] */
2283 
2284 	if(fullcheck) {
2285 	unur_reset_errno();
2286 	do {
2287 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[26]);
2288 par = unur_gibbs_new(distr_localcopy);
2289 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
2290 unur_gibbs_set_burnin(par,1000);
2291 	gen = unur_init(par);
2292 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[26],'0');
2293 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
2294 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
2295 	unur_free(gen);
2296 	unur_distr_free(distr_localcopy);
2297 	} while (0);
2298 	}
2299 
2300 	if(fullcheck) {
2301 	unur_reset_errno();
2302 	do {
2303 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[26]);
2304 par = unur_gibbs_new(distr_localcopy);
2305 unur_gibbs_set_variant_random_direction(par);
2306 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
2307 unur_gibbs_set_burnin(par,1000);
2308 	gen = unur_init(par);
2309 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[26],'0');
2310 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
2311 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
2312 	unur_free(gen);
2313 	unur_distr_free(distr_localcopy);
2314 	} while (0);
2315 	}
2316 
2317 	if(fullcheck) {
2318 	unur_reset_errno();
2319 	do {
2320 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[26]);
2321 par = unur_gibbs_new(distr_localcopy);
2322 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
2323 unur_gibbs_set_c(par,-0.5);
2324 	gen = unur_init(par);
2325 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[26],'+');
2326 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
2327 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
2328 	unur_free(gen);
2329 	unur_distr_free(distr_localcopy);
2330 	} while (0);
2331 	}
2332 
2333 	if(fullcheck) {
2334 	unur_reset_errno();
2335 	do {
2336 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[26]);
2337 par = unur_gibbs_new(distr_localcopy);
2338 unur_gibbs_set_variant_random_direction(par);
2339 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
2340 unur_gibbs_set_c(par,-0.5);
2341 	gen = unur_init(par);
2342 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[26],'+');
2343 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
2344 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
2345 	unur_free(gen);
2346 	unur_distr_free(distr_localcopy);
2347 	} while (0);
2348 	}
2349 
2350 /* distribution [27] */
2351 
2352 	if(fullcheck) {
2353 	unur_reset_errno();
2354 	do {
2355 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[27]);
2356 par = unur_gibbs_new(distr_localcopy);
2357 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
2358 unur_gibbs_set_burnin(par,1000);
2359 	gen = unur_init(par);
2360 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[27],'0');
2361 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
2362 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
2363 	unur_free(gen);
2364 	unur_distr_free(distr_localcopy);
2365 	} while (0);
2366 	}
2367 
2368 	if(fullcheck) {
2369 	unur_reset_errno();
2370 	do {
2371 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[27]);
2372 par = unur_gibbs_new(distr_localcopy);
2373 unur_gibbs_set_variant_random_direction(par);
2374 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
2375 unur_gibbs_set_burnin(par,1000);
2376 	gen = unur_init(par);
2377 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[27],'0');
2378 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
2379 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
2380 	unur_free(gen);
2381 	unur_distr_free(distr_localcopy);
2382 	} while (0);
2383 	}
2384 
2385 	if(fullcheck) {
2386 	unur_reset_errno();
2387 	do {
2388 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[27]);
2389 par = unur_gibbs_new(distr_localcopy);
2390 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
2391 unur_gibbs_set_c(par,-0.5);
2392 	gen = unur_init(par);
2393 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[27],'+');
2394 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
2395 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
2396 	unur_free(gen);
2397 	unur_distr_free(distr_localcopy);
2398 	} while (0);
2399 	}
2400 
2401 	if(fullcheck) {
2402 	unur_reset_errno();
2403 	do {
2404 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[27]);
2405 par = unur_gibbs_new(distr_localcopy);
2406 unur_gibbs_set_variant_random_direction(par);
2407 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
2408 unur_gibbs_set_c(par,-0.5);
2409 	gen = unur_init(par);
2410 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[27],'+');
2411 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
2412 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
2413 	unur_free(gen);
2414 	unur_distr_free(distr_localcopy);
2415 	} while (0);
2416 	}
2417 
2418 /* distribution [28] */
2419 
2420 	if(fullcheck) {
2421 	unur_reset_errno();
2422 	do {
2423 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[28]);
2424 par = unur_gibbs_new(distr_localcopy);
2425 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
2426 unur_gibbs_set_burnin(par,1000);
2427 	gen = unur_init(par);
2428 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[28],'0');
2429 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
2430 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
2431 	unur_free(gen);
2432 	unur_distr_free(distr_localcopy);
2433 	} while (0);
2434 	}
2435 
2436 	if(fullcheck) {
2437 	unur_reset_errno();
2438 	do {
2439 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[28]);
2440 par = unur_gibbs_new(distr_localcopy);
2441 unur_gibbs_set_variant_random_direction(par);
2442 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
2443 unur_gibbs_set_burnin(par,1000);
2444 	gen = unur_init(par);
2445 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[28],'0');
2446 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
2447 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
2448 	unur_free(gen);
2449 	unur_distr_free(distr_localcopy);
2450 	} while (0);
2451 	}
2452 
2453 	if(fullcheck) {
2454 	unur_reset_errno();
2455 	do {
2456 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[28]);
2457 par = unur_gibbs_new(distr_localcopy);
2458 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
2459 unur_gibbs_set_c(par,-0.5);
2460 	gen = unur_init(par);
2461 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[28],'+');
2462 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
2463 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
2464 	unur_free(gen);
2465 	unur_distr_free(distr_localcopy);
2466 	} while (0);
2467 	}
2468 
2469 	if(fullcheck) {
2470 	unur_reset_errno();
2471 	do {
2472 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[28]);
2473 par = unur_gibbs_new(distr_localcopy);
2474 unur_gibbs_set_variant_random_direction(par);
2475 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
2476 unur_gibbs_set_c(par,-0.5);
2477 	gen = unur_init(par);
2478 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[28],'+');
2479 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
2480 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
2481 	unur_free(gen);
2482 	unur_distr_free(distr_localcopy);
2483 	} while (0);
2484 	}
2485 
2486 /* distribution [29] */
2487 
2488 	if(fullcheck) {
2489 	unur_reset_errno();
2490 	do {
2491 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[29]);
2492 par = unur_gibbs_new(distr_localcopy);
2493 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
2494 unur_gibbs_set_burnin(par,1000);
2495 	gen = unur_init(par);
2496 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[29],'0');
2497 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
2498 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
2499 	unur_free(gen);
2500 	unur_distr_free(distr_localcopy);
2501 	} while (0);
2502 	}
2503 
2504 	if(fullcheck) {
2505 	unur_reset_errno();
2506 	do {
2507 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[29]);
2508 par = unur_gibbs_new(distr_localcopy);
2509 unur_gibbs_set_variant_random_direction(par);
2510 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
2511 unur_gibbs_set_burnin(par,1000);
2512 	gen = unur_init(par);
2513 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[29],'0');
2514 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
2515 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
2516 	unur_free(gen);
2517 	unur_distr_free(distr_localcopy);
2518 	} while (0);
2519 	}
2520 
2521 	if(fullcheck) {
2522 	unur_reset_errno();
2523 	do {
2524 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[29]);
2525 par = unur_gibbs_new(distr_localcopy);
2526 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
2527 unur_gibbs_set_c(par,-0.5);
2528 	gen = unur_init(par);
2529 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[29],'+');
2530 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
2531 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
2532 	unur_free(gen);
2533 	unur_distr_free(distr_localcopy);
2534 	} while (0);
2535 	}
2536 
2537 	if(fullcheck) {
2538 	unur_reset_errno();
2539 	do {
2540 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[29]);
2541 par = unur_gibbs_new(distr_localcopy);
2542 unur_gibbs_set_variant_random_direction(par);
2543 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
2544 unur_gibbs_set_c(par,-0.5);
2545 	gen = unur_init(par);
2546 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[29],'+');
2547 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
2548 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
2549 	unur_free(gen);
2550 	unur_distr_free(distr_localcopy);
2551 	} while (0);
2552 	}
2553 
2554 /* distribution [30] */
2555 
2556 	if(TRUE) {
2557 	unur_reset_errno();
2558 	do {
2559 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[30]);
2560 par = unur_gibbs_new(distr_localcopy);
2561 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
2562 unur_gibbs_set_burnin(par,1000);
2563 	gen = unur_init(par);
2564 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[30],'+');
2565 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
2566 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
2567 	unur_free(gen);
2568 	unur_distr_free(distr_localcopy);
2569 	} while (0);
2570 	}
2571 
2572 	if(TRUE) {
2573 	printf("."); fflush(stdout);
2574 	}
2575 
2576 	if(TRUE) {
2577 	unur_reset_errno();
2578 	do {
2579 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[30]);
2580 par = unur_gibbs_new(distr_localcopy);
2581 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
2582 unur_gibbs_set_c(par,-0.5);
2583 	gen = unur_init(par);
2584 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[30],'+');
2585 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
2586 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
2587 	unur_free(gen);
2588 	unur_distr_free(distr_localcopy);
2589 	} while (0);
2590 	}
2591 
2592 	if(TRUE) {
2593 	printf("."); fflush(stdout);
2594 	}
2595 
2596 /* distribution [31] */
2597 
2598 	if(TRUE) {
2599 	unur_reset_errno();
2600 	do {
2601 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[31]);
2602 par = unur_gibbs_new(distr_localcopy);
2603 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
2604 unur_gibbs_set_burnin(par,1000);
2605 	gen = unur_init(par);
2606 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[31],'+');
2607 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
2608 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
2609 	unur_free(gen);
2610 	unur_distr_free(distr_localcopy);
2611 	} while (0);
2612 	}
2613 
2614 	if(TRUE) {
2615 	printf("."); fflush(stdout);
2616 	}
2617 
2618 	if(TRUE) {
2619 	unur_reset_errno();
2620 	do {
2621 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[31]);
2622 par = unur_gibbs_new(distr_localcopy);
2623 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
2624 unur_gibbs_set_c(par,-0.5);
2625 	gen = unur_init(par);
2626 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[31],'+');
2627 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
2628 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
2629 	unur_free(gen);
2630 	unur_distr_free(distr_localcopy);
2631 	} while (0);
2632 	}
2633 
2634 	if(TRUE) {
2635 	printf("."); fflush(stdout);
2636 	}
2637 
2638 /* distribution [32] */
2639 
2640 	if(fullcheck) {
2641 	unur_reset_errno();
2642 	do {
2643 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[32]);
2644 par = unur_gibbs_new(distr_localcopy);
2645 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
2646 unur_gibbs_set_burnin(par,1000);
2647 	gen = unur_init(par);
2648 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[32],'+');
2649 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
2650 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
2651 	unur_free(gen);
2652 	unur_distr_free(distr_localcopy);
2653 	} while (0);
2654 	}
2655 
2656 	if(fullcheck) {
2657 	printf("."); fflush(stdout);
2658 	}
2659 
2660 	if(fullcheck) {
2661 	unur_reset_errno();
2662 	do {
2663 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[32]);
2664 par = unur_gibbs_new(distr_localcopy);
2665 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
2666 unur_gibbs_set_c(par,-0.5);
2667 	gen = unur_init(par);
2668 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[32],'+');
2669 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
2670 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
2671 	unur_free(gen);
2672 	unur_distr_free(distr_localcopy);
2673 	} while (0);
2674 	}
2675 
2676 	if(fullcheck) {
2677 	printf("."); fflush(stdout);
2678 	}
2679 
2680 /* distribution [33] */
2681 
2682 	if(fullcheck) {
2683 	unur_reset_errno();
2684 	do {
2685 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[33]);
2686 par = unur_gibbs_new(distr_localcopy);
2687 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
2688 unur_gibbs_set_burnin(par,1000);
2689 	gen = unur_init(par);
2690 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[33],'0');
2691 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
2692 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
2693 	unur_free(gen);
2694 	unur_distr_free(distr_localcopy);
2695 	} while (0);
2696 	}
2697 
2698 	if(fullcheck) {
2699 	unur_reset_errno();
2700 	do {
2701 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[33]);
2702 par = unur_gibbs_new(distr_localcopy);
2703 unur_gibbs_set_variant_random_direction(par);
2704 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
2705 unur_gibbs_set_burnin(par,1000);
2706 	gen = unur_init(par);
2707 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[33],'0');
2708 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
2709 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
2710 	unur_free(gen);
2711 	unur_distr_free(distr_localcopy);
2712 	} while (0);
2713 	}
2714 
2715 	if(fullcheck) {
2716 	unur_reset_errno();
2717 	do {
2718 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[33]);
2719 par = unur_gibbs_new(distr_localcopy);
2720 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
2721 unur_gibbs_set_c(par,-0.5);
2722 	gen = unur_init(par);
2723 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[33],'0');
2724 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
2725 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
2726 	unur_free(gen);
2727 	unur_distr_free(distr_localcopy);
2728 	} while (0);
2729 	}
2730 
2731 	if(fullcheck) {
2732 	unur_reset_errno();
2733 	do {
2734 	UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[33]);
2735 par = unur_gibbs_new(distr_localcopy);
2736 unur_gibbs_set_variant_random_direction(par);
2737 unur_gibbs_set_thinning(par,THINNING*unur_distr_get_dim(distr_localcopy));
2738 unur_gibbs_set_c(par,-0.5);
2739 	gen = unur_init(par);
2740 	rcode = run_validate_chi2(TESTLOG,0,gen,distr[33],'0');
2741 	n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
2742 	n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
2743 	unur_free(gen);
2744 	unur_distr_free(distr_localcopy);
2745 	} while (0);
2746 	}
2747 
2748 	/* timing */
2749 	stopwatch_print(TESTLOG,"\n<*>time = %.0f ms\n", stopwatch_lap(&watch));
2750 
2751 
2752 /* free distributions */
2753 	unur_distr_free(distr[0]);
2754 	unur_distr_free(distr[1]);
2755 	unur_distr_free(distr[2]);
2756 	unur_distr_free(distr[3]);
2757 	unur_distr_free(distr[4]);
2758 	unur_distr_free(distr[5]);
2759 	unur_distr_free(distr[6]);
2760 	unur_distr_free(distr[7]);
2761 	unur_distr_free(distr[8]);
2762 	unur_distr_free(distr[9]);
2763 	unur_distr_free(distr[10]);
2764 	unur_distr_free(distr[11]);
2765 	unur_distr_free(distr[12]);
2766 	unur_distr_free(distr[13]);
2767 	unur_distr_free(distr[14]);
2768 	unur_distr_free(distr[15]);
2769 	unur_distr_free(distr[16]);
2770 	unur_distr_free(distr[17]);
2771 	unur_distr_free(distr[18]);
2772 	unur_distr_free(distr[19]);
2773 	unur_distr_free(distr[20]);
2774 	unur_distr_free(distr[21]);
2775 	unur_distr_free(distr[22]);
2776 	unur_distr_free(distr[23]);
2777 	unur_distr_free(distr[24]);
2778 	unur_distr_free(distr[25]);
2779 	unur_distr_free(distr[26]);
2780 	unur_distr_free(distr[27]);
2781 	unur_distr_free(distr[28]);
2782 	unur_distr_free(distr[29]);
2783 	unur_distr_free(distr[30]);
2784 	unur_distr_free(distr[31]);
2785 	unur_distr_free(distr[32]);
2786 	unur_distr_free(distr[33]);
2787 	unur_distr_free(distr[34]);
2788 
2789 	/* test finished */
2790 	test_ok &= (n_tests_failed>CHI2_FAILURES_TOLERATED) ? 0 : 1;
2791 	/* we accept CHI2_FAILURES_TOLERATED failures */
2792 	(n_tests_failed>CHI2_FAILURES_TOLERATED) ? printf(" ==> failed] ") : printf(" ==> ok] ");
2793 
2794 	/* prevent compiler from making useless annoying warnings */
2795 	distr[0] = NULL;
2796 	par = NULL;
2797 	gen = NULL;
2798 	darray = NULL;
2799 	fpm[0] = 0.;
2800 
2801 } /* end of test_validate */
2802 
2803 
2804 /*---------------------------------------------------------------------------*/
2805 /* run generator in verifying mode */
2806 
run_verify_generator(FILE * LOG,int line,UNUR_PAR * par)2807 void run_verify_generator( FILE *LOG, int line, UNUR_PAR *par )
2808 {
2809 	UNUR_GEN *gen;
2810 	int i;
2811 
2812 	/* switch to verifying mode */
2813 	unur_gibbs_set_verify(par,1);
2814 
2815 	/* initialize generator */
2816 	gen = unur_init( par ); abort_if_NULL(LOG, line, gen);
2817 
2818 	/* run generator */
2819 	for (i=0; i<VIOLATE_SAMPLE_SIZE; i++)
2820 		unur_sample_cont(gen);
2821 
2822 	/* destroy generator */
2823 	unur_free(gen);
2824 
2825 } /* end of run_verify_generator() */
2826 
unur_gibbs_set_verify(UNUR_PAR * par ATTRIBUTE__UNUSED,int verify ATTRIBUTE__UNUSED)2827 int unur_gibbs_set_verify(UNUR_PAR *par ATTRIBUTE__UNUSED, int verify ATTRIBUTE__UNUSED) {return 0;}
2828 
2829 /*---------------------------------------------------------------------------*/
2830 
main(void)2831 int main(void)
2832 {
2833         unsigned long seed;
2834 	char *str_seed, *str_tail;
2835 
2836 	/* start stop watch */
2837 	stopwatch_init();
2838 	stopwatch_start(&watch);
2839 
2840         /* open log file for unuran and set output stream for unuran messages */
2841         UNURANLOG = fopen( "t_gibbs_unuran.log","w" );
2842         abort_if_NULL( stderr,-1, UNURANLOG );
2843         unur_set_stream( UNURANLOG );
2844 
2845         /* open log file for testing */
2846 	TESTLOG = fopen( "t_gibbs_test.log","w" );
2847 	abort_if_NULL( stderr,-1, TESTLOG );
2848 
2849         /* seed for uniform generators */
2850 
2851 	/* seed set by environment */
2852 	str_seed = getenv("SEED");
2853 
2854 	if (str_seed != NULL) {
2855 	    seed = strtol(str_seed, &str_tail, 10);
2856 	    if (seed == 0u)
2857 		seed = 14860;
2858 	}
2859 	else {
2860 #ifdef SEED
2861 	    seed = SEED;
2862 #else
2863 	    seed = 14860;
2864 #endif
2865 	}
2866 
2867         /* seed build-in uniform generators */
2868         unur_urng_MRG31k3p_seed(NULL,seed);
2869         unur_urng_fish_seed(NULL,seed);
2870 	unur_urng_mstd_seed(NULL,seed);
2871 
2872 	/* seed uniform random number generator */
2873 #ifdef UNUR_URNG_UNURAN
2874 #  ifdef UNUR_URNG_DEFAULT_RNGSTREAM
2875 	{
2876 	        unsigned long sa[6];
2877 	        int i;
2878 	        for (i=0; i<6; i++) sa[i] = seed;
2879                 RngStream_SetPackageSeed(sa);
2880         }
2881 #  else
2882 	if (unur_urng_seed(NULL,seed) != UNUR_SUCCESS) {
2883 	        fprintf(stderr,"WARNING: Seed could not be set at random\n");
2884                 seed = ~0u;
2885 	}
2886 #  endif  /* UNUR_URNG_DEFAULT_RNGSTREAM */
2887 #endif  /* UNUR_URNG_UNURAN */
2888 
2889 	/* set default debugging flag */
2890 	unur_set_default_debug(UNUR_DEBUG_ALL);
2891 
2892         /* detect required check mode */
2893         fullcheck = (getenv("UNURANFULLCHECK")==NULL) ? FALSE : TRUE;
2894 
2895 	/* write header into log file */
2896         print_test_log_header( TESTLOG, seed, fullcheck );
2897 
2898 	/* set timer for sending SIGALRM signal */
2899 	set_alarm(TESTLOG);
2900 
2901 	/* start test */
2902 	printf("gibbs: ");
2903 
2904 	/* run tests */
2905 test_new();
2906 test_set();
2907 test_get();
2908 test_chg();
2909 test_reinit();
2910 test_sample();
2911 test_validate();
2912 
2913 
2914 	/* test finished */
2915 	printf("\n");  fflush(stdout);
2916 
2917 	/* close log files */
2918 	fprintf(TESTLOG,"\n====================================================\n\n");
2919 	if (test_ok)
2920 		fprintf(TESTLOG,"All tests PASSED.\n");
2921 	else
2922 		fprintf(TESTLOG,"Test(s) FAILED.\n");
2923 
2924 	/* timing */
2925 	stopwatch_print(TESTLOG,"\n<*>total time = %.0f ms\n\n", stopwatch_stop(&watch));
2926 
2927 	fclose(UNURANLOG);
2928 	fclose(TESTLOG);
2929 
2930 	/* free memory */
2931 	compare_free_memory();
2932 	unur_urng_free(unur_get_default_urng());
2933 	unur_urng_free(unur_get_default_urng_aux());
2934 
2935 	/* exit */
2936 	exit( (test_ok) ? EXIT_SUCCESS : EXIT_FAILURE );
2937 
2938 } /* end of main */
2939 
2940