1 /*
2 file automatically generated by make_test_files.pl
3 Tue Apr 19 14:01:03 2011
4 */
5
6 /*****************************************************************************
7 * *
8 * UNU.RAN -- Universal Non-Uniform Random number generator *
9 * *
10 *****************************************************************************/
11
12 /**
13 ** Tests for UTDR
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
40
41 /*---------------------------------------------------------------------------*/
42
43 void test_new (void);
44 void test_set (void);
45 void test_get (void);
46 void test_chg (void);
47 void test_init (void);
48 void test_reinit (void);
49 void test_sample (void);
50 void test_validate (void);
51 void test_special(void);
52
53 /*---------------------------------------------------------------------------*/
54
55
56
57 /* prototypes */
58 double pdf( double x, const UNUR_DISTR *distr );
59
60 double pdf_bimodal( double x, const UNUR_DISTR *distr );
61 double dpdf_bimodal( double x, const UNUR_DISTR *distr );
62
63 double pdf_negative( double x, const UNUR_DISTR *distr );
64 double dpdf_negative( double x, const UNUR_DISTR *distr );
65
66 double pdf_partnegative( double x, const UNUR_DISTR *distr );
67 double dpdf_partnegative( double x, const UNUR_DISTR *distr );
68
69 double pdf_sqrtlin( double x, const UNUR_DISTR *distr );
70 double dpdf_sqrtlin( double x, const UNUR_DISTR *distr );
71 double cdf_sqrtlin( double x, const UNUR_DISTR *distr );
72
73 double pdf_sqrtlinshft(double x, const UNUR_DISTR *distr );
74 double dpdf_sqrtlinshft( double x, const UNUR_DISTR *distr );
75 double cdf_sqrtlinshft( double x, const UNUR_DISTR *distr );
76
77 int unur_utdr_set_pedantic( struct unur_par *par, int pedantic );
78
79 #define COMPARE_SAMPLE_SIZE (10000)
80 #define VIOLATE_SAMPLE_SIZE (20)
81
82 /* #define SEED (2346412) */
83
84
85
86
87 /*---------------------------------------------------------------------------*/
88
89 #ifndef CHI2_FAILURES_TOLERATED
90 # define CHI2_FAILURES_TOLERATED DEFAULT_CHI2_FAILURES_TOLERATED
91 #endif
92
93 /*---------------------------------------------------------------------------*/
94 /* [verbatim] */
95
96
97
98 /* pdf of bimodal density */
pdf_bimodal(double x,const UNUR_DISTR * distr ATTRIBUTE__UNUSED)99 double pdf_bimodal( double x, const UNUR_DISTR *distr ATTRIBUTE__UNUSED)
100 {
101 return ( exp(-(x-1.)*(x-1.)) + exp(-(x+1.)*(x+1.)) );
102 }
dpdf_bimodal(double x,const UNUR_DISTR * distr ATTRIBUTE__UNUSED)103 double dpdf_bimodal( double x, const UNUR_DISTR *distr ATTRIBUTE__UNUSED)
104 {
105 return ( -2. * (x-1.) * exp(-(x-1.)*(x-1.)) -2. * (x+1.) * exp(-(x+1.)*(x+1.)) );
106 }
107
108 /* pdf with negative value */
pdf_negative(double x,const UNUR_DISTR * distr ATTRIBUTE__UNUSED)109 double pdf_negative( double x, const UNUR_DISTR *distr ATTRIBUTE__UNUSED)
110 {
111 return (-x*x);
112 }
dpdf_negative(double x,const UNUR_DISTR * distr ATTRIBUTE__UNUSED)113 double dpdf_negative( double x, const UNUR_DISTR *distr ATTRIBUTE__UNUSED)
114 {
115 return (-2.*x);
116 }
117
118 /* pdf with partial negative value */
pdf_partnegative(double x,const UNUR_DISTR * distr ATTRIBUTE__UNUSED)119 double pdf_partnegative( double x, const UNUR_DISTR *distr ATTRIBUTE__UNUSED)
120 {
121 return ((x>-0.89 && x<0.89) ? -1.: exp(-x*x));
122 }
dpdf_partnegative(double x,const UNUR_DISTR * distr ATTRIBUTE__UNUSED)123 double dpdf_partnegative( double x, const UNUR_DISTR *distr ATTRIBUTE__UNUSED)
124 {
125 return ((x>-0.89 && x<0.89) ?0.: -2.*x*exp(-x*x));
126 }
127
128 /* pdf of normal density */
pdf(double x,const UNUR_DISTR * distr ATTRIBUTE__UNUSED)129 double pdf( double x, const UNUR_DISTR *distr ATTRIBUTE__UNUSED)
130 {
131 return exp(-x*x/2.);
132 } /* end of pdf */
133
134 /* pdf with piecewise linear function as transformed density with T = -1/sqrt */
pdf_sqrtlin(double x,const UNUR_DISTR * distr ATTRIBUTE__UNUSED)135 double pdf_sqrtlin( double x, const UNUR_DISTR *distr ATTRIBUTE__UNUSED)
136 {
137 double y = 1./(fabs(x)+1.);
138 return y*y;
139 }
dpdf_sqrtlin(double x,const UNUR_DISTR * distr ATTRIBUTE__UNUSED)140 double dpdf_sqrtlin( double x, const UNUR_DISTR *distr ATTRIBUTE__UNUSED)
141 {
142 double y = 1./(fabs(x)+1.);
143 y = 2.*y*y*y;
144 return ((x<0.) ? y : - y);
145 }
cdf_sqrtlin(double x,const UNUR_DISTR * distr ATTRIBUTE__UNUSED)146 double cdf_sqrtlin( double x, const UNUR_DISTR *distr ATTRIBUTE__UNUSED)
147 {
148 if (x<=0.)
149 return 0.5/(1.-x);
150 else
151 return (1.-0.5/(1.+x));
152 }
153
154 /* pdf with piecewise linear function as transformed density with T = -1/sqrt and shifted mode */
pdf_sqrtlinshft(double x,const UNUR_DISTR * distr ATTRIBUTE__UNUSED)155 double pdf_sqrtlinshft( double x, const UNUR_DISTR *distr ATTRIBUTE__UNUSED)
156 {
157 double y;
158 x -= 1000.;
159 y = 1./(fabs(x)+1.);
160 return y*y;
161 }
dpdf_sqrtlinshft(double x,const UNUR_DISTR * distr ATTRIBUTE__UNUSED)162 double dpdf_sqrtlinshft( double x, const UNUR_DISTR *distr ATTRIBUTE__UNUSED)
163 {
164 double y;
165 x -= 1000.;
166 y = 1./(fabs(x)+1.);
167 y = 2.*y*y*y;
168 return ((x<0.) ? y : - y);
169 }
cdf_sqrtlinshft(double x,const UNUR_DISTR * distr ATTRIBUTE__UNUSED)170 double cdf_sqrtlinshft( double x, const UNUR_DISTR *distr ATTRIBUTE__UNUSED)
171 {
172 x -= 1000.;
173 if (x<=0.)
174 return 0.5/(1.-x);
175 else
176 return (1.-0.5/(1.+x));
177 }
178
179 /* dummy function */
unur_utdr_set_pedantic(struct unur_par * par ATTRIBUTE__UNUSED,int pedantic ATTRIBUTE__UNUSED)180 int unur_utdr_set_pedantic( struct unur_par *par ATTRIBUTE__UNUSED, int pedantic ATTRIBUTE__UNUSED)
181 { return 1; }
182
183
184 /*---------------------------------------------------------------------------*/
185 /* [new] */
186
test_new(void)187 void test_new (void)
188 {
189 int n_tests_failed; /* number of failed tests */
190
191 /* start test */
192 printf("[new "); fflush(stdout);
193 fprintf(TESTLOG,"\n[new]\n");
194
195 /* reset counter */
196 n_tests_failed = 0;
197
198 /* set stop watch */
199 stopwatch_lap(&watch);
200
201 { /* invalid NULL ptr */
202 UNUR_DISTR *distr = NULL;
203 distr = NULL;
204
205
206 unur_reset_errno();
207 n_tests_failed += (check_expected_NULL(TESTLOG,48,(unur_utdr_new( distr )))==UNUR_SUCCESS)?0:1;
208 n_tests_failed += (check_errorcode(TESTLOG,48,UNUR_ERR_NULL)==UNUR_SUCCESS)?0:1;
209 unur_distr_free(distr);
210 }
211
212 { /* invalid distribution type */
213 UNUR_DISTR *distr = NULL;
214 distr = unur_distr_discr_new();
215
216
217 unur_reset_errno();
218 n_tests_failed += (check_expected_NULL(TESTLOG,54,(unur_utdr_new( distr )))==UNUR_SUCCESS)?0:1;
219 n_tests_failed += (check_errorcode(TESTLOG,54,UNUR_ERR_DISTR_INVALID)==UNUR_SUCCESS)?0:1;
220 unur_distr_free(distr);
221 }
222
223 { /* data missing in distribution object */
224 UNUR_DISTR *distr = NULL;
225 distr = unur_distr_cont_new();
226
227
228 unur_reset_errno();
229 /* pdf, mode, pdfarea */
230 n_tests_failed += (check_expected_NULL(TESTLOG,61,(unur_utdr_new( distr )))==UNUR_SUCCESS)?0:1;
231 n_tests_failed += (check_errorcode(TESTLOG,61,UNUR_ERR_DISTR_REQUIRED)==UNUR_SUCCESS)?0:1;
232 unur_distr_free(distr);
233 }
234
235
236 /* timing */
237 stopwatch_print(TESTLOG,"\n<*>time = %.3f ms\n\n", stopwatch_lap(&watch));
238
239 /* test finished */
240 test_ok &= (n_tests_failed) ? 0 : 1;
241 (n_tests_failed) ? printf(" ==> failed] ") : printf(" ==> ok] ");
242
243 } /* end of test_new() */
244
245 /*---------------------------------------------------------------------------*/
246 /* [set] */
247
test_set(void)248 void test_set (void)
249 {
250 int n_tests_failed; /* number of failed tests */
251
252 /* start test */
253 printf("[set "); fflush(stdout);
254 fprintf(TESTLOG,"\n[set]\n");
255
256 /* reset counter */
257 n_tests_failed = 0;
258
259 /* set stop watch */
260 stopwatch_lap(&watch);
261
262 { /* invalid NULL ptr */
263 UNUR_PAR *par = NULL;
264 par = NULL;
265
266
267 unur_reset_errno();
268 n_tests_failed += (check_expected_setfailed(TESTLOG,71,(unur_utdr_set_verify( par, 1 )))==UNUR_SUCCESS)?0:1;
269 n_tests_failed += (check_errorcode(TESTLOG,71,UNUR_ERR_NULL)==UNUR_SUCCESS)?0:1;
270
271 unur_reset_errno();
272 n_tests_failed += (check_expected_setfailed(TESTLOG,74,(unur_utdr_set_pdfatmode(par,1.)))==UNUR_SUCCESS)?0:1;
273 n_tests_failed += (check_errorcode(TESTLOG,74,UNUR_ERR_NULL)==UNUR_SUCCESS)?0:1;
274
275 unur_reset_errno();
276 n_tests_failed += (check_expected_setfailed(TESTLOG,77,(unur_utdr_set_cpfactor(par, 1.)))==UNUR_SUCCESS)?0:1;
277 n_tests_failed += (check_errorcode(TESTLOG,77,UNUR_ERR_NULL)==UNUR_SUCCESS)?0:1;
278
279 unur_reset_errno();
280 n_tests_failed += (check_expected_setfailed(TESTLOG,80,(unur_utdr_set_deltafactor(par, 1.)))==UNUR_SUCCESS)?0:1;
281 n_tests_failed += (check_errorcode(TESTLOG,80,UNUR_ERR_NULL)==UNUR_SUCCESS)?0:1;
282 }
283
284 { /* invalid parameter object */
285 UNUR_DISTR *distr = NULL;
286 UNUR_PAR *par = NULL;
287 double fpar[2] = {0.,1.};
288 distr = unur_distr_normal(fpar,2);
289 par = unur_arou_new(distr);
290
291
292 unur_reset_errno();
293 n_tests_failed += (check_expected_setfailed(TESTLOG,90,(unur_utdr_set_verify( par, 1 )))==UNUR_SUCCESS)?0:1;
294 n_tests_failed += (check_errorcode(TESTLOG,90,UNUR_ERR_PAR_INVALID)==UNUR_SUCCESS)?0:1;
295
296 unur_reset_errno();
297 n_tests_failed += (check_expected_setfailed(TESTLOG,93,(unur_utdr_set_pdfatmode(par,1.)))==UNUR_SUCCESS)?0:1;
298 n_tests_failed += (check_errorcode(TESTLOG,93,UNUR_ERR_PAR_INVALID)==UNUR_SUCCESS)?0:1;
299
300 unur_reset_errno();
301 n_tests_failed += (check_expected_setfailed(TESTLOG,96,(unur_utdr_set_cpfactor(par, 1.)))==UNUR_SUCCESS)?0:1;
302 n_tests_failed += (check_errorcode(TESTLOG,96,UNUR_ERR_PAR_INVALID)==UNUR_SUCCESS)?0:1;
303
304 unur_reset_errno();
305 n_tests_failed += (check_expected_setfailed(TESTLOG,99,(unur_utdr_set_deltafactor(par, 1.)))==UNUR_SUCCESS)?0:1;
306 n_tests_failed += (check_errorcode(TESTLOG,99,UNUR_ERR_PAR_INVALID)==UNUR_SUCCESS)?0:1;
307 unur_par_free(par);
308 unur_distr_free(distr);
309 }
310
311 { /* invalid parameters */
312 UNUR_DISTR *distr = NULL;
313 UNUR_PAR *par = NULL;
314 double fpar[2] = {0.,1.};
315 distr = unur_distr_normal(fpar,2);
316 par = unur_utdr_new(distr);
317
318
319 unur_reset_errno();
320 n_tests_failed += (check_expected_setfailed(TESTLOG,109,(unur_utdr_set_pdfatmode(par,-1.)))==UNUR_SUCCESS)?0:1;
321 n_tests_failed += (check_errorcode(TESTLOG,109,UNUR_ERR_PAR_SET)==UNUR_SUCCESS)?0:1;
322
323 unur_reset_errno();
324 n_tests_failed += (check_expected_setfailed(TESTLOG,112,(unur_utdr_set_cpfactor(par, -1.)))==UNUR_SUCCESS)?0:1;
325 n_tests_failed += (check_errorcode(TESTLOG,112,UNUR_ERR_PAR_SET)==UNUR_SUCCESS)?0:1;
326
327 unur_reset_errno();
328 n_tests_failed += (check_expected_setfailed(TESTLOG,115,(unur_utdr_set_deltafactor(par, -1.)))==UNUR_SUCCESS)?0:1;
329 n_tests_failed += (check_errorcode(TESTLOG,115,UNUR_ERR_PAR_SET)==UNUR_SUCCESS)?0:1;
330
331 unur_reset_errno();
332 n_tests_failed += (check_expected_setfailed(TESTLOG,118,(unur_utdr_set_deltafactor(par, 1.)))==UNUR_SUCCESS)?0:1;
333 n_tests_failed += (check_errorcode(TESTLOG,118,UNUR_ERR_PAR_SET)==UNUR_SUCCESS)?0:1;
334 unur_par_free(par);
335 unur_distr_free(distr);
336 }
337
338
339 /* timing */
340 stopwatch_print(TESTLOG,"\n<*>time = %.3f ms\n\n", stopwatch_lap(&watch));
341
342 /* test finished */
343 test_ok &= (n_tests_failed) ? 0 : 1;
344 (n_tests_failed) ? printf(" ==> failed] ") : printf(" ==> ok] ");
345
346 } /* end of test_set() */
347
348 /*---------------------------------------------------------------------------*/
349 /* [chg] */
350
test_chg(void)351 void test_chg (void)
352 {
353 int n_tests_failed; /* number of failed tests */
354
355 /* start test */
356 printf("[chg "); fflush(stdout);
357 fprintf(TESTLOG,"\n[chg]\n");
358
359 /* reset counter */
360 n_tests_failed = 0;
361
362 /* set stop watch */
363 stopwatch_lap(&watch);
364
365 { /* invalid generator object */
366 UNUR_DISTR *distr = NULL;
367 UNUR_PAR *par = NULL;
368 UNUR_GEN *gen = NULL;
369 double fpar[2] = {0.,1.};
370 distr = unur_distr_normal(fpar,2);
371 par = unur_arou_new(distr);
372 unur_set_debug(par,0);
373 gen = unur_init( par );
374 abort_if_NULL(TESTLOG, 134, gen );
375
376
377 unur_reset_errno();
378 n_tests_failed += (check_expected_setfailed(TESTLOG,138,(unur_utdr_chg_verify(gen,1)))==UNUR_SUCCESS)?0:1;
379 n_tests_failed += (check_errorcode(TESTLOG,138,UNUR_ERR_GEN_INVALID)==UNUR_SUCCESS)?0:1;
380
381 unur_reset_errno();
382 n_tests_failed += (check_expected_setfailed(TESTLOG,141,(unur_utdr_chg_pdfatmode(gen,1.)))==UNUR_SUCCESS)?0:1;
383 n_tests_failed += (check_errorcode(TESTLOG,141,UNUR_ERR_GEN_INVALID)==UNUR_SUCCESS)?0:1;
384 unur_distr_free(distr);
385 unur_free(gen);
386 }
387
388 { /* invalid parameters */
389 UNUR_DISTR *distr = NULL;
390 UNUR_PAR *par = NULL;
391 UNUR_GEN *gen = NULL;
392 double fpar[2] = {2.,5.};
393 distr = unur_distr_gamma(fpar,2);
394 par = unur_utdr_new(distr);
395 gen = unur_init( par );
396 abort_if_NULL(TESTLOG, 147, gen );
397
398
399 unur_reset_errno();
400 n_tests_failed += (check_expected_setfailed(TESTLOG,151,(unur_utdr_chg_pdfatmode(gen,-1.)))==UNUR_SUCCESS)?0:1;
401 n_tests_failed += (check_errorcode(TESTLOG,151,UNUR_ERR_PAR_SET)==UNUR_SUCCESS)?0:1;
402 unur_distr_free(distr);
403 unur_free(gen);
404 }
405
406
407 /* timing */
408 stopwatch_print(TESTLOG,"\n<*>time = %.3f ms\n\n", stopwatch_lap(&watch));
409
410 /* test finished */
411 test_ok &= (n_tests_failed) ? 0 : 1;
412 (n_tests_failed) ? printf(" ==> failed] ") : printf(" ==> ok] ");
413
414 } /* end of test_chg() */
415
416 /*---------------------------------------------------------------------------*/
417 /* [init] */
418
test_init(void)419 void test_init (void)
420 {
421 int n_tests_failed; /* number of failed tests */
422
423 /* start test */
424 printf("[init "); fflush(stdout);
425 fprintf(TESTLOG,"\n[init]\n");
426
427 /* reset counter */
428 n_tests_failed = 0;
429
430 /* set stop watch */
431 stopwatch_lap(&watch);
432
433 { /* invalid NULL ptr */
434 UNUR_PAR *par = NULL;
435 par = NULL;
436
437
438 unur_reset_errno();
439 n_tests_failed += (check_expected_NULL(TESTLOG,162,(unur_init( par )))==UNUR_SUCCESS)?0:1;
440 n_tests_failed += (check_errorcode(TESTLOG,162,UNUR_ERR_NULL)==UNUR_SUCCESS)?0:1;
441 }
442
443 { /* data missing in distribution object */
444 UNUR_DISTR *distr = NULL;
445 UNUR_PAR *par = NULL;
446 distr = unur_distr_cont_new();
447 par = NULL;
448
449
450 unur_reset_errno();
451 /* mode, pdfarea */
452 unur_distr_cont_set_pdf(distr,pdf);
453 par = unur_utdr_new( distr );
454 n_tests_failed += (check_expected_NULL(TESTLOG,172,(unur_init(par)))==UNUR_SUCCESS)?0:1;
455 n_tests_failed += (check_errorcode(TESTLOG,172,UNUR_ERR_DISTR_REQUIRED)==UNUR_SUCCESS)?0:1;
456
457 unur_reset_errno();
458 /* pdfarea */
459 unur_distr_cont_set_mode(distr,1.);
460 par = unur_utdr_new( distr );
461 n_tests_failed += (check_expected_NULL(TESTLOG,178,(unur_init(par)))==UNUR_SUCCESS)?0:1;
462 n_tests_failed += (check_errorcode(TESTLOG,178,UNUR_ERR_DISTR_REQUIRED)==UNUR_SUCCESS)?0:1;
463 unur_distr_free(distr);
464 }
465
466
467 /* timing */
468 stopwatch_print(TESTLOG,"\n<*>time = %.3f ms\n\n", stopwatch_lap(&watch));
469
470 /* test finished */
471 test_ok &= (n_tests_failed) ? 0 : 1;
472 (n_tests_failed) ? printf(" ==> failed] ") : printf(" ==> ok] ");
473
474 } /* end of test_init() */
475
476 /*---------------------------------------------------------------------------*/
477 /* [reinit] */
478
test_reinit(void)479 void test_reinit (void)
480 {
481 int n_tests_failed; /* number of failed tests */
482
483 /* start test */
484 printf("[reinit "); fflush(stdout);
485 fprintf(TESTLOG,"\n[reinit]\n");
486
487 /* reset counter */
488 n_tests_failed = 0;
489
490 /* set stop watch */
491 stopwatch_lap(&watch);
492
493 { /* exist */
494 UNUR_DISTR *distr = NULL;
495 UNUR_PAR *par = NULL;
496 UNUR_GEN *gen = NULL;
497 distr = unur_distr_normal(NULL,0);
498 par = unur_utdr_new(distr);
499 gen = unur_init( par );
500 abort_if_NULL(TESTLOG, 186, gen );
501
502
503 unur_reset_errno();
504 n_tests_failed += (check_expected_reinit(TESTLOG,190,(unur_reinit( gen )))==UNUR_SUCCESS)?0:1;
505 unur_distr_free(distr);
506 unur_free(gen);
507 }
508
509
510 /* timing */
511 stopwatch_print(TESTLOG,"\n<*>time = %.3f ms\n\n", stopwatch_lap(&watch));
512
513 /* test finished */
514 test_ok &= (n_tests_failed) ? 0 : 1;
515 (n_tests_failed) ? printf(" ==> failed] ") : printf(" ==> ok] ");
516
517 } /* end of test_reinit() */
518
519 /*---------------------------------------------------------------------------*/
520 /* [sample] */
521
test_sample(void)522 void test_sample (void)
523 {
524 int n_tests_failed; /* number of failed tests */
525
526 /* start test */
527 printf("[sample "); fflush(stdout);
528 fprintf(TESTLOG,"\n[sample]\n");
529
530 /* reset counter */
531 n_tests_failed = 0;
532
533 /* set stop watch */
534 stopwatch_lap(&watch);
535
536 { /* compare */
537 UNUR_DISTR *distr = NULL;
538 UNUR_PAR *par = NULL;
539 distr = unur_distr_normal(NULL,0);
540 par = NULL;
541
542
543 unur_reset_errno();
544 /* default algorithm */
545 par = unur_utdr_new(distr);
546 n_tests_failed += (compare_sequence_par_start(TESTLOG,202,par,COMPARE_SAMPLE_SIZE)==UNUR_SUCCESS)?0:1;
547
548 unur_reset_errno();
549 /* default algorithm - verifying mode */
550 par = unur_utdr_new(distr);
551 unur_utdr_set_verify(par,1);
552 n_tests_failed += (compare_sequence_par(TESTLOG,207,par,COMPARE_SAMPLE_SIZE)==UNUR_SUCCESS)?0:1;
553 unur_distr_free(distr);
554 }
555
556 { /* compare clone */
557 UNUR_DISTR *distr = NULL;
558 UNUR_PAR *par = NULL;
559 UNUR_GEN *gen = NULL;
560 UNUR_GEN *clone;
561 distr = unur_distr_normal(NULL,0);
562 par = NULL;
563 gen = NULL;
564
565
566 unur_reset_errno();
567 /* original generator object */
568 par = unur_utdr_new(distr);
569 gen = unur_init(par);
570 n_tests_failed += (compare_sequence_gen_start(TESTLOG,220,gen,COMPARE_SAMPLE_SIZE)==UNUR_SUCCESS)?0:1;
571
572 unur_reset_errno();
573 /* clone */
574 clone = unur_gen_clone(gen);
575 unur_free(gen);
576 gen = clone;
577 n_tests_failed += (compare_sequence_gen(TESTLOG,226,gen,COMPARE_SAMPLE_SIZE)==UNUR_SUCCESS)?0:1;
578 unur_distr_free(distr);
579 unur_free(gen);
580 }
581
582 { /* compare reinit */
583 UNUR_DISTR *distr = NULL;
584 UNUR_PAR *par = NULL;
585 UNUR_GEN *gen = NULL;
586 distr = unur_distr_normal(NULL,0);
587 par = NULL;
588 gen = NULL;
589
590
591 unur_reset_errno();
592 /* original generator object */
593 par = unur_utdr_new(distr);
594 gen = unur_init(par);
595 n_tests_failed += (compare_sequence_gen_start(TESTLOG,238,gen,COMPARE_SAMPLE_SIZE)==UNUR_SUCCESS)?0:1;
596
597 unur_reset_errno();
598 /* reinit */
599 unur_reinit(gen);
600 n_tests_failed += (compare_sequence_gen(TESTLOG,242,gen,COMPARE_SAMPLE_SIZE)==UNUR_SUCCESS)?0:1;
601 unur_distr_free(distr);
602 unur_free(gen);
603 }
604
605 { /* compare stringparser */
606 UNUR_DISTR *distr = NULL;
607 UNUR_PAR *par = NULL;
608 UNUR_GEN *gen = NULL;
609 double fpar[2] = {3.,3.};
610 distr = NULL;
611 par = NULL;
612 gen = NULL;
613
614
615 unur_reset_errno();
616 distr = unur_distr_gamma(fpar,2);
617 par = unur_utdr_new(distr);
618 unur_utdr_set_cpfactor(par,0.660);
619 unur_utdr_set_deltafactor(par,1.e-4);
620 unur_utdr_set_verify(par,TRUE);
621 gen = unur_init(par);
622 n_tests_failed += (compare_sequence_gen_start(TESTLOG,258,gen,COMPARE_SAMPLE_SIZE)==UNUR_SUCCESS)?0:1;
623
624 unur_reset_errno();
625 unur_free(gen); gen = NULL;
626 unur_distr_free(distr); distr = NULL;
627 gen = unur_str2gen( "gamma(3.,3.) & \
628 method = utdr; cpfactor = 0.66; deltafactor = 1.e-4; verify" );
629 n_tests_failed += (compare_sequence_gen(TESTLOG,264,gen,COMPARE_SAMPLE_SIZE)==UNUR_SUCCESS)?0:1;
630 unur_distr_free(distr);
631 unur_free(gen);
632 }
633
634
635 /* timing */
636 stopwatch_print(TESTLOG,"\n<*>time = %.3f ms\n\n", stopwatch_lap(&watch));
637
638 /* test finished */
639 test_ok &= (n_tests_failed) ? 0 : 1;
640 (n_tests_failed) ? printf(" ==> failed] ") : printf(" ==> ok] ");
641
642 } /* end of test_sample() */
643
644 /*---------------------------------------------------------------------------*/
645 /* [validate] */
646
647 /*---------------------------------------------------------------------------*/
648
649 /* [validate] */
650
test_validate(void)651 void test_validate (void)
652 {
653 UNUR_DISTR *distr[29];
654 UNUR_PAR *par;
655 UNUR_GEN *gen;
656 int n_tests_failed;
657 int rcode;
658 double *darray;
659 double fpm[10];
660
661 rcode = 0;
662
663 /* start test */
664 printf("[validate "); fflush(stdout);
665 fprintf(TESTLOG,"\n[validate]\n");
666
667 /* reset counter */
668 n_tests_failed = 0;
669
670 /* set stop watch */
671 stopwatch_lap(&watch);
672
673
674 /* distributions: 29 */
675 {
676 fpm[0] = 1.;
677 fpm[1] = 2.;
678 distr[0] = unur_distr_beta(fpm,2);
679 }
680
681 {
682 fpm[0] = 1.;
683 fpm[1] = 5.;
684 distr[1] = unur_distr_beta(fpm,2);
685 }
686
687 {
688 fpm[0] = 1.;
689 fpm[1] = 100.;
690 distr[2] = unur_distr_beta(fpm,2);
691 }
692
693 {
694 fpm[0] = 3.;
695 fpm[1] = 4.;
696 distr[3] = unur_distr_beta(fpm,2);
697 }
698
699 {
700 fpm[0] = 5.;
701 fpm[1] = 100.;
702 distr[4] = unur_distr_beta(fpm,2);
703 }
704
705 {
706 fpm[0] = 500.;
707 fpm[1] = 300.;
708 distr[5] = unur_distr_beta(fpm,2);
709 }
710
711 {
712 fpm[0] = 5.;
713 fpm[1] = 10.;
714 fpm[2] = -3.;
715 fpm[3] = 15.;
716 distr[6] = unur_distr_beta(fpm,4);
717 }
718
719 {
720 distr[7] = unur_distr_cauchy(NULL,0);
721 }
722
723 {
724 fpm[0] = 1.;
725 fpm[1] = 20.;
726 distr[8] = unur_distr_cauchy(fpm,2);
727 }
728
729 {
730 distr[23] = unur_distr_exponential(NULL,0);
731 }
732
733 {
734 fpm[0] = 30.;
735 fpm[1] = -5.;
736 distr[24] = unur_distr_exponential(fpm,2);
737 }
738
739 {
740 fpm[0] = 1.;
741 distr[9] = unur_distr_gamma(fpm,1);
742 }
743
744 {
745 fpm[0] = 2.;
746 distr[10] = unur_distr_gamma(fpm,1);
747 }
748
749 {
750 fpm[0] = 3.;
751 distr[11] = unur_distr_gamma(fpm,1);
752 }
753
754 {
755 fpm[0] = 10.;
756 distr[12] = unur_distr_gamma(fpm,1);
757 }
758
759 {
760 fpm[0] = 1000.;
761 distr[13] = unur_distr_gamma(fpm,1);
762 }
763
764 {
765 fpm[0] = 5.;
766 fpm[1] = 1000.;
767 distr[14] = unur_distr_gamma(fpm,2);
768 }
769
770 {
771 fpm[0] = 5.;
772 fpm[1] = 1.e-5;
773 distr[15] = unur_distr_gamma(fpm,2);
774 }
775
776 {
777 fpm[0] = 5.;
778 fpm[1] = 10.;
779 fpm[2] = 1000;
780 distr[16] = unur_distr_gamma(fpm,3);
781 }
782
783 {
784 distr[25] = unur_distr_laplace(NULL,0);
785 }
786
787 {
788 fpm[0] = -10.;
789 fpm[1] = 100.;
790 distr[26] = unur_distr_laplace(fpm,2);
791 }
792
793 {
794 distr[17] = unur_distr_normal(NULL,0);
795 }
796
797 {
798 fpm[0] = 1.;
799 fpm[1] = 1.e-5;
800 distr[18] = unur_distr_normal(fpm,2);
801 }
802
803 {
804 fpm[0] = 0.;
805 fpm[1] = 1.e+5;
806 distr[19] = unur_distr_normal(fpm,2);
807 }
808
809 {
810 distr[20] = unur_distr_uniform(NULL,0);
811 }
812
813 {
814 fpm[0] = 1.;
815 fpm[1] = 20.;
816 distr[21] = unur_distr_uniform(fpm,2);
817 }
818
819 {
820 distr[27] = unur_distr_cont_new();
821 unur_distr_cont_set_pdf(distr[27],pdf_sqrtlin);
822 unur_distr_cont_set_dpdf(distr[27],dpdf_sqrtlin);
823 unur_distr_cont_set_cdf(distr[27],cdf_sqrtlin);
824 unur_distr_set_name(distr[27],"sqrtlin");
825 unur_distr_cont_set_mode(distr[27],0.);
826 unur_distr_cont_set_pdfarea(distr[27],2.);
827 }
828
829 {
830 distr[28] = unur_distr_cont_new();
831 unur_distr_cont_set_pdf(distr[28],pdf_sqrtlinshft);
832 unur_distr_cont_set_dpdf(distr[28],dpdf_sqrtlinshft);
833 unur_distr_cont_set_cdf(distr[28],cdf_sqrtlinshft);
834 unur_distr_set_name(distr[28],"sqrtlin");
835 unur_distr_cont_set_mode(distr[28],1000.);
836 unur_distr_cont_set_pdfarea(distr[28],2.);
837 }
838
839 {
840 distr[22] = unur_distr_cauchy(NULL,0);
841 unur_distr_cont_set_domain(distr[22],0.1,1.);
842 unur_distr_cont_upd_mode(distr[22]);
843 unur_distr_cont_upd_pdfarea(distr[22]);
844 }
845
846 /* timing */
847 stopwatch_print(TESTLOG,"\n<*>setup time = %.3f ms\n", stopwatch_lap(&watch));
848
849 printf("\n(chi^2) "); fflush(stdout);
850
851 /* chi^2 tests: 87 */
852
853 unur_set_default_debug(~UNUR_DEBUG_SAMPLE);
854 fprintf( TESTLOG,"\nChi^2 Test:\n");
855
856 /* distribution [0] */
857
858 if(fullcheck) {
859 unur_reset_errno();
860 do {
861 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[0]);
862 par = unur_utdr_new(distr_localcopy);
863 gen = unur_init(par);
864 rcode = run_validate_chi2(TESTLOG,0,gen,distr[0],'+');
865 n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
866 n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
867 unur_free(gen);
868 unur_distr_free(distr_localcopy);
869 } while (0);
870 }
871
872 if(fullcheck) {
873 unur_reset_errno();
874 do {
875 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[0]);
876 { UNUR_DISTR *dg =NULL;
877 par = unur_utdr_new(distr_localcopy);
878 gen = unur_init(par);
879 if (gen) {
880 dg = unur_get_distr(gen);
881 unur_distr_cont_set_domain(dg,0.9,0.92);
882 unur_distr_cont_upd_pdfarea(dg);
883 unur_distr_cont_upd_mode(dg);
884 unur_reinit(gen); }
885 }
886 rcode = run_validate_chi2(TESTLOG,0,gen,distr[0],'+');
887 n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
888 n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
889 unur_free(gen);
890 unur_distr_free(distr_localcopy);
891 } while (0);
892 }
893
894 if(fullcheck) {
895 unur_reset_errno();
896 do {
897 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[0]);
898 { UNUR_DISTR *dg =NULL;
899 par = unur_utdr_new(distr_localcopy);
900 fpm[0] = 1.;
901 fpm[1] = 4.;
902 gen = unur_init(par);
903 if (gen) {
904 dg = unur_get_distr(gen);
905 unur_distr_cont_set_pdfparams(dg,fpm,2);
906 unur_distr_cont_upd_pdfarea(dg);
907 unur_distr_cont_upd_mode(dg);
908 unur_reinit(gen); }
909 }
910 rcode = run_validate_chi2(TESTLOG,0,gen,distr[0],'+');
911 n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
912 n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
913 unur_free(gen);
914 unur_distr_free(distr_localcopy);
915 } while (0);
916 }
917
918 /* distribution [1] */
919
920 if(TRUE) {
921 unur_reset_errno();
922 do {
923 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[1]);
924 par = unur_utdr_new(distr_localcopy);
925 gen = unur_init(par);
926 rcode = run_validate_chi2(TESTLOG,0,gen,distr[1],'+');
927 n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
928 n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
929 unur_free(gen);
930 unur_distr_free(distr_localcopy);
931 } while (0);
932 }
933
934 if(TRUE) {
935 unur_reset_errno();
936 do {
937 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[1]);
938 { UNUR_DISTR *dg =NULL;
939 par = unur_utdr_new(distr_localcopy);
940 gen = unur_init(par);
941 if (gen) {
942 dg = unur_get_distr(gen);
943 unur_distr_cont_set_domain(dg,0.9,0.92);
944 unur_distr_cont_upd_pdfarea(dg);
945 unur_distr_cont_upd_mode(dg);
946 unur_reinit(gen); }
947 }
948 rcode = run_validate_chi2(TESTLOG,0,gen,distr[1],'+');
949 n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
950 n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
951 unur_free(gen);
952 unur_distr_free(distr_localcopy);
953 } while (0);
954 }
955
956 if(TRUE) {
957 unur_reset_errno();
958 do {
959 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[1]);
960 { UNUR_DISTR *dg =NULL;
961 par = unur_utdr_new(distr_localcopy);
962 fpm[0] = 1.;
963 fpm[1] = 4.;
964 gen = unur_init(par);
965 if (gen) {
966 dg = unur_get_distr(gen);
967 unur_distr_cont_set_pdfparams(dg,fpm,2);
968 unur_distr_cont_upd_pdfarea(dg);
969 unur_distr_cont_upd_mode(dg);
970 unur_reinit(gen); }
971 }
972 rcode = run_validate_chi2(TESTLOG,0,gen,distr[1],'+');
973 n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
974 n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
975 unur_free(gen);
976 unur_distr_free(distr_localcopy);
977 } while (0);
978 }
979
980 /* distribution [2] */
981
982 if(fullcheck) {
983 unur_reset_errno();
984 do {
985 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[2]);
986 par = unur_utdr_new(distr_localcopy);
987 gen = unur_init(par);
988 rcode = run_validate_chi2(TESTLOG,0,gen,distr[2],'+');
989 n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
990 n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
991 unur_free(gen);
992 unur_distr_free(distr_localcopy);
993 } while (0);
994 }
995
996 if(fullcheck) {
997 printf("."); fflush(stdout);
998 }
999
1000 if(fullcheck) {
1001 printf("."); fflush(stdout);
1002 }
1003
1004 /* distribution [3] */
1005
1006 if(TRUE) {
1007 unur_reset_errno();
1008 do {
1009 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[3]);
1010 par = unur_utdr_new(distr_localcopy);
1011 gen = unur_init(par);
1012 rcode = run_validate_chi2(TESTLOG,0,gen,distr[3],'+');
1013 n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1014 n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1015 unur_free(gen);
1016 unur_distr_free(distr_localcopy);
1017 } while (0);
1018 }
1019
1020 if(TRUE) {
1021 unur_reset_errno();
1022 do {
1023 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[3]);
1024 { UNUR_DISTR *dg =NULL;
1025 par = unur_utdr_new(distr_localcopy);
1026 gen = unur_init(par);
1027 if (gen) {
1028 dg = unur_get_distr(gen);
1029 unur_distr_cont_set_domain(dg,0.9,0.92);
1030 unur_distr_cont_upd_pdfarea(dg);
1031 unur_distr_cont_upd_mode(dg);
1032 unur_reinit(gen); }
1033 }
1034 rcode = run_validate_chi2(TESTLOG,0,gen,distr[3],'+');
1035 n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1036 n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1037 unur_free(gen);
1038 unur_distr_free(distr_localcopy);
1039 } while (0);
1040 }
1041
1042 if(TRUE) {
1043 unur_reset_errno();
1044 do {
1045 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[3]);
1046 { UNUR_DISTR *dg =NULL;
1047 par = unur_utdr_new(distr_localcopy);
1048 fpm[0] = 1.;
1049 fpm[1] = 4.;
1050 gen = unur_init(par);
1051 if (gen) {
1052 dg = unur_get_distr(gen);
1053 unur_distr_cont_set_pdfparams(dg,fpm,2);
1054 unur_distr_cont_upd_pdfarea(dg);
1055 unur_distr_cont_upd_mode(dg);
1056 unur_reinit(gen); }
1057 }
1058 rcode = run_validate_chi2(TESTLOG,0,gen,distr[3],'+');
1059 n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1060 n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1061 unur_free(gen);
1062 unur_distr_free(distr_localcopy);
1063 } while (0);
1064 }
1065
1066 /* distribution [4] */
1067
1068 if(TRUE) {
1069 unur_reset_errno();
1070 do {
1071 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[4]);
1072 par = unur_utdr_new(distr_localcopy);
1073 gen = unur_init(par);
1074 rcode = run_validate_chi2(TESTLOG,0,gen,distr[4],'+');
1075 n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1076 n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1077 unur_free(gen);
1078 unur_distr_free(distr_localcopy);
1079 } while (0);
1080 }
1081
1082 if(TRUE) {
1083 printf("."); fflush(stdout);
1084 }
1085
1086 if(TRUE) {
1087 printf("."); fflush(stdout);
1088 }
1089
1090 /* distribution [5] */
1091
1092 if(TRUE) {
1093 unur_reset_errno();
1094 do {
1095 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[5]);
1096 par = unur_utdr_new(distr_localcopy);
1097 gen = unur_init(par);
1098 rcode = run_validate_chi2(TESTLOG,0,gen,distr[5],'+');
1099 n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1100 n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1101 unur_free(gen);
1102 unur_distr_free(distr_localcopy);
1103 } while (0);
1104 }
1105
1106 if(TRUE) {
1107 printf("."); fflush(stdout);
1108 }
1109
1110 if(TRUE) {
1111 printf("."); fflush(stdout);
1112 }
1113
1114 /* distribution [6] */
1115
1116 if(TRUE) {
1117 unur_reset_errno();
1118 do {
1119 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[6]);
1120 par = unur_utdr_new(distr_localcopy);
1121 gen = unur_init(par);
1122 rcode = run_validate_chi2(TESTLOG,0,gen,distr[6],'+');
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(TRUE) {
1131 unur_reset_errno();
1132 do {
1133 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[6]);
1134 { UNUR_DISTR *dg =NULL;
1135 par = unur_utdr_new(distr_localcopy);
1136 gen = unur_init(par);
1137 if (gen) {
1138 dg = unur_get_distr(gen);
1139 unur_distr_cont_set_domain(dg,0.9,0.92);
1140 unur_distr_cont_upd_pdfarea(dg);
1141 unur_distr_cont_upd_mode(dg);
1142 unur_reinit(gen); }
1143 }
1144 rcode = run_validate_chi2(TESTLOG,0,gen,distr[6],'+');
1145 n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1146 n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1147 unur_free(gen);
1148 unur_distr_free(distr_localcopy);
1149 } while (0);
1150 }
1151
1152 if(TRUE) {
1153 printf("."); fflush(stdout);
1154 }
1155
1156 /* distribution [23] */
1157
1158 if(TRUE) {
1159 unur_reset_errno();
1160 do {
1161 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[23]);
1162 par = unur_utdr_new(distr_localcopy);
1163 gen = unur_init(par);
1164 rcode = run_validate_chi2(TESTLOG,0,gen,distr[23],'+');
1165 n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1166 n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1167 unur_free(gen);
1168 unur_distr_free(distr_localcopy);
1169 } while (0);
1170 }
1171
1172 if(TRUE) {
1173 unur_reset_errno();
1174 do {
1175 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[23]);
1176 { UNUR_DISTR *dg =NULL;
1177 par = unur_utdr_new(distr_localcopy);
1178 gen = unur_init(par);
1179 if (gen) {
1180 dg = unur_get_distr(gen);
1181 unur_distr_cont_set_domain(dg,0.9,0.92);
1182 unur_distr_cont_upd_pdfarea(dg);
1183 unur_distr_cont_upd_mode(dg);
1184 unur_reinit(gen); }
1185 }
1186 rcode = run_validate_chi2(TESTLOG,0,gen,distr[23],'+');
1187 n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1188 n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1189 unur_free(gen);
1190 unur_distr_free(distr_localcopy);
1191 } while (0);
1192 }
1193
1194 if(TRUE) {
1195 unur_reset_errno();
1196 do {
1197 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[23]);
1198 { UNUR_DISTR *dg =NULL;
1199 par = unur_utdr_new(distr_localcopy);
1200 fpm[0] = 1.;
1201 fpm[1] = 4.;
1202 gen = unur_init(par);
1203 if (gen) {
1204 dg = unur_get_distr(gen);
1205 unur_distr_cont_set_pdfparams(dg,fpm,2);
1206 unur_distr_cont_upd_pdfarea(dg);
1207 unur_distr_cont_upd_mode(dg);
1208 unur_reinit(gen); }
1209 }
1210 rcode = run_validate_chi2(TESTLOG,0,gen,distr[23],'+');
1211 n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1212 n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1213 unur_free(gen);
1214 unur_distr_free(distr_localcopy);
1215 } while (0);
1216 }
1217
1218 /* distribution [24] */
1219
1220 if(TRUE) {
1221 unur_reset_errno();
1222 do {
1223 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[24]);
1224 par = unur_utdr_new(distr_localcopy);
1225 gen = unur_init(par);
1226 rcode = run_validate_chi2(TESTLOG,0,gen,distr[24],'+');
1227 n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1228 n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1229 unur_free(gen);
1230 unur_distr_free(distr_localcopy);
1231 } while (0);
1232 }
1233
1234 if(TRUE) {
1235 unur_reset_errno();
1236 do {
1237 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[24]);
1238 { UNUR_DISTR *dg =NULL;
1239 par = unur_utdr_new(distr_localcopy);
1240 gen = unur_init(par);
1241 if (gen) {
1242 dg = unur_get_distr(gen);
1243 unur_distr_cont_set_domain(dg,0.9,0.92);
1244 unur_distr_cont_upd_pdfarea(dg);
1245 unur_distr_cont_upd_mode(dg);
1246 unur_reinit(gen); }
1247 }
1248 rcode = run_validate_chi2(TESTLOG,0,gen,distr[24],'+');
1249 n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1250 n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1251 unur_free(gen);
1252 unur_distr_free(distr_localcopy);
1253 } while (0);
1254 }
1255
1256 if(TRUE) {
1257 unur_reset_errno();
1258 do {
1259 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[24]);
1260 { UNUR_DISTR *dg =NULL;
1261 par = unur_utdr_new(distr_localcopy);
1262 fpm[0] = 1.;
1263 fpm[1] = 4.;
1264 gen = unur_init(par);
1265 if (gen) {
1266 dg = unur_get_distr(gen);
1267 unur_distr_cont_set_pdfparams(dg,fpm,2);
1268 unur_distr_cont_upd_pdfarea(dg);
1269 unur_distr_cont_upd_mode(dg);
1270 unur_reinit(gen); }
1271 }
1272 rcode = run_validate_chi2(TESTLOG,0,gen,distr[24],'+');
1273 n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1274 n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1275 unur_free(gen);
1276 unur_distr_free(distr_localcopy);
1277 } while (0);
1278 }
1279
1280 /* distribution [7] */
1281
1282 if(TRUE) {
1283 unur_reset_errno();
1284 do {
1285 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[7]);
1286 par = unur_utdr_new(distr_localcopy);
1287 gen = unur_init(par);
1288 rcode = run_validate_chi2(TESTLOG,0,gen,distr[7],'+');
1289 n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1290 n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1291 unur_free(gen);
1292 unur_distr_free(distr_localcopy);
1293 } while (0);
1294 }
1295
1296 if(TRUE) {
1297 unur_reset_errno();
1298 do {
1299 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[7]);
1300 { UNUR_DISTR *dg =NULL;
1301 par = unur_utdr_new(distr_localcopy);
1302 gen = unur_init(par);
1303 if (gen) {
1304 dg = unur_get_distr(gen);
1305 unur_distr_cont_set_domain(dg,0.9,0.92);
1306 unur_distr_cont_upd_pdfarea(dg);
1307 unur_distr_cont_upd_mode(dg);
1308 unur_reinit(gen); }
1309 }
1310 rcode = run_validate_chi2(TESTLOG,0,gen,distr[7],'+');
1311 n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1312 n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1313 unur_free(gen);
1314 unur_distr_free(distr_localcopy);
1315 } while (0);
1316 }
1317
1318 if(TRUE) {
1319 unur_reset_errno();
1320 do {
1321 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[7]);
1322 { UNUR_DISTR *dg =NULL;
1323 par = unur_utdr_new(distr_localcopy);
1324 fpm[0] = 1.;
1325 fpm[1] = 4.;
1326 gen = unur_init(par);
1327 if (gen) {
1328 dg = unur_get_distr(gen);
1329 unur_distr_cont_set_pdfparams(dg,fpm,2);
1330 unur_distr_cont_upd_pdfarea(dg);
1331 unur_distr_cont_upd_mode(dg);
1332 unur_reinit(gen); }
1333 }
1334 rcode = run_validate_chi2(TESTLOG,0,gen,distr[7],'+');
1335 n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1336 n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1337 unur_free(gen);
1338 unur_distr_free(distr_localcopy);
1339 } while (0);
1340 }
1341
1342 /* distribution [8] */
1343
1344 if(TRUE) {
1345 unur_reset_errno();
1346 do {
1347 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[8]);
1348 par = unur_utdr_new(distr_localcopy);
1349 gen = unur_init(par);
1350 rcode = run_validate_chi2(TESTLOG,0,gen,distr[8],'+');
1351 n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1352 n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1353 unur_free(gen);
1354 unur_distr_free(distr_localcopy);
1355 } while (0);
1356 }
1357
1358 if(TRUE) {
1359 unur_reset_errno();
1360 do {
1361 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[8]);
1362 { UNUR_DISTR *dg =NULL;
1363 par = unur_utdr_new(distr_localcopy);
1364 gen = unur_init(par);
1365 if (gen) {
1366 dg = unur_get_distr(gen);
1367 unur_distr_cont_set_domain(dg,0.9,0.92);
1368 unur_distr_cont_upd_pdfarea(dg);
1369 unur_distr_cont_upd_mode(dg);
1370 unur_reinit(gen); }
1371 }
1372 rcode = run_validate_chi2(TESTLOG,0,gen,distr[8],'+');
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(TRUE) {
1381 unur_reset_errno();
1382 do {
1383 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[8]);
1384 { UNUR_DISTR *dg =NULL;
1385 par = unur_utdr_new(distr_localcopy);
1386 fpm[0] = 1.;
1387 fpm[1] = 4.;
1388 gen = unur_init(par);
1389 if (gen) {
1390 dg = unur_get_distr(gen);
1391 unur_distr_cont_set_pdfparams(dg,fpm,2);
1392 unur_distr_cont_upd_pdfarea(dg);
1393 unur_distr_cont_upd_mode(dg);
1394 unur_reinit(gen); }
1395 }
1396 rcode = run_validate_chi2(TESTLOG,0,gen,distr[8],'+');
1397 n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1398 n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1399 unur_free(gen);
1400 unur_distr_free(distr_localcopy);
1401 } while (0);
1402 }
1403
1404 /* distribution [9] */
1405
1406 if(fullcheck) {
1407 unur_reset_errno();
1408 do {
1409 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[9]);
1410 par = unur_utdr_new(distr_localcopy);
1411 gen = unur_init(par);
1412 rcode = run_validate_chi2(TESTLOG,0,gen,distr[9],'+');
1413 n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1414 n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1415 unur_free(gen);
1416 unur_distr_free(distr_localcopy);
1417 } while (0);
1418 }
1419
1420 if(fullcheck) {
1421 unur_reset_errno();
1422 do {
1423 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[9]);
1424 { UNUR_DISTR *dg =NULL;
1425 par = unur_utdr_new(distr_localcopy);
1426 gen = unur_init(par);
1427 if (gen) {
1428 dg = unur_get_distr(gen);
1429 unur_distr_cont_set_domain(dg,0.9,0.92);
1430 unur_distr_cont_upd_pdfarea(dg);
1431 unur_distr_cont_upd_mode(dg);
1432 unur_reinit(gen); }
1433 }
1434 rcode = run_validate_chi2(TESTLOG,0,gen,distr[9],'+');
1435 n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1436 n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1437 unur_free(gen);
1438 unur_distr_free(distr_localcopy);
1439 } while (0);
1440 }
1441
1442 if(fullcheck) {
1443 unur_reset_errno();
1444 do {
1445 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[9]);
1446 { UNUR_DISTR *dg =NULL;
1447 par = unur_utdr_new(distr_localcopy);
1448 fpm[0] = 1.;
1449 fpm[1] = 4.;
1450 gen = unur_init(par);
1451 if (gen) {
1452 dg = unur_get_distr(gen);
1453 unur_distr_cont_set_pdfparams(dg,fpm,2);
1454 unur_distr_cont_upd_pdfarea(dg);
1455 unur_distr_cont_upd_mode(dg);
1456 unur_reinit(gen); }
1457 }
1458 rcode = run_validate_chi2(TESTLOG,0,gen,distr[9],'+');
1459 n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1460 n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1461 unur_free(gen);
1462 unur_distr_free(distr_localcopy);
1463 } while (0);
1464 }
1465
1466 /* distribution [10] */
1467
1468 if(TRUE) {
1469 unur_reset_errno();
1470 do {
1471 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[10]);
1472 par = unur_utdr_new(distr_localcopy);
1473 gen = unur_init(par);
1474 rcode = run_validate_chi2(TESTLOG,0,gen,distr[10],'+');
1475 n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1476 n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1477 unur_free(gen);
1478 unur_distr_free(distr_localcopy);
1479 } while (0);
1480 }
1481
1482 if(TRUE) {
1483 unur_reset_errno();
1484 do {
1485 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[10]);
1486 { UNUR_DISTR *dg =NULL;
1487 par = unur_utdr_new(distr_localcopy);
1488 gen = unur_init(par);
1489 if (gen) {
1490 dg = unur_get_distr(gen);
1491 unur_distr_cont_set_domain(dg,0.9,0.92);
1492 unur_distr_cont_upd_pdfarea(dg);
1493 unur_distr_cont_upd_mode(dg);
1494 unur_reinit(gen); }
1495 }
1496 rcode = run_validate_chi2(TESTLOG,0,gen,distr[10],'+');
1497 n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1498 n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1499 unur_free(gen);
1500 unur_distr_free(distr_localcopy);
1501 } while (0);
1502 }
1503
1504 if(TRUE) {
1505 unur_reset_errno();
1506 do {
1507 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[10]);
1508 { UNUR_DISTR *dg =NULL;
1509 par = unur_utdr_new(distr_localcopy);
1510 fpm[0] = 1.;
1511 fpm[1] = 4.;
1512 gen = unur_init(par);
1513 if (gen) {
1514 dg = unur_get_distr(gen);
1515 unur_distr_cont_set_pdfparams(dg,fpm,2);
1516 unur_distr_cont_upd_pdfarea(dg);
1517 unur_distr_cont_upd_mode(dg);
1518 unur_reinit(gen); }
1519 }
1520 rcode = run_validate_chi2(TESTLOG,0,gen,distr[10],'+');
1521 n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1522 n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1523 unur_free(gen);
1524 unur_distr_free(distr_localcopy);
1525 } while (0);
1526 }
1527
1528 /* distribution [11] */
1529
1530 if(TRUE) {
1531 unur_reset_errno();
1532 do {
1533 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[11]);
1534 par = unur_utdr_new(distr_localcopy);
1535 gen = unur_init(par);
1536 rcode = run_validate_chi2(TESTLOG,0,gen,distr[11],'+');
1537 n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1538 n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1539 unur_free(gen);
1540 unur_distr_free(distr_localcopy);
1541 } while (0);
1542 }
1543
1544 if(TRUE) {
1545 unur_reset_errno();
1546 do {
1547 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[11]);
1548 { UNUR_DISTR *dg =NULL;
1549 par = unur_utdr_new(distr_localcopy);
1550 gen = unur_init(par);
1551 if (gen) {
1552 dg = unur_get_distr(gen);
1553 unur_distr_cont_set_domain(dg,0.9,0.92);
1554 unur_distr_cont_upd_pdfarea(dg);
1555 unur_distr_cont_upd_mode(dg);
1556 unur_reinit(gen); }
1557 }
1558 rcode = run_validate_chi2(TESTLOG,0,gen,distr[11],'+');
1559 n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1560 n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1561 unur_free(gen);
1562 unur_distr_free(distr_localcopy);
1563 } while (0);
1564 }
1565
1566 if(TRUE) {
1567 printf("."); fflush(stdout);
1568 }
1569
1570 /* distribution [12] */
1571
1572 if(TRUE) {
1573 unur_reset_errno();
1574 do {
1575 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[12]);
1576 par = unur_utdr_new(distr_localcopy);
1577 gen = unur_init(par);
1578 rcode = run_validate_chi2(TESTLOG,0,gen,distr[12],'+');
1579 n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1580 n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1581 unur_free(gen);
1582 unur_distr_free(distr_localcopy);
1583 } while (0);
1584 }
1585
1586 if(TRUE) {
1587 unur_reset_errno();
1588 do {
1589 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[12]);
1590 { UNUR_DISTR *dg =NULL;
1591 par = unur_utdr_new(distr_localcopy);
1592 gen = unur_init(par);
1593 if (gen) {
1594 dg = unur_get_distr(gen);
1595 unur_distr_cont_set_domain(dg,0.9,0.92);
1596 unur_distr_cont_upd_pdfarea(dg);
1597 unur_distr_cont_upd_mode(dg);
1598 unur_reinit(gen); }
1599 }
1600 rcode = run_validate_chi2(TESTLOG,0,gen,distr[12],'+');
1601 n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1602 n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1603 unur_free(gen);
1604 unur_distr_free(distr_localcopy);
1605 } while (0);
1606 }
1607
1608 if(TRUE) {
1609 printf("."); fflush(stdout);
1610 }
1611
1612 /* distribution [13] */
1613
1614 if(fullcheck) {
1615 unur_reset_errno();
1616 do {
1617 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[13]);
1618 par = unur_utdr_new(distr_localcopy);
1619 gen = unur_init(par);
1620 rcode = run_validate_chi2(TESTLOG,0,gen,distr[13],'+');
1621 n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1622 n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1623 unur_free(gen);
1624 unur_distr_free(distr_localcopy);
1625 } while (0);
1626 }
1627
1628 if(fullcheck) {
1629 printf("."); fflush(stdout);
1630 }
1631
1632 if(fullcheck) {
1633 printf("."); fflush(stdout);
1634 }
1635
1636 /* distribution [14] */
1637
1638 if(TRUE) {
1639 unur_reset_errno();
1640 do {
1641 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[14]);
1642 par = unur_utdr_new(distr_localcopy);
1643 gen = unur_init(par);
1644 rcode = run_validate_chi2(TESTLOG,0,gen,distr[14],'+');
1645 n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1646 n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1647 unur_free(gen);
1648 unur_distr_free(distr_localcopy);
1649 } while (0);
1650 }
1651
1652 if(TRUE) {
1653 unur_reset_errno();
1654 do {
1655 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[14]);
1656 { UNUR_DISTR *dg =NULL;
1657 par = unur_utdr_new(distr_localcopy);
1658 gen = unur_init(par);
1659 if (gen) {
1660 dg = unur_get_distr(gen);
1661 unur_distr_cont_set_domain(dg,0.9,0.92);
1662 unur_distr_cont_upd_pdfarea(dg);
1663 unur_distr_cont_upd_mode(dg);
1664 unur_reinit(gen); }
1665 }
1666 rcode = run_validate_chi2(TESTLOG,0,gen,distr[14],'+');
1667 n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1668 n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1669 unur_free(gen);
1670 unur_distr_free(distr_localcopy);
1671 } while (0);
1672 }
1673
1674 if(TRUE) {
1675 printf("."); fflush(stdout);
1676 }
1677
1678 /* distribution [15] */
1679
1680 if(fullcheck) {
1681 unur_reset_errno();
1682 do {
1683 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[15]);
1684 par = unur_utdr_new(distr_localcopy);
1685 gen = unur_init(par);
1686 rcode = run_validate_chi2(TESTLOG,0,gen,distr[15],'+');
1687 n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1688 n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1689 unur_free(gen);
1690 unur_distr_free(distr_localcopy);
1691 } while (0);
1692 }
1693
1694 if(fullcheck) {
1695 printf("."); fflush(stdout);
1696 }
1697
1698 if(fullcheck) {
1699 printf("."); fflush(stdout);
1700 }
1701
1702 /* distribution [16] */
1703
1704 if(fullcheck) {
1705 unur_reset_errno();
1706 do {
1707 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[16]);
1708 par = unur_utdr_new(distr_localcopy);
1709 gen = unur_init(par);
1710 rcode = run_validate_chi2(TESTLOG,0,gen,distr[16],'+');
1711 n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1712 n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1713 unur_free(gen);
1714 unur_distr_free(distr_localcopy);
1715 } while (0);
1716 }
1717
1718 if(fullcheck) {
1719 unur_reset_errno();
1720 do {
1721 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[16]);
1722 { UNUR_DISTR *dg =NULL;
1723 par = unur_utdr_new(distr_localcopy);
1724 gen = unur_init(par);
1725 if (gen) {
1726 dg = unur_get_distr(gen);
1727 unur_distr_cont_set_domain(dg,0.9,0.92);
1728 unur_distr_cont_upd_pdfarea(dg);
1729 unur_distr_cont_upd_mode(dg);
1730 unur_reinit(gen); }
1731 }
1732 rcode = run_validate_chi2(TESTLOG,0,gen,distr[16],'-');
1733 n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1734 n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1735 unur_free(gen);
1736 unur_distr_free(distr_localcopy);
1737 } while (0);
1738 }
1739
1740 if(fullcheck) {
1741 printf("."); fflush(stdout);
1742 }
1743
1744 /* distribution [25] */
1745
1746 if(TRUE) {
1747 unur_reset_errno();
1748 do {
1749 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[25]);
1750 par = unur_utdr_new(distr_localcopy);
1751 gen = unur_init(par);
1752 rcode = run_validate_chi2(TESTLOG,0,gen,distr[25],'+');
1753 n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1754 n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1755 unur_free(gen);
1756 unur_distr_free(distr_localcopy);
1757 } while (0);
1758 }
1759
1760 if(TRUE) {
1761 unur_reset_errno();
1762 do {
1763 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[25]);
1764 { UNUR_DISTR *dg =NULL;
1765 par = unur_utdr_new(distr_localcopy);
1766 gen = unur_init(par);
1767 if (gen) {
1768 dg = unur_get_distr(gen);
1769 unur_distr_cont_set_domain(dg,0.9,0.92);
1770 unur_distr_cont_upd_pdfarea(dg);
1771 unur_distr_cont_upd_mode(dg);
1772 unur_reinit(gen); }
1773 }
1774 rcode = run_validate_chi2(TESTLOG,0,gen,distr[25],'+');
1775 n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1776 n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1777 unur_free(gen);
1778 unur_distr_free(distr_localcopy);
1779 } while (0);
1780 }
1781
1782 if(TRUE) {
1783 unur_reset_errno();
1784 do {
1785 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[25]);
1786 { UNUR_DISTR *dg =NULL;
1787 par = unur_utdr_new(distr_localcopy);
1788 fpm[0] = 1.;
1789 fpm[1] = 4.;
1790 gen = unur_init(par);
1791 if (gen) {
1792 dg = unur_get_distr(gen);
1793 unur_distr_cont_set_pdfparams(dg,fpm,2);
1794 unur_distr_cont_upd_pdfarea(dg);
1795 unur_distr_cont_upd_mode(dg);
1796 unur_reinit(gen); }
1797 }
1798 rcode = run_validate_chi2(TESTLOG,0,gen,distr[25],'+');
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 [26] */
1807
1808 if(TRUE) {
1809 unur_reset_errno();
1810 do {
1811 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[26]);
1812 par = unur_utdr_new(distr_localcopy);
1813 gen = unur_init(par);
1814 rcode = run_validate_chi2(TESTLOG,0,gen,distr[26],'+');
1815 n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1816 n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1817 unur_free(gen);
1818 unur_distr_free(distr_localcopy);
1819 } while (0);
1820 }
1821
1822 if(TRUE) {
1823 unur_reset_errno();
1824 do {
1825 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[26]);
1826 { UNUR_DISTR *dg =NULL;
1827 par = unur_utdr_new(distr_localcopy);
1828 gen = unur_init(par);
1829 if (gen) {
1830 dg = unur_get_distr(gen);
1831 unur_distr_cont_set_domain(dg,0.9,0.92);
1832 unur_distr_cont_upd_pdfarea(dg);
1833 unur_distr_cont_upd_mode(dg);
1834 unur_reinit(gen); }
1835 }
1836 rcode = run_validate_chi2(TESTLOG,0,gen,distr[26],'+');
1837 n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1838 n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1839 unur_free(gen);
1840 unur_distr_free(distr_localcopy);
1841 } while (0);
1842 }
1843
1844 if(TRUE) {
1845 unur_reset_errno();
1846 do {
1847 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[26]);
1848 { UNUR_DISTR *dg =NULL;
1849 par = unur_utdr_new(distr_localcopy);
1850 fpm[0] = 1.;
1851 fpm[1] = 4.;
1852 gen = unur_init(par);
1853 if (gen) {
1854 dg = unur_get_distr(gen);
1855 unur_distr_cont_set_pdfparams(dg,fpm,2);
1856 unur_distr_cont_upd_pdfarea(dg);
1857 unur_distr_cont_upd_mode(dg);
1858 unur_reinit(gen); }
1859 }
1860 rcode = run_validate_chi2(TESTLOG,0,gen,distr[26],'+');
1861 n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1862 n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1863 unur_free(gen);
1864 unur_distr_free(distr_localcopy);
1865 } while (0);
1866 }
1867
1868 /* distribution [17] */
1869
1870 if(TRUE) {
1871 unur_reset_errno();
1872 do {
1873 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[17]);
1874 par = unur_utdr_new(distr_localcopy);
1875 gen = unur_init(par);
1876 rcode = run_validate_chi2(TESTLOG,0,gen,distr[17],'+');
1877 n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1878 n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1879 unur_free(gen);
1880 unur_distr_free(distr_localcopy);
1881 } while (0);
1882 }
1883
1884 if(TRUE) {
1885 unur_reset_errno();
1886 do {
1887 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[17]);
1888 { UNUR_DISTR *dg =NULL;
1889 par = unur_utdr_new(distr_localcopy);
1890 gen = unur_init(par);
1891 if (gen) {
1892 dg = unur_get_distr(gen);
1893 unur_distr_cont_set_domain(dg,0.9,0.92);
1894 unur_distr_cont_upd_pdfarea(dg);
1895 unur_distr_cont_upd_mode(dg);
1896 unur_reinit(gen); }
1897 }
1898 rcode = run_validate_chi2(TESTLOG,0,gen,distr[17],'+');
1899 n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1900 n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1901 unur_free(gen);
1902 unur_distr_free(distr_localcopy);
1903 } while (0);
1904 }
1905
1906 if(TRUE) {
1907 unur_reset_errno();
1908 do {
1909 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[17]);
1910 { UNUR_DISTR *dg =NULL;
1911 par = unur_utdr_new(distr_localcopy);
1912 fpm[0] = 1.;
1913 fpm[1] = 4.;
1914 gen = unur_init(par);
1915 if (gen) {
1916 dg = unur_get_distr(gen);
1917 unur_distr_cont_set_pdfparams(dg,fpm,2);
1918 unur_distr_cont_upd_pdfarea(dg);
1919 unur_distr_cont_upd_mode(dg);
1920 unur_reinit(gen); }
1921 }
1922 rcode = run_validate_chi2(TESTLOG,0,gen,distr[17],'+');
1923 n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1924 n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1925 unur_free(gen);
1926 unur_distr_free(distr_localcopy);
1927 } while (0);
1928 }
1929
1930 /* distribution [18] */
1931
1932 if(fullcheck) {
1933 unur_reset_errno();
1934 do {
1935 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[18]);
1936 par = unur_utdr_new(distr_localcopy);
1937 gen = unur_init(par);
1938 rcode = run_validate_chi2(TESTLOG,0,gen,distr[18],'+');
1939 n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1940 n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1941 unur_free(gen);
1942 unur_distr_free(distr_localcopy);
1943 } while (0);
1944 }
1945
1946 if(fullcheck) {
1947 printf("."); fflush(stdout);
1948 }
1949
1950 if(fullcheck) {
1951 unur_reset_errno();
1952 do {
1953 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[18]);
1954 { UNUR_DISTR *dg =NULL;
1955 par = unur_utdr_new(distr_localcopy);
1956 fpm[0] = 1.;
1957 fpm[1] = 4.;
1958 gen = unur_init(par);
1959 if (gen) {
1960 dg = unur_get_distr(gen);
1961 unur_distr_cont_set_pdfparams(dg,fpm,2);
1962 unur_distr_cont_upd_pdfarea(dg);
1963 unur_distr_cont_upd_mode(dg);
1964 unur_reinit(gen); }
1965 }
1966 rcode = run_validate_chi2(TESTLOG,0,gen,distr[18],'+');
1967 n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1968 n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1969 unur_free(gen);
1970 unur_distr_free(distr_localcopy);
1971 } while (0);
1972 }
1973
1974 /* distribution [19] */
1975
1976 if(TRUE) {
1977 unur_reset_errno();
1978 do {
1979 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[19]);
1980 par = unur_utdr_new(distr_localcopy);
1981 gen = unur_init(par);
1982 rcode = run_validate_chi2(TESTLOG,0,gen,distr[19],'+');
1983 n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
1984 n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
1985 unur_free(gen);
1986 unur_distr_free(distr_localcopy);
1987 } while (0);
1988 }
1989
1990 if(TRUE) {
1991 printf("."); fflush(stdout);
1992 }
1993
1994 if(TRUE) {
1995 printf("."); fflush(stdout);
1996 }
1997
1998 /* distribution [20] */
1999
2000 if(TRUE) {
2001 unur_reset_errno();
2002 do {
2003 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[20]);
2004 par = unur_utdr_new(distr_localcopy);
2005 gen = unur_init(par);
2006 rcode = run_validate_chi2(TESTLOG,0,gen,distr[20],'+');
2007 n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
2008 n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
2009 unur_free(gen);
2010 unur_distr_free(distr_localcopy);
2011 } while (0);
2012 }
2013
2014 if(TRUE) {
2015 unur_reset_errno();
2016 do {
2017 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[20]);
2018 { UNUR_DISTR *dg =NULL;
2019 par = unur_utdr_new(distr_localcopy);
2020 gen = unur_init(par);
2021 if (gen) {
2022 dg = unur_get_distr(gen);
2023 unur_distr_cont_set_domain(dg,0.9,0.92);
2024 unur_distr_cont_upd_pdfarea(dg);
2025 unur_distr_cont_upd_mode(dg);
2026 unur_reinit(gen); }
2027 }
2028 rcode = run_validate_chi2(TESTLOG,0,gen,distr[20],'+');
2029 n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
2030 n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
2031 unur_free(gen);
2032 unur_distr_free(distr_localcopy);
2033 } while (0);
2034 }
2035
2036 if(TRUE) {
2037 printf("."); fflush(stdout);
2038 }
2039
2040 /* distribution [21] */
2041
2042 if(TRUE) {
2043 unur_reset_errno();
2044 do {
2045 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[21]);
2046 par = unur_utdr_new(distr_localcopy);
2047 gen = unur_init(par);
2048 rcode = run_validate_chi2(TESTLOG,0,gen,distr[21],'+');
2049 n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
2050 n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
2051 unur_free(gen);
2052 unur_distr_free(distr_localcopy);
2053 } while (0);
2054 }
2055
2056 if(TRUE) {
2057 unur_reset_errno();
2058 do {
2059 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[21]);
2060 { UNUR_DISTR *dg =NULL;
2061 par = unur_utdr_new(distr_localcopy);
2062 gen = unur_init(par);
2063 if (gen) {
2064 dg = unur_get_distr(gen);
2065 unur_distr_cont_set_domain(dg,0.9,0.92);
2066 unur_distr_cont_upd_pdfarea(dg);
2067 unur_distr_cont_upd_mode(dg);
2068 unur_reinit(gen); }
2069 }
2070 rcode = run_validate_chi2(TESTLOG,0,gen,distr[21],'-');
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 if(TRUE) {
2079 unur_reset_errno();
2080 do {
2081 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[21]);
2082 { UNUR_DISTR *dg =NULL;
2083 par = unur_utdr_new(distr_localcopy);
2084 fpm[0] = 1.;
2085 fpm[1] = 4.;
2086 gen = unur_init(par);
2087 if (gen) {
2088 dg = unur_get_distr(gen);
2089 unur_distr_cont_set_pdfparams(dg,fpm,2);
2090 unur_distr_cont_upd_pdfarea(dg);
2091 unur_distr_cont_upd_mode(dg);
2092 unur_reinit(gen); }
2093 }
2094 rcode = run_validate_chi2(TESTLOG,0,gen,distr[21],'+');
2095 n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
2096 n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
2097 unur_free(gen);
2098 unur_distr_free(distr_localcopy);
2099 } while (0);
2100 }
2101
2102 /* distribution [22] */
2103
2104 if(TRUE) {
2105 unur_reset_errno();
2106 do {
2107 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[22]);
2108 par = unur_utdr_new(distr_localcopy);
2109 gen = unur_init(par);
2110 rcode = run_validate_chi2(TESTLOG,0,gen,distr[22],'+');
2111 n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
2112 n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
2113 unur_free(gen);
2114 unur_distr_free(distr_localcopy);
2115 } while (0);
2116 }
2117
2118 if(TRUE) {
2119 unur_reset_errno();
2120 do {
2121 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[22]);
2122 { UNUR_DISTR *dg =NULL;
2123 par = unur_utdr_new(distr_localcopy);
2124 gen = unur_init(par);
2125 if (gen) {
2126 dg = unur_get_distr(gen);
2127 unur_distr_cont_set_domain(dg,0.9,0.92);
2128 unur_distr_cont_upd_pdfarea(dg);
2129 unur_distr_cont_upd_mode(dg);
2130 unur_reinit(gen); }
2131 }
2132 rcode = run_validate_chi2(TESTLOG,0,gen,distr[22],'+');
2133 n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
2134 n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
2135 unur_free(gen);
2136 unur_distr_free(distr_localcopy);
2137 } while (0);
2138 }
2139
2140 if(TRUE) {
2141 unur_reset_errno();
2142 do {
2143 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[22]);
2144 { UNUR_DISTR *dg =NULL;
2145 par = unur_utdr_new(distr_localcopy);
2146 fpm[0] = 1.;
2147 fpm[1] = 4.;
2148 gen = unur_init(par);
2149 if (gen) {
2150 dg = unur_get_distr(gen);
2151 unur_distr_cont_set_pdfparams(dg,fpm,2);
2152 unur_distr_cont_upd_pdfarea(dg);
2153 unur_distr_cont_upd_mode(dg);
2154 unur_reinit(gen); }
2155 }
2156 rcode = run_validate_chi2(TESTLOG,0,gen,distr[22],'+');
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 /* distribution [27] */
2165
2166 if(TRUE) {
2167 unur_reset_errno();
2168 do {
2169 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[27]);
2170 par = unur_utdr_new(distr_localcopy);
2171 gen = unur_init(par);
2172 rcode = run_validate_chi2(TESTLOG,0,gen,distr[27],'+');
2173 n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
2174 n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
2175 unur_free(gen);
2176 unur_distr_free(distr_localcopy);
2177 } while (0);
2178 }
2179
2180 if(TRUE) {
2181 printf("."); fflush(stdout);
2182 }
2183
2184 if(TRUE) {
2185 printf("."); fflush(stdout);
2186 }
2187
2188 /* distribution [28] */
2189
2190 if(TRUE) {
2191 unur_reset_errno();
2192 do {
2193 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[28]);
2194 par = unur_utdr_new(distr_localcopy);
2195 gen = unur_init(par);
2196 rcode = run_validate_chi2(TESTLOG,0,gen,distr[28],'+');
2197 n_tests_failed += (rcode==UNUR_SUCCESS)?0:1;
2198 n_tests_failed += (rcode==UNUR_FAILURE)?1000:0;
2199 unur_free(gen);
2200 unur_distr_free(distr_localcopy);
2201 } while (0);
2202 }
2203
2204 if(TRUE) {
2205 printf("."); fflush(stdout);
2206 }
2207
2208 if(TRUE) {
2209 printf("."); fflush(stdout);
2210 }
2211
2212 /* timing */
2213 stopwatch_print(TESTLOG,"\n<*>time = %.0f ms\n", stopwatch_lap(&watch));
2214
2215 printf("\n(verify hat) "); fflush(stdout);
2216
2217 /* verify hat tests: 87 */
2218
2219 unur_set_default_debug(~UNUR_DEBUG_SAMPLE);
2220 fprintf( TESTLOG,"\nVerify Hat Test (squeeze <= PDF <= hat):\n");
2221
2222 /* distribution [0] */
2223
2224 if(fullcheck) {
2225 unur_reset_errno();
2226 do {
2227 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[0]);
2228 par = unur_utdr_new(distr_localcopy);
2229 unur_utdr_set_pedantic(par,0);
2230 gen = unur_init(par);
2231 if (gen) unur_utdr_chg_verify(gen,1);
2232 n_tests_failed += (run_validate_verifyhat(TESTLOG,0,gen,distr[0],'~')==UNUR_SUCCESS)?0:1000;
2233 unur_free(gen);
2234
2235 unur_distr_free(distr_localcopy);
2236 } while (0);
2237 }
2238
2239 if(fullcheck) {
2240 unur_reset_errno();
2241 do {
2242 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[0]);
2243 { UNUR_DISTR *dg =NULL;
2244 par = unur_utdr_new(distr_localcopy);
2245 unur_utdr_set_pedantic(par,0);
2246 gen = unur_init(par);
2247 if (gen) {
2248 dg = unur_get_distr(gen);
2249 unur_distr_cont_set_domain(dg,0.9,0.92);
2250 unur_distr_cont_upd_pdfarea(dg);
2251 unur_distr_cont_upd_mode(dg);
2252 unur_reinit(gen); }
2253 }
2254 if (gen) unur_utdr_chg_verify(gen,1);
2255 n_tests_failed += (run_validate_verifyhat(TESTLOG,0,gen,distr[0],'~')==UNUR_SUCCESS)?0:1000;
2256 unur_free(gen);
2257
2258 unur_distr_free(distr_localcopy);
2259 } while (0);
2260 }
2261
2262 if(fullcheck) {
2263 unur_reset_errno();
2264 do {
2265 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[0]);
2266 { UNUR_DISTR *dg =NULL;
2267 par = unur_utdr_new(distr_localcopy);
2268 unur_utdr_set_pedantic(par,0);
2269 fpm[0] = 1.;
2270 fpm[1] = 4.;
2271 gen = unur_init(par);
2272 if (gen) {
2273 dg = unur_get_distr(gen);
2274 unur_distr_cont_set_pdfparams(dg,fpm,2);
2275 unur_distr_cont_upd_pdfarea(dg);
2276 unur_distr_cont_upd_mode(dg);
2277 unur_reinit(gen); }
2278 }
2279 if (gen) unur_utdr_chg_verify(gen,1);
2280 n_tests_failed += (run_validate_verifyhat(TESTLOG,0,gen,distr[0],'~')==UNUR_SUCCESS)?0:1000;
2281 unur_free(gen);
2282
2283 unur_distr_free(distr_localcopy);
2284 } while (0);
2285 }
2286
2287 /* distribution [1] */
2288
2289 if(TRUE) {
2290 unur_reset_errno();
2291 do {
2292 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[1]);
2293 par = unur_utdr_new(distr_localcopy);
2294 unur_utdr_set_pedantic(par,0);
2295 gen = unur_init(par);
2296 if (gen) unur_utdr_chg_verify(gen,1);
2297 n_tests_failed += (run_validate_verifyhat(TESTLOG,0,gen,distr[1],'~')==UNUR_SUCCESS)?0:1000;
2298 unur_free(gen);
2299
2300 unur_distr_free(distr_localcopy);
2301 } while (0);
2302 }
2303
2304 if(TRUE) {
2305 unur_reset_errno();
2306 do {
2307 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[1]);
2308 { UNUR_DISTR *dg =NULL;
2309 par = unur_utdr_new(distr_localcopy);
2310 unur_utdr_set_pedantic(par,0);
2311 gen = unur_init(par);
2312 if (gen) {
2313 dg = unur_get_distr(gen);
2314 unur_distr_cont_set_domain(dg,0.9,0.92);
2315 unur_distr_cont_upd_pdfarea(dg);
2316 unur_distr_cont_upd_mode(dg);
2317 unur_reinit(gen); }
2318 }
2319 if (gen) unur_utdr_chg_verify(gen,1);
2320 n_tests_failed += (run_validate_verifyhat(TESTLOG,0,gen,distr[1],'~')==UNUR_SUCCESS)?0:1000;
2321 unur_free(gen);
2322
2323 unur_distr_free(distr_localcopy);
2324 } while (0);
2325 }
2326
2327 if(TRUE) {
2328 unur_reset_errno();
2329 do {
2330 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[1]);
2331 { UNUR_DISTR *dg =NULL;
2332 par = unur_utdr_new(distr_localcopy);
2333 unur_utdr_set_pedantic(par,0);
2334 fpm[0] = 1.;
2335 fpm[1] = 4.;
2336 gen = unur_init(par);
2337 if (gen) {
2338 dg = unur_get_distr(gen);
2339 unur_distr_cont_set_pdfparams(dg,fpm,2);
2340 unur_distr_cont_upd_pdfarea(dg);
2341 unur_distr_cont_upd_mode(dg);
2342 unur_reinit(gen); }
2343 }
2344 if (gen) unur_utdr_chg_verify(gen,1);
2345 n_tests_failed += (run_validate_verifyhat(TESTLOG,0,gen,distr[1],'~')==UNUR_SUCCESS)?0:1000;
2346 unur_free(gen);
2347
2348 unur_distr_free(distr_localcopy);
2349 } while (0);
2350 }
2351
2352 /* distribution [2] */
2353
2354 if(fullcheck) {
2355 unur_reset_errno();
2356 do {
2357 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[2]);
2358 par = unur_utdr_new(distr_localcopy);
2359 unur_utdr_set_pedantic(par,0);
2360 gen = unur_init(par);
2361 if (gen) unur_utdr_chg_verify(gen,1);
2362 n_tests_failed += (run_validate_verifyhat(TESTLOG,0,gen,distr[2],'~')==UNUR_SUCCESS)?0:1000;
2363 unur_free(gen);
2364
2365 unur_distr_free(distr_localcopy);
2366 } while (0);
2367 }
2368
2369 if(fullcheck) {
2370 printf("."); fflush(stdout);
2371 }
2372
2373 if(fullcheck) {
2374 printf("."); fflush(stdout);
2375 }
2376
2377 /* distribution [3] */
2378
2379 if(TRUE) {
2380 unur_reset_errno();
2381 do {
2382 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[3]);
2383 par = unur_utdr_new(distr_localcopy);
2384 unur_utdr_set_pedantic(par,0);
2385 gen = unur_init(par);
2386 if (gen) unur_utdr_chg_verify(gen,1);
2387 n_tests_failed += (run_validate_verifyhat(TESTLOG,0,gen,distr[3],'~')==UNUR_SUCCESS)?0:1000;
2388 unur_free(gen);
2389
2390 unur_distr_free(distr_localcopy);
2391 } while (0);
2392 }
2393
2394 if(TRUE) {
2395 unur_reset_errno();
2396 do {
2397 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[3]);
2398 { UNUR_DISTR *dg =NULL;
2399 par = unur_utdr_new(distr_localcopy);
2400 unur_utdr_set_pedantic(par,0);
2401 gen = unur_init(par);
2402 if (gen) {
2403 dg = unur_get_distr(gen);
2404 unur_distr_cont_set_domain(dg,0.9,0.92);
2405 unur_distr_cont_upd_pdfarea(dg);
2406 unur_distr_cont_upd_mode(dg);
2407 unur_reinit(gen); }
2408 }
2409 if (gen) unur_utdr_chg_verify(gen,1);
2410 n_tests_failed += (run_validate_verifyhat(TESTLOG,0,gen,distr[3],'~')==UNUR_SUCCESS)?0:1000;
2411 unur_free(gen);
2412
2413 unur_distr_free(distr_localcopy);
2414 } while (0);
2415 }
2416
2417 if(TRUE) {
2418 unur_reset_errno();
2419 do {
2420 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[3]);
2421 { UNUR_DISTR *dg =NULL;
2422 par = unur_utdr_new(distr_localcopy);
2423 unur_utdr_set_pedantic(par,0);
2424 fpm[0] = 1.;
2425 fpm[1] = 4.;
2426 gen = unur_init(par);
2427 if (gen) {
2428 dg = unur_get_distr(gen);
2429 unur_distr_cont_set_pdfparams(dg,fpm,2);
2430 unur_distr_cont_upd_pdfarea(dg);
2431 unur_distr_cont_upd_mode(dg);
2432 unur_reinit(gen); }
2433 }
2434 if (gen) unur_utdr_chg_verify(gen,1);
2435 n_tests_failed += (run_validate_verifyhat(TESTLOG,0,gen,distr[3],'~')==UNUR_SUCCESS)?0:1000;
2436 unur_free(gen);
2437
2438 unur_distr_free(distr_localcopy);
2439 } while (0);
2440 }
2441
2442 /* distribution [4] */
2443
2444 if(TRUE) {
2445 unur_reset_errno();
2446 do {
2447 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[4]);
2448 par = unur_utdr_new(distr_localcopy);
2449 unur_utdr_set_pedantic(par,0);
2450 gen = unur_init(par);
2451 if (gen) unur_utdr_chg_verify(gen,1);
2452 n_tests_failed += (run_validate_verifyhat(TESTLOG,0,gen,distr[4],'~')==UNUR_SUCCESS)?0:1000;
2453 unur_free(gen);
2454
2455 unur_distr_free(distr_localcopy);
2456 } while (0);
2457 }
2458
2459 if(TRUE) {
2460 printf("."); fflush(stdout);
2461 }
2462
2463 if(TRUE) {
2464 printf("."); fflush(stdout);
2465 }
2466
2467 /* distribution [5] */
2468
2469 if(TRUE) {
2470 unur_reset_errno();
2471 do {
2472 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[5]);
2473 par = unur_utdr_new(distr_localcopy);
2474 unur_utdr_set_pedantic(par,0);
2475 gen = unur_init(par);
2476 if (gen) unur_utdr_chg_verify(gen,1);
2477 n_tests_failed += (run_validate_verifyhat(TESTLOG,0,gen,distr[5],'~')==UNUR_SUCCESS)?0:1000;
2478 unur_free(gen);
2479
2480 unur_distr_free(distr_localcopy);
2481 } while (0);
2482 }
2483
2484 if(TRUE) {
2485 printf("."); fflush(stdout);
2486 }
2487
2488 if(TRUE) {
2489 printf("."); fflush(stdout);
2490 }
2491
2492 /* distribution [6] */
2493
2494 if(TRUE) {
2495 unur_reset_errno();
2496 do {
2497 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[6]);
2498 par = unur_utdr_new(distr_localcopy);
2499 unur_utdr_set_pedantic(par,0);
2500 gen = unur_init(par);
2501 if (gen) unur_utdr_chg_verify(gen,1);
2502 n_tests_failed += (run_validate_verifyhat(TESTLOG,0,gen,distr[6],'~')==UNUR_SUCCESS)?0:1000;
2503 unur_free(gen);
2504
2505 unur_distr_free(distr_localcopy);
2506 } while (0);
2507 }
2508
2509 if(TRUE) {
2510 unur_reset_errno();
2511 do {
2512 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[6]);
2513 { UNUR_DISTR *dg =NULL;
2514 par = unur_utdr_new(distr_localcopy);
2515 unur_utdr_set_pedantic(par,0);
2516 gen = unur_init(par);
2517 if (gen) {
2518 dg = unur_get_distr(gen);
2519 unur_distr_cont_set_domain(dg,0.9,0.92);
2520 unur_distr_cont_upd_pdfarea(dg);
2521 unur_distr_cont_upd_mode(dg);
2522 unur_reinit(gen); }
2523 }
2524 if (gen) unur_utdr_chg_verify(gen,1);
2525 n_tests_failed += (run_validate_verifyhat(TESTLOG,0,gen,distr[6],'~')==UNUR_SUCCESS)?0:1000;
2526 unur_free(gen);
2527
2528 unur_distr_free(distr_localcopy);
2529 } while (0);
2530 }
2531
2532 if(TRUE) {
2533 printf("."); fflush(stdout);
2534 }
2535
2536 /* distribution [23] */
2537
2538 if(TRUE) {
2539 unur_reset_errno();
2540 do {
2541 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[23]);
2542 par = unur_utdr_new(distr_localcopy);
2543 unur_utdr_set_pedantic(par,0);
2544 gen = unur_init(par);
2545 if (gen) unur_utdr_chg_verify(gen,1);
2546 n_tests_failed += (run_validate_verifyhat(TESTLOG,0,gen,distr[23],'~')==UNUR_SUCCESS)?0:1000;
2547 unur_free(gen);
2548
2549 unur_distr_free(distr_localcopy);
2550 } while (0);
2551 }
2552
2553 if(TRUE) {
2554 unur_reset_errno();
2555 do {
2556 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[23]);
2557 { UNUR_DISTR *dg =NULL;
2558 par = unur_utdr_new(distr_localcopy);
2559 unur_utdr_set_pedantic(par,0);
2560 gen = unur_init(par);
2561 if (gen) {
2562 dg = unur_get_distr(gen);
2563 unur_distr_cont_set_domain(dg,0.9,0.92);
2564 unur_distr_cont_upd_pdfarea(dg);
2565 unur_distr_cont_upd_mode(dg);
2566 unur_reinit(gen); }
2567 }
2568 if (gen) unur_utdr_chg_verify(gen,1);
2569 n_tests_failed += (run_validate_verifyhat(TESTLOG,0,gen,distr[23],'~')==UNUR_SUCCESS)?0:1000;
2570 unur_free(gen);
2571
2572 unur_distr_free(distr_localcopy);
2573 } while (0);
2574 }
2575
2576 if(TRUE) {
2577 unur_reset_errno();
2578 do {
2579 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[23]);
2580 { UNUR_DISTR *dg =NULL;
2581 par = unur_utdr_new(distr_localcopy);
2582 unur_utdr_set_pedantic(par,0);
2583 fpm[0] = 1.;
2584 fpm[1] = 4.;
2585 gen = unur_init(par);
2586 if (gen) {
2587 dg = unur_get_distr(gen);
2588 unur_distr_cont_set_pdfparams(dg,fpm,2);
2589 unur_distr_cont_upd_pdfarea(dg);
2590 unur_distr_cont_upd_mode(dg);
2591 unur_reinit(gen); }
2592 }
2593 if (gen) unur_utdr_chg_verify(gen,1);
2594 n_tests_failed += (run_validate_verifyhat(TESTLOG,0,gen,distr[23],'~')==UNUR_SUCCESS)?0:1000;
2595 unur_free(gen);
2596
2597 unur_distr_free(distr_localcopy);
2598 } while (0);
2599 }
2600
2601 /* distribution [24] */
2602
2603 if(TRUE) {
2604 unur_reset_errno();
2605 do {
2606 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[24]);
2607 par = unur_utdr_new(distr_localcopy);
2608 unur_utdr_set_pedantic(par,0);
2609 gen = unur_init(par);
2610 if (gen) unur_utdr_chg_verify(gen,1);
2611 n_tests_failed += (run_validate_verifyhat(TESTLOG,0,gen,distr[24],'~')==UNUR_SUCCESS)?0:1000;
2612 unur_free(gen);
2613
2614 unur_distr_free(distr_localcopy);
2615 } while (0);
2616 }
2617
2618 if(TRUE) {
2619 unur_reset_errno();
2620 do {
2621 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[24]);
2622 { UNUR_DISTR *dg =NULL;
2623 par = unur_utdr_new(distr_localcopy);
2624 unur_utdr_set_pedantic(par,0);
2625 gen = unur_init(par);
2626 if (gen) {
2627 dg = unur_get_distr(gen);
2628 unur_distr_cont_set_domain(dg,0.9,0.92);
2629 unur_distr_cont_upd_pdfarea(dg);
2630 unur_distr_cont_upd_mode(dg);
2631 unur_reinit(gen); }
2632 }
2633 if (gen) unur_utdr_chg_verify(gen,1);
2634 n_tests_failed += (run_validate_verifyhat(TESTLOG,0,gen,distr[24],'~')==UNUR_SUCCESS)?0:1000;
2635 unur_free(gen);
2636
2637 unur_distr_free(distr_localcopy);
2638 } while (0);
2639 }
2640
2641 if(TRUE) {
2642 unur_reset_errno();
2643 do {
2644 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[24]);
2645 { UNUR_DISTR *dg =NULL;
2646 par = unur_utdr_new(distr_localcopy);
2647 unur_utdr_set_pedantic(par,0);
2648 fpm[0] = 1.;
2649 fpm[1] = 4.;
2650 gen = unur_init(par);
2651 if (gen) {
2652 dg = unur_get_distr(gen);
2653 unur_distr_cont_set_pdfparams(dg,fpm,2);
2654 unur_distr_cont_upd_pdfarea(dg);
2655 unur_distr_cont_upd_mode(dg);
2656 unur_reinit(gen); }
2657 }
2658 if (gen) unur_utdr_chg_verify(gen,1);
2659 n_tests_failed += (run_validate_verifyhat(TESTLOG,0,gen,distr[24],'~')==UNUR_SUCCESS)?0:1000;
2660 unur_free(gen);
2661
2662 unur_distr_free(distr_localcopy);
2663 } while (0);
2664 }
2665
2666 /* distribution [7] */
2667
2668 if(TRUE) {
2669 unur_reset_errno();
2670 do {
2671 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[7]);
2672 par = unur_utdr_new(distr_localcopy);
2673 unur_utdr_set_pedantic(par,0);
2674 gen = unur_init(par);
2675 if (gen) unur_utdr_chg_verify(gen,1);
2676 n_tests_failed += (run_validate_verifyhat(TESTLOG,0,gen,distr[7],'~')==UNUR_SUCCESS)?0:1000;
2677 unur_free(gen);
2678
2679 unur_distr_free(distr_localcopy);
2680 } while (0);
2681 }
2682
2683 if(TRUE) {
2684 unur_reset_errno();
2685 do {
2686 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[7]);
2687 { UNUR_DISTR *dg =NULL;
2688 par = unur_utdr_new(distr_localcopy);
2689 unur_utdr_set_pedantic(par,0);
2690 gen = unur_init(par);
2691 if (gen) {
2692 dg = unur_get_distr(gen);
2693 unur_distr_cont_set_domain(dg,0.9,0.92);
2694 unur_distr_cont_upd_pdfarea(dg);
2695 unur_distr_cont_upd_mode(dg);
2696 unur_reinit(gen); }
2697 }
2698 if (gen) unur_utdr_chg_verify(gen,1);
2699 n_tests_failed += (run_validate_verifyhat(TESTLOG,0,gen,distr[7],'~')==UNUR_SUCCESS)?0:1000;
2700 unur_free(gen);
2701
2702 unur_distr_free(distr_localcopy);
2703 } while (0);
2704 }
2705
2706 if(TRUE) {
2707 unur_reset_errno();
2708 do {
2709 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[7]);
2710 { UNUR_DISTR *dg =NULL;
2711 par = unur_utdr_new(distr_localcopy);
2712 unur_utdr_set_pedantic(par,0);
2713 fpm[0] = 1.;
2714 fpm[1] = 4.;
2715 gen = unur_init(par);
2716 if (gen) {
2717 dg = unur_get_distr(gen);
2718 unur_distr_cont_set_pdfparams(dg,fpm,2);
2719 unur_distr_cont_upd_pdfarea(dg);
2720 unur_distr_cont_upd_mode(dg);
2721 unur_reinit(gen); }
2722 }
2723 if (gen) unur_utdr_chg_verify(gen,1);
2724 n_tests_failed += (run_validate_verifyhat(TESTLOG,0,gen,distr[7],'~')==UNUR_SUCCESS)?0:1000;
2725 unur_free(gen);
2726
2727 unur_distr_free(distr_localcopy);
2728 } while (0);
2729 }
2730
2731 /* distribution [8] */
2732
2733 if(TRUE) {
2734 unur_reset_errno();
2735 do {
2736 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[8]);
2737 par = unur_utdr_new(distr_localcopy);
2738 unur_utdr_set_pedantic(par,0);
2739 gen = unur_init(par);
2740 if (gen) unur_utdr_chg_verify(gen,1);
2741 n_tests_failed += (run_validate_verifyhat(TESTLOG,0,gen,distr[8],'~')==UNUR_SUCCESS)?0:1000;
2742 unur_free(gen);
2743
2744 unur_distr_free(distr_localcopy);
2745 } while (0);
2746 }
2747
2748 if(TRUE) {
2749 unur_reset_errno();
2750 do {
2751 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[8]);
2752 { UNUR_DISTR *dg =NULL;
2753 par = unur_utdr_new(distr_localcopy);
2754 unur_utdr_set_pedantic(par,0);
2755 gen = unur_init(par);
2756 if (gen) {
2757 dg = unur_get_distr(gen);
2758 unur_distr_cont_set_domain(dg,0.9,0.92);
2759 unur_distr_cont_upd_pdfarea(dg);
2760 unur_distr_cont_upd_mode(dg);
2761 unur_reinit(gen); }
2762 }
2763 if (gen) unur_utdr_chg_verify(gen,1);
2764 n_tests_failed += (run_validate_verifyhat(TESTLOG,0,gen,distr[8],'~')==UNUR_SUCCESS)?0:1000;
2765 unur_free(gen);
2766
2767 unur_distr_free(distr_localcopy);
2768 } while (0);
2769 }
2770
2771 if(TRUE) {
2772 unur_reset_errno();
2773 do {
2774 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[8]);
2775 { UNUR_DISTR *dg =NULL;
2776 par = unur_utdr_new(distr_localcopy);
2777 unur_utdr_set_pedantic(par,0);
2778 fpm[0] = 1.;
2779 fpm[1] = 4.;
2780 gen = unur_init(par);
2781 if (gen) {
2782 dg = unur_get_distr(gen);
2783 unur_distr_cont_set_pdfparams(dg,fpm,2);
2784 unur_distr_cont_upd_pdfarea(dg);
2785 unur_distr_cont_upd_mode(dg);
2786 unur_reinit(gen); }
2787 }
2788 if (gen) unur_utdr_chg_verify(gen,1);
2789 n_tests_failed += (run_validate_verifyhat(TESTLOG,0,gen,distr[8],'~')==UNUR_SUCCESS)?0:1000;
2790 unur_free(gen);
2791
2792 unur_distr_free(distr_localcopy);
2793 } while (0);
2794 }
2795
2796 /* distribution [9] */
2797
2798 if(fullcheck) {
2799 unur_reset_errno();
2800 do {
2801 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[9]);
2802 par = unur_utdr_new(distr_localcopy);
2803 unur_utdr_set_pedantic(par,0);
2804 gen = unur_init(par);
2805 if (gen) unur_utdr_chg_verify(gen,1);
2806 n_tests_failed += (run_validate_verifyhat(TESTLOG,0,gen,distr[9],'~')==UNUR_SUCCESS)?0:1000;
2807 unur_free(gen);
2808
2809 unur_distr_free(distr_localcopy);
2810 } while (0);
2811 }
2812
2813 if(fullcheck) {
2814 unur_reset_errno();
2815 do {
2816 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[9]);
2817 { UNUR_DISTR *dg =NULL;
2818 par = unur_utdr_new(distr_localcopy);
2819 unur_utdr_set_pedantic(par,0);
2820 gen = unur_init(par);
2821 if (gen) {
2822 dg = unur_get_distr(gen);
2823 unur_distr_cont_set_domain(dg,0.9,0.92);
2824 unur_distr_cont_upd_pdfarea(dg);
2825 unur_distr_cont_upd_mode(dg);
2826 unur_reinit(gen); }
2827 }
2828 if (gen) unur_utdr_chg_verify(gen,1);
2829 n_tests_failed += (run_validate_verifyhat(TESTLOG,0,gen,distr[9],'~')==UNUR_SUCCESS)?0:1000;
2830 unur_free(gen);
2831
2832 unur_distr_free(distr_localcopy);
2833 } while (0);
2834 }
2835
2836 if(fullcheck) {
2837 unur_reset_errno();
2838 do {
2839 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[9]);
2840 { UNUR_DISTR *dg =NULL;
2841 par = unur_utdr_new(distr_localcopy);
2842 unur_utdr_set_pedantic(par,0);
2843 fpm[0] = 1.;
2844 fpm[1] = 4.;
2845 gen = unur_init(par);
2846 if (gen) {
2847 dg = unur_get_distr(gen);
2848 unur_distr_cont_set_pdfparams(dg,fpm,2);
2849 unur_distr_cont_upd_pdfarea(dg);
2850 unur_distr_cont_upd_mode(dg);
2851 unur_reinit(gen); }
2852 }
2853 if (gen) unur_utdr_chg_verify(gen,1);
2854 n_tests_failed += (run_validate_verifyhat(TESTLOG,0,gen,distr[9],'~')==UNUR_SUCCESS)?0:1000;
2855 unur_free(gen);
2856
2857 unur_distr_free(distr_localcopy);
2858 } while (0);
2859 }
2860
2861 /* distribution [10] */
2862
2863 if(TRUE) {
2864 unur_reset_errno();
2865 do {
2866 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[10]);
2867 par = unur_utdr_new(distr_localcopy);
2868 unur_utdr_set_pedantic(par,0);
2869 gen = unur_init(par);
2870 if (gen) unur_utdr_chg_verify(gen,1);
2871 n_tests_failed += (run_validate_verifyhat(TESTLOG,0,gen,distr[10],'~')==UNUR_SUCCESS)?0:1000;
2872 unur_free(gen);
2873
2874 unur_distr_free(distr_localcopy);
2875 } while (0);
2876 }
2877
2878 if(TRUE) {
2879 unur_reset_errno();
2880 do {
2881 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[10]);
2882 { UNUR_DISTR *dg =NULL;
2883 par = unur_utdr_new(distr_localcopy);
2884 unur_utdr_set_pedantic(par,0);
2885 gen = unur_init(par);
2886 if (gen) {
2887 dg = unur_get_distr(gen);
2888 unur_distr_cont_set_domain(dg,0.9,0.92);
2889 unur_distr_cont_upd_pdfarea(dg);
2890 unur_distr_cont_upd_mode(dg);
2891 unur_reinit(gen); }
2892 }
2893 if (gen) unur_utdr_chg_verify(gen,1);
2894 n_tests_failed += (run_validate_verifyhat(TESTLOG,0,gen,distr[10],'~')==UNUR_SUCCESS)?0:1000;
2895 unur_free(gen);
2896
2897 unur_distr_free(distr_localcopy);
2898 } while (0);
2899 }
2900
2901 if(TRUE) {
2902 unur_reset_errno();
2903 do {
2904 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[10]);
2905 { UNUR_DISTR *dg =NULL;
2906 par = unur_utdr_new(distr_localcopy);
2907 unur_utdr_set_pedantic(par,0);
2908 fpm[0] = 1.;
2909 fpm[1] = 4.;
2910 gen = unur_init(par);
2911 if (gen) {
2912 dg = unur_get_distr(gen);
2913 unur_distr_cont_set_pdfparams(dg,fpm,2);
2914 unur_distr_cont_upd_pdfarea(dg);
2915 unur_distr_cont_upd_mode(dg);
2916 unur_reinit(gen); }
2917 }
2918 if (gen) unur_utdr_chg_verify(gen,1);
2919 n_tests_failed += (run_validate_verifyhat(TESTLOG,0,gen,distr[10],'~')==UNUR_SUCCESS)?0:1000;
2920 unur_free(gen);
2921
2922 unur_distr_free(distr_localcopy);
2923 } while (0);
2924 }
2925
2926 /* distribution [11] */
2927
2928 if(TRUE) {
2929 unur_reset_errno();
2930 do {
2931 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[11]);
2932 par = unur_utdr_new(distr_localcopy);
2933 unur_utdr_set_pedantic(par,0);
2934 gen = unur_init(par);
2935 if (gen) unur_utdr_chg_verify(gen,1);
2936 n_tests_failed += (run_validate_verifyhat(TESTLOG,0,gen,distr[11],'~')==UNUR_SUCCESS)?0:1000;
2937 unur_free(gen);
2938
2939 unur_distr_free(distr_localcopy);
2940 } while (0);
2941 }
2942
2943 if(TRUE) {
2944 unur_reset_errno();
2945 do {
2946 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[11]);
2947 { UNUR_DISTR *dg =NULL;
2948 par = unur_utdr_new(distr_localcopy);
2949 unur_utdr_set_pedantic(par,0);
2950 gen = unur_init(par);
2951 if (gen) {
2952 dg = unur_get_distr(gen);
2953 unur_distr_cont_set_domain(dg,0.9,0.92);
2954 unur_distr_cont_upd_pdfarea(dg);
2955 unur_distr_cont_upd_mode(dg);
2956 unur_reinit(gen); }
2957 }
2958 if (gen) unur_utdr_chg_verify(gen,1);
2959 n_tests_failed += (run_validate_verifyhat(TESTLOG,0,gen,distr[11],'~')==UNUR_SUCCESS)?0:1000;
2960 unur_free(gen);
2961
2962 unur_distr_free(distr_localcopy);
2963 } while (0);
2964 }
2965
2966 if(TRUE) {
2967 printf("."); fflush(stdout);
2968 }
2969
2970 /* distribution [12] */
2971
2972 if(TRUE) {
2973 unur_reset_errno();
2974 do {
2975 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[12]);
2976 par = unur_utdr_new(distr_localcopy);
2977 unur_utdr_set_pedantic(par,0);
2978 gen = unur_init(par);
2979 if (gen) unur_utdr_chg_verify(gen,1);
2980 n_tests_failed += (run_validate_verifyhat(TESTLOG,0,gen,distr[12],'~')==UNUR_SUCCESS)?0:1000;
2981 unur_free(gen);
2982
2983 unur_distr_free(distr_localcopy);
2984 } while (0);
2985 }
2986
2987 if(TRUE) {
2988 unur_reset_errno();
2989 do {
2990 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[12]);
2991 { UNUR_DISTR *dg =NULL;
2992 par = unur_utdr_new(distr_localcopy);
2993 unur_utdr_set_pedantic(par,0);
2994 gen = unur_init(par);
2995 if (gen) {
2996 dg = unur_get_distr(gen);
2997 unur_distr_cont_set_domain(dg,0.9,0.92);
2998 unur_distr_cont_upd_pdfarea(dg);
2999 unur_distr_cont_upd_mode(dg);
3000 unur_reinit(gen); }
3001 }
3002 if (gen) unur_utdr_chg_verify(gen,1);
3003 n_tests_failed += (run_validate_verifyhat(TESTLOG,0,gen,distr[12],'~')==UNUR_SUCCESS)?0:1000;
3004 unur_free(gen);
3005
3006 unur_distr_free(distr_localcopy);
3007 } while (0);
3008 }
3009
3010 if(TRUE) {
3011 printf("."); fflush(stdout);
3012 }
3013
3014 /* distribution [13] */
3015
3016 if(fullcheck) {
3017 unur_reset_errno();
3018 do {
3019 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[13]);
3020 par = unur_utdr_new(distr_localcopy);
3021 unur_utdr_set_pedantic(par,0);
3022 gen = unur_init(par);
3023 if (gen) unur_utdr_chg_verify(gen,1);
3024 n_tests_failed += (run_validate_verifyhat(TESTLOG,0,gen,distr[13],'~')==UNUR_SUCCESS)?0:1000;
3025 unur_free(gen);
3026
3027 unur_distr_free(distr_localcopy);
3028 } while (0);
3029 }
3030
3031 if(fullcheck) {
3032 printf("."); fflush(stdout);
3033 }
3034
3035 if(fullcheck) {
3036 printf("."); fflush(stdout);
3037 }
3038
3039 /* distribution [14] */
3040
3041 if(TRUE) {
3042 unur_reset_errno();
3043 do {
3044 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[14]);
3045 par = unur_utdr_new(distr_localcopy);
3046 unur_utdr_set_pedantic(par,0);
3047 gen = unur_init(par);
3048 if (gen) unur_utdr_chg_verify(gen,1);
3049 n_tests_failed += (run_validate_verifyhat(TESTLOG,0,gen,distr[14],'~')==UNUR_SUCCESS)?0:1000;
3050 unur_free(gen);
3051
3052 unur_distr_free(distr_localcopy);
3053 } while (0);
3054 }
3055
3056 if(TRUE) {
3057 unur_reset_errno();
3058 do {
3059 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[14]);
3060 { UNUR_DISTR *dg =NULL;
3061 par = unur_utdr_new(distr_localcopy);
3062 unur_utdr_set_pedantic(par,0);
3063 gen = unur_init(par);
3064 if (gen) {
3065 dg = unur_get_distr(gen);
3066 unur_distr_cont_set_domain(dg,0.9,0.92);
3067 unur_distr_cont_upd_pdfarea(dg);
3068 unur_distr_cont_upd_mode(dg);
3069 unur_reinit(gen); }
3070 }
3071 if (gen) unur_utdr_chg_verify(gen,1);
3072 n_tests_failed += (run_validate_verifyhat(TESTLOG,0,gen,distr[14],'~')==UNUR_SUCCESS)?0:1000;
3073 unur_free(gen);
3074
3075 unur_distr_free(distr_localcopy);
3076 } while (0);
3077 }
3078
3079 if(TRUE) {
3080 printf("."); fflush(stdout);
3081 }
3082
3083 /* distribution [15] */
3084
3085 if(fullcheck) {
3086 unur_reset_errno();
3087 do {
3088 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[15]);
3089 par = unur_utdr_new(distr_localcopy);
3090 unur_utdr_set_pedantic(par,0);
3091 gen = unur_init(par);
3092 if (gen) unur_utdr_chg_verify(gen,1);
3093 n_tests_failed += (run_validate_verifyhat(TESTLOG,0,gen,distr[15],'~')==UNUR_SUCCESS)?0:1000;
3094 unur_free(gen);
3095
3096 unur_distr_free(distr_localcopy);
3097 } while (0);
3098 }
3099
3100 if(fullcheck) {
3101 printf("."); fflush(stdout);
3102 }
3103
3104 if(fullcheck) {
3105 printf("."); fflush(stdout);
3106 }
3107
3108 /* distribution [16] */
3109
3110 if(fullcheck) {
3111 unur_reset_errno();
3112 do {
3113 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[16]);
3114 par = unur_utdr_new(distr_localcopy);
3115 unur_utdr_set_pedantic(par,0);
3116 gen = unur_init(par);
3117 if (gen) unur_utdr_chg_verify(gen,1);
3118 n_tests_failed += (run_validate_verifyhat(TESTLOG,0,gen,distr[16],'~')==UNUR_SUCCESS)?0:1000;
3119 unur_free(gen);
3120
3121 unur_distr_free(distr_localcopy);
3122 } while (0);
3123 }
3124
3125 if(fullcheck) {
3126 printf("."); fflush(stdout);
3127 }
3128
3129 if(fullcheck) {
3130 printf("."); fflush(stdout);
3131 }
3132
3133 /* distribution [25] */
3134
3135 if(TRUE) {
3136 unur_reset_errno();
3137 do {
3138 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[25]);
3139 par = unur_utdr_new(distr_localcopy);
3140 unur_utdr_set_pedantic(par,0);
3141 gen = unur_init(par);
3142 if (gen) unur_utdr_chg_verify(gen,1);
3143 n_tests_failed += (run_validate_verifyhat(TESTLOG,0,gen,distr[25],'~')==UNUR_SUCCESS)?0:1000;
3144 unur_free(gen);
3145
3146 unur_distr_free(distr_localcopy);
3147 } while (0);
3148 }
3149
3150 if(TRUE) {
3151 unur_reset_errno();
3152 do {
3153 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[25]);
3154 { UNUR_DISTR *dg =NULL;
3155 par = unur_utdr_new(distr_localcopy);
3156 unur_utdr_set_pedantic(par,0);
3157 gen = unur_init(par);
3158 if (gen) {
3159 dg = unur_get_distr(gen);
3160 unur_distr_cont_set_domain(dg,0.9,0.92);
3161 unur_distr_cont_upd_pdfarea(dg);
3162 unur_distr_cont_upd_mode(dg);
3163 unur_reinit(gen); }
3164 }
3165 if (gen) unur_utdr_chg_verify(gen,1);
3166 n_tests_failed += (run_validate_verifyhat(TESTLOG,0,gen,distr[25],'~')==UNUR_SUCCESS)?0:1000;
3167 unur_free(gen);
3168
3169 unur_distr_free(distr_localcopy);
3170 } while (0);
3171 }
3172
3173 if(TRUE) {
3174 unur_reset_errno();
3175 do {
3176 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[25]);
3177 { UNUR_DISTR *dg =NULL;
3178 par = unur_utdr_new(distr_localcopy);
3179 unur_utdr_set_pedantic(par,0);
3180 fpm[0] = 1.;
3181 fpm[1] = 4.;
3182 gen = unur_init(par);
3183 if (gen) {
3184 dg = unur_get_distr(gen);
3185 unur_distr_cont_set_pdfparams(dg,fpm,2);
3186 unur_distr_cont_upd_pdfarea(dg);
3187 unur_distr_cont_upd_mode(dg);
3188 unur_reinit(gen); }
3189 }
3190 if (gen) unur_utdr_chg_verify(gen,1);
3191 n_tests_failed += (run_validate_verifyhat(TESTLOG,0,gen,distr[25],'~')==UNUR_SUCCESS)?0:1000;
3192 unur_free(gen);
3193
3194 unur_distr_free(distr_localcopy);
3195 } while (0);
3196 }
3197
3198 /* distribution [26] */
3199
3200 if(TRUE) {
3201 unur_reset_errno();
3202 do {
3203 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[26]);
3204 par = unur_utdr_new(distr_localcopy);
3205 unur_utdr_set_pedantic(par,0);
3206 gen = unur_init(par);
3207 if (gen) unur_utdr_chg_verify(gen,1);
3208 n_tests_failed += (run_validate_verifyhat(TESTLOG,0,gen,distr[26],'~')==UNUR_SUCCESS)?0:1000;
3209 unur_free(gen);
3210
3211 unur_distr_free(distr_localcopy);
3212 } while (0);
3213 }
3214
3215 if(TRUE) {
3216 unur_reset_errno();
3217 do {
3218 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[26]);
3219 { UNUR_DISTR *dg =NULL;
3220 par = unur_utdr_new(distr_localcopy);
3221 unur_utdr_set_pedantic(par,0);
3222 gen = unur_init(par);
3223 if (gen) {
3224 dg = unur_get_distr(gen);
3225 unur_distr_cont_set_domain(dg,0.9,0.92);
3226 unur_distr_cont_upd_pdfarea(dg);
3227 unur_distr_cont_upd_mode(dg);
3228 unur_reinit(gen); }
3229 }
3230 if (gen) unur_utdr_chg_verify(gen,1);
3231 n_tests_failed += (run_validate_verifyhat(TESTLOG,0,gen,distr[26],'~')==UNUR_SUCCESS)?0:1000;
3232 unur_free(gen);
3233
3234 unur_distr_free(distr_localcopy);
3235 } while (0);
3236 }
3237
3238 if(TRUE) {
3239 unur_reset_errno();
3240 do {
3241 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[26]);
3242 { UNUR_DISTR *dg =NULL;
3243 par = unur_utdr_new(distr_localcopy);
3244 unur_utdr_set_pedantic(par,0);
3245 fpm[0] = 1.;
3246 fpm[1] = 4.;
3247 gen = unur_init(par);
3248 if (gen) {
3249 dg = unur_get_distr(gen);
3250 unur_distr_cont_set_pdfparams(dg,fpm,2);
3251 unur_distr_cont_upd_pdfarea(dg);
3252 unur_distr_cont_upd_mode(dg);
3253 unur_reinit(gen); }
3254 }
3255 if (gen) unur_utdr_chg_verify(gen,1);
3256 n_tests_failed += (run_validate_verifyhat(TESTLOG,0,gen,distr[26],'~')==UNUR_SUCCESS)?0:1000;
3257 unur_free(gen);
3258
3259 unur_distr_free(distr_localcopy);
3260 } while (0);
3261 }
3262
3263 /* distribution [17] */
3264
3265 if(TRUE) {
3266 unur_reset_errno();
3267 do {
3268 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[17]);
3269 par = unur_utdr_new(distr_localcopy);
3270 unur_utdr_set_pedantic(par,0);
3271 gen = unur_init(par);
3272 if (gen) unur_utdr_chg_verify(gen,1);
3273 n_tests_failed += (run_validate_verifyhat(TESTLOG,0,gen,distr[17],'~')==UNUR_SUCCESS)?0:1000;
3274 unur_free(gen);
3275
3276 unur_distr_free(distr_localcopy);
3277 } while (0);
3278 }
3279
3280 if(TRUE) {
3281 unur_reset_errno();
3282 do {
3283 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[17]);
3284 { UNUR_DISTR *dg =NULL;
3285 par = unur_utdr_new(distr_localcopy);
3286 unur_utdr_set_pedantic(par,0);
3287 gen = unur_init(par);
3288 if (gen) {
3289 dg = unur_get_distr(gen);
3290 unur_distr_cont_set_domain(dg,0.9,0.92);
3291 unur_distr_cont_upd_pdfarea(dg);
3292 unur_distr_cont_upd_mode(dg);
3293 unur_reinit(gen); }
3294 }
3295 if (gen) unur_utdr_chg_verify(gen,1);
3296 n_tests_failed += (run_validate_verifyhat(TESTLOG,0,gen,distr[17],'~')==UNUR_SUCCESS)?0:1000;
3297 unur_free(gen);
3298
3299 unur_distr_free(distr_localcopy);
3300 } while (0);
3301 }
3302
3303 if(TRUE) {
3304 unur_reset_errno();
3305 do {
3306 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[17]);
3307 { UNUR_DISTR *dg =NULL;
3308 par = unur_utdr_new(distr_localcopy);
3309 unur_utdr_set_pedantic(par,0);
3310 fpm[0] = 1.;
3311 fpm[1] = 4.;
3312 gen = unur_init(par);
3313 if (gen) {
3314 dg = unur_get_distr(gen);
3315 unur_distr_cont_set_pdfparams(dg,fpm,2);
3316 unur_distr_cont_upd_pdfarea(dg);
3317 unur_distr_cont_upd_mode(dg);
3318 unur_reinit(gen); }
3319 }
3320 if (gen) unur_utdr_chg_verify(gen,1);
3321 n_tests_failed += (run_validate_verifyhat(TESTLOG,0,gen,distr[17],'~')==UNUR_SUCCESS)?0:1000;
3322 unur_free(gen);
3323
3324 unur_distr_free(distr_localcopy);
3325 } while (0);
3326 }
3327
3328 /* distribution [18] */
3329
3330 if(fullcheck) {
3331 unur_reset_errno();
3332 do {
3333 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[18]);
3334 par = unur_utdr_new(distr_localcopy);
3335 unur_utdr_set_pedantic(par,0);
3336 gen = unur_init(par);
3337 if (gen) unur_utdr_chg_verify(gen,1);
3338 n_tests_failed += (run_validate_verifyhat(TESTLOG,0,gen,distr[18],'~')==UNUR_SUCCESS)?0:1000;
3339 unur_free(gen);
3340
3341 unur_distr_free(distr_localcopy);
3342 } while (0);
3343 }
3344
3345 if(fullcheck) {
3346 printf("."); fflush(stdout);
3347 }
3348
3349 if(fullcheck) {
3350 unur_reset_errno();
3351 do {
3352 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[18]);
3353 { UNUR_DISTR *dg =NULL;
3354 par = unur_utdr_new(distr_localcopy);
3355 unur_utdr_set_pedantic(par,0);
3356 fpm[0] = 1.;
3357 fpm[1] = 4.;
3358 gen = unur_init(par);
3359 if (gen) {
3360 dg = unur_get_distr(gen);
3361 unur_distr_cont_set_pdfparams(dg,fpm,2);
3362 unur_distr_cont_upd_pdfarea(dg);
3363 unur_distr_cont_upd_mode(dg);
3364 unur_reinit(gen); }
3365 }
3366 if (gen) unur_utdr_chg_verify(gen,1);
3367 n_tests_failed += (run_validate_verifyhat(TESTLOG,0,gen,distr[18],'~')==UNUR_SUCCESS)?0:1000;
3368 unur_free(gen);
3369
3370 unur_distr_free(distr_localcopy);
3371 } while (0);
3372 }
3373
3374 /* distribution [19] */
3375
3376 if(TRUE) {
3377 unur_reset_errno();
3378 do {
3379 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[19]);
3380 par = unur_utdr_new(distr_localcopy);
3381 unur_utdr_set_pedantic(par,0);
3382 gen = unur_init(par);
3383 if (gen) unur_utdr_chg_verify(gen,1);
3384 n_tests_failed += (run_validate_verifyhat(TESTLOG,0,gen,distr[19],'~')==UNUR_SUCCESS)?0:1000;
3385 unur_free(gen);
3386
3387 unur_distr_free(distr_localcopy);
3388 } while (0);
3389 }
3390
3391 if(TRUE) {
3392 printf("."); fflush(stdout);
3393 }
3394
3395 if(TRUE) {
3396 printf("."); fflush(stdout);
3397 }
3398
3399 /* distribution [20] */
3400
3401 if(TRUE) {
3402 unur_reset_errno();
3403 do {
3404 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[20]);
3405 par = unur_utdr_new(distr_localcopy);
3406 unur_utdr_set_pedantic(par,0);
3407 gen = unur_init(par);
3408 if (gen) unur_utdr_chg_verify(gen,1);
3409 n_tests_failed += (run_validate_verifyhat(TESTLOG,0,gen,distr[20],'~')==UNUR_SUCCESS)?0:1000;
3410 unur_free(gen);
3411
3412 unur_distr_free(distr_localcopy);
3413 } while (0);
3414 }
3415
3416 if(TRUE) {
3417 unur_reset_errno();
3418 do {
3419 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[20]);
3420 { UNUR_DISTR *dg =NULL;
3421 par = unur_utdr_new(distr_localcopy);
3422 unur_utdr_set_pedantic(par,0);
3423 gen = unur_init(par);
3424 if (gen) {
3425 dg = unur_get_distr(gen);
3426 unur_distr_cont_set_domain(dg,0.9,0.92);
3427 unur_distr_cont_upd_pdfarea(dg);
3428 unur_distr_cont_upd_mode(dg);
3429 unur_reinit(gen); }
3430 }
3431 if (gen) unur_utdr_chg_verify(gen,1);
3432 n_tests_failed += (run_validate_verifyhat(TESTLOG,0,gen,distr[20],'~')==UNUR_SUCCESS)?0:1000;
3433 unur_free(gen);
3434
3435 unur_distr_free(distr_localcopy);
3436 } while (0);
3437 }
3438
3439 if(TRUE) {
3440 printf("."); fflush(stdout);
3441 }
3442
3443 /* distribution [21] */
3444
3445 if(TRUE) {
3446 unur_reset_errno();
3447 do {
3448 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[21]);
3449 par = unur_utdr_new(distr_localcopy);
3450 unur_utdr_set_pedantic(par,0);
3451 gen = unur_init(par);
3452 if (gen) unur_utdr_chg_verify(gen,1);
3453 n_tests_failed += (run_validate_verifyhat(TESTLOG,0,gen,distr[21],'~')==UNUR_SUCCESS)?0:1000;
3454 unur_free(gen);
3455
3456 unur_distr_free(distr_localcopy);
3457 } while (0);
3458 }
3459
3460 if(TRUE) {
3461 printf("."); fflush(stdout);
3462 }
3463
3464 if(TRUE) {
3465 unur_reset_errno();
3466 do {
3467 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[21]);
3468 { UNUR_DISTR *dg =NULL;
3469 par = unur_utdr_new(distr_localcopy);
3470 unur_utdr_set_pedantic(par,0);
3471 fpm[0] = 1.;
3472 fpm[1] = 4.;
3473 gen = unur_init(par);
3474 if (gen) {
3475 dg = unur_get_distr(gen);
3476 unur_distr_cont_set_pdfparams(dg,fpm,2);
3477 unur_distr_cont_upd_pdfarea(dg);
3478 unur_distr_cont_upd_mode(dg);
3479 unur_reinit(gen); }
3480 }
3481 if (gen) unur_utdr_chg_verify(gen,1);
3482 n_tests_failed += (run_validate_verifyhat(TESTLOG,0,gen,distr[21],'~')==UNUR_SUCCESS)?0:1000;
3483 unur_free(gen);
3484
3485 unur_distr_free(distr_localcopy);
3486 } while (0);
3487 }
3488
3489 /* distribution [22] */
3490
3491 if(TRUE) {
3492 unur_reset_errno();
3493 do {
3494 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[22]);
3495 par = unur_utdr_new(distr_localcopy);
3496 unur_utdr_set_pedantic(par,0);
3497 gen = unur_init(par);
3498 if (gen) unur_utdr_chg_verify(gen,1);
3499 n_tests_failed += (run_validate_verifyhat(TESTLOG,0,gen,distr[22],'~')==UNUR_SUCCESS)?0:1000;
3500 unur_free(gen);
3501
3502 unur_distr_free(distr_localcopy);
3503 } while (0);
3504 }
3505
3506 if(TRUE) {
3507 unur_reset_errno();
3508 do {
3509 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[22]);
3510 { UNUR_DISTR *dg =NULL;
3511 par = unur_utdr_new(distr_localcopy);
3512 unur_utdr_set_pedantic(par,0);
3513 gen = unur_init(par);
3514 if (gen) {
3515 dg = unur_get_distr(gen);
3516 unur_distr_cont_set_domain(dg,0.9,0.92);
3517 unur_distr_cont_upd_pdfarea(dg);
3518 unur_distr_cont_upd_mode(dg);
3519 unur_reinit(gen); }
3520 }
3521 if (gen) unur_utdr_chg_verify(gen,1);
3522 n_tests_failed += (run_validate_verifyhat(TESTLOG,0,gen,distr[22],'~')==UNUR_SUCCESS)?0:1000;
3523 unur_free(gen);
3524
3525 unur_distr_free(distr_localcopy);
3526 } while (0);
3527 }
3528
3529 if(TRUE) {
3530 unur_reset_errno();
3531 do {
3532 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[22]);
3533 { UNUR_DISTR *dg =NULL;
3534 par = unur_utdr_new(distr_localcopy);
3535 unur_utdr_set_pedantic(par,0);
3536 fpm[0] = 1.;
3537 fpm[1] = 4.;
3538 gen = unur_init(par);
3539 if (gen) {
3540 dg = unur_get_distr(gen);
3541 unur_distr_cont_set_pdfparams(dg,fpm,2);
3542 unur_distr_cont_upd_pdfarea(dg);
3543 unur_distr_cont_upd_mode(dg);
3544 unur_reinit(gen); }
3545 }
3546 if (gen) unur_utdr_chg_verify(gen,1);
3547 n_tests_failed += (run_validate_verifyhat(TESTLOG,0,gen,distr[22],'~')==UNUR_SUCCESS)?0:1000;
3548 unur_free(gen);
3549
3550 unur_distr_free(distr_localcopy);
3551 } while (0);
3552 }
3553
3554 /* distribution [27] */
3555
3556 if(TRUE) {
3557 unur_reset_errno();
3558 do {
3559 UNUR_DISTR *distr_localcopy = unur_distr_clone(distr[27]);
3560 par = unur_utdr_new(distr_localcopy);
3561 unur_utdr_set_pedantic(par,0);
3562 gen = unur_init(par);
3563 if (gen) unur_utdr_chg_verify(gen,1);
3564 n_tests_failed += (run_validate_verifyhat(TESTLOG,0,gen,distr[27],'~')==UNUR_SUCCESS)?0:1000;
3565 unur_free(gen);
3566
3567 unur_distr_free(distr_localcopy);
3568 } while (0);
3569 }
3570
3571 if(TRUE) {
3572 printf("."); fflush(stdout);
3573 }
3574
3575 if(TRUE) {
3576 printf("."); fflush(stdout);
3577 }
3578
3579 /* timing */
3580 stopwatch_print(TESTLOG,"\n<*>time = %.0f ms\n", stopwatch_lap(&watch));
3581
3582
3583 /* free distributions */
3584 unur_distr_free(distr[0]);
3585 unur_distr_free(distr[1]);
3586 unur_distr_free(distr[2]);
3587 unur_distr_free(distr[3]);
3588 unur_distr_free(distr[4]);
3589 unur_distr_free(distr[5]);
3590 unur_distr_free(distr[6]);
3591 unur_distr_free(distr[7]);
3592 unur_distr_free(distr[8]);
3593 unur_distr_free(distr[9]);
3594 unur_distr_free(distr[10]);
3595 unur_distr_free(distr[11]);
3596 unur_distr_free(distr[12]);
3597 unur_distr_free(distr[13]);
3598 unur_distr_free(distr[14]);
3599 unur_distr_free(distr[15]);
3600 unur_distr_free(distr[16]);
3601 unur_distr_free(distr[17]);
3602 unur_distr_free(distr[18]);
3603 unur_distr_free(distr[19]);
3604 unur_distr_free(distr[20]);
3605 unur_distr_free(distr[21]);
3606 unur_distr_free(distr[22]);
3607 unur_distr_free(distr[23]);
3608 unur_distr_free(distr[24]);
3609 unur_distr_free(distr[25]);
3610 unur_distr_free(distr[26]);
3611 unur_distr_free(distr[27]);
3612 unur_distr_free(distr[28]);
3613
3614 /* test finished */
3615 test_ok &= (n_tests_failed>CHI2_FAILURES_TOLERATED) ? 0 : 1;
3616 /* we accept CHI2_FAILURES_TOLERATED failures */
3617 (n_tests_failed>CHI2_FAILURES_TOLERATED) ? printf(" ==> failed] ") : printf(" ==> ok] ");
3618
3619 /* prevent compiler from making useless annoying warnings */
3620 distr[0] = NULL;
3621 par = NULL;
3622 gen = NULL;
3623 darray = NULL;
3624 fpm[0] = 0.;
3625
3626 } /* end of test_validate */
3627
3628
3629 /*---------------------------------------------------------------------------*/
3630 /* run generator in verifying mode */
3631
run_verify_generator(FILE * LOG,int line,UNUR_PAR * par)3632 void run_verify_generator( FILE *LOG, int line, UNUR_PAR *par )
3633 {
3634 UNUR_GEN *gen;
3635 int i;
3636
3637 /* switch to verifying mode */
3638 unur_utdr_set_verify(par,1);
3639
3640 /* initialize generator */
3641 gen = unur_init( par ); abort_if_NULL(LOG, line, gen);
3642
3643 /* run generator */
3644 for (i=0; i<VIOLATE_SAMPLE_SIZE; i++)
3645 unur_sample_cont(gen);
3646
3647 /* destroy generator */
3648 unur_free(gen);
3649
3650 } /* end of run_verify_generator() */
3651
3652
3653 /*---------------------------------------------------------------------------*/
3654
main(void)3655 int main(void)
3656 {
3657 unsigned long seed;
3658 char *str_seed, *str_tail;
3659
3660 /* start stop watch */
3661 stopwatch_init();
3662 stopwatch_start(&watch);
3663
3664 /* open log file for unuran and set output stream for unuran messages */
3665 UNURANLOG = fopen( "t_utdr_unuran.log","w" );
3666 abort_if_NULL( stderr,-1, UNURANLOG );
3667 unur_set_stream( UNURANLOG );
3668
3669 /* open log file for testing */
3670 TESTLOG = fopen( "t_utdr_test.log","w" );
3671 abort_if_NULL( stderr,-1, TESTLOG );
3672
3673 /* seed for uniform generators */
3674
3675 /* seed set by environment */
3676 str_seed = getenv("SEED");
3677
3678 if (str_seed != NULL) {
3679 seed = strtol(str_seed, &str_tail, 10);
3680 if (seed == 0u)
3681 seed = 849322;
3682 }
3683 else {
3684 #ifdef SEED
3685 seed = SEED;
3686 #else
3687 seed = 849322;
3688 #endif
3689 }
3690
3691 /* seed build-in uniform generators */
3692 unur_urng_MRG31k3p_seed(NULL,seed);
3693 unur_urng_fish_seed(NULL,seed);
3694 unur_urng_mstd_seed(NULL,seed);
3695
3696 /* seed uniform random number generator */
3697 #ifdef UNUR_URNG_UNURAN
3698 # ifdef UNUR_URNG_DEFAULT_RNGSTREAM
3699 {
3700 unsigned long sa[6];
3701 int i;
3702 for (i=0; i<6; i++) sa[i] = seed;
3703 RngStream_SetPackageSeed(sa);
3704 }
3705 # else
3706 if (unur_urng_seed(NULL,seed) != UNUR_SUCCESS) {
3707 fprintf(stderr,"WARNING: Seed could not be set at random\n");
3708 seed = ~0u;
3709 }
3710 # endif /* UNUR_URNG_DEFAULT_RNGSTREAM */
3711 #endif /* UNUR_URNG_UNURAN */
3712
3713 /* set default debugging flag */
3714 unur_set_default_debug(UNUR_DEBUG_ALL);
3715
3716 /* detect required check mode */
3717 fullcheck = (getenv("UNURANFULLCHECK")==NULL) ? FALSE : TRUE;
3718
3719 /* write header into log file */
3720 print_test_log_header( TESTLOG, seed, fullcheck );
3721
3722 /* set timer for sending SIGALRM signal */
3723 set_alarm(TESTLOG);
3724
3725 /* start test */
3726 printf("utdr: ");
3727
3728 /* run tests */
3729 test_new();
3730 test_set();
3731 test_chg();
3732 test_init();
3733 test_reinit();
3734 test_sample();
3735 test_validate();
3736
3737
3738 /* test finished */
3739 printf("\n"); fflush(stdout);
3740
3741 /* close log files */
3742 fprintf(TESTLOG,"\n====================================================\n\n");
3743 if (test_ok)
3744 fprintf(TESTLOG,"All tests PASSED.\n");
3745 else
3746 fprintf(TESTLOG,"Test(s) FAILED.\n");
3747
3748 /* timing */
3749 stopwatch_print(TESTLOG,"\n<*>total time = %.0f ms\n\n", stopwatch_stop(&watch));
3750
3751 fclose(UNURANLOG);
3752 fclose(TESTLOG);
3753
3754 /* free memory */
3755 compare_free_memory();
3756 unur_urng_free(unur_get_default_urng());
3757 unur_urng_free(unur_get_default_urng_aux());
3758
3759 /* exit */
3760 exit( (test_ok) ? EXIT_SUCCESS : EXIT_FAILURE );
3761
3762 } /* end of main */
3763
3764