1# $Id: README.conf 5330 2011-04-19 10:50:18Z leydold $
2#############################################################################
3#
4# Config file for test routines
5#
6# This file contains section with subsections.
7# Sections are indicated by [<sect>], subsections by [<sect> - <subsect>:]
8# (the brackets '[]', the dash '-' and the colon ':' are required).
9# There must be a line break after the closing bracket ']'.
10#
11# The names of the other sections can be arbitrary. However there are some
12# restrictions:
13#
14# (*) There alway must be a section [main].
15#
16# (*) There must no be section [start] nor a subjection [<sect> - start:].
17#
18# (*) The sections [main], [verbatim], [validate], and [special]
19# are reserved and have a special meaning.
20#
21# Lines starting with '#' are ignored (comments). Similarly any text from
22# '#' til the end of a line is deleted.
23# `#' can be inserted by using `\#'.
24#
25#############################################################################
26#
27# [main]
28#
29# Section [main] contains global data and there must be two subsections:
30# [main - data:] and [main - header:]
31#
32# Subsection [main - data:] must contain the following keywords:
33#
34# (*) method: <name of method>
35# e.g.
36# method: AROU
37#
38# Everything in the subsection [main - header:] is copied verbatim
39# into the C file header.
40# eg. for prototypes for functions defined in section [verbatim].
41#
42# Important: C header files can be included here. However, the path
43# must be relative to the 'top_srcdir' directory.
44#
45# Moreover this subsection must contain the following to definitions:
46# static int COMPARE_SAMPLE_SIZE = 500;
47# static int VIOLATE_SAMPLE_SIZE = 20; /* or any appropriate samples size */
48#
49# Optionally the following macros can be defined:
50# (defaults given in brackets)
51#
52# CHI2_FAILURES_TOLERATED (2):
53# number of failures in section [validate - test chi2:], see below
54#
55# SEED:
56# if defined it is used to set the seed of the random number generator
57#
58# Notice: One also can set a global seed by setting the environment
59# variable 'SEED'. This is used in every generated C test file instead
60# of a randomly chosen one. However, it is overridden by the macro
61# 'SEED' #defined in the conf file.
62#
63# Both settings, however, are overwritten at runtime when the
64# environmental variable 'SEED' is defined.
65#
66#############################################################################
67#
68# [verbatim]
69#
70# Everthing in section [verbatim] is copies AS IS into the C file immediately
71# after the C file header.
72#
73#
74#############################################################################
75#
76# [special]
77#
78# There any tests can be added. There must be two subsections:
79#
80# [special - decl:]
81# Contains all declarations.
82#
83# [special - start:]
84# Contains the actual code
85# The variable FAILED should be set to a nonzero interger if one (or more)
86# tests have failed.
87#
88#############################################################################
89#
90# [validate]
91#
92# Section [validate] describes tests for the implemented generators.
93#
94# It contains the following subsections:
95#
96# [validate - generators:]
97# List of generator types. Each type has to be declared by the
98# corresponding UNU.RAN calls to build a parameter object.
99# Different types are separated by empty lines.
100# The parameter object must be called `par[x]', where `x'
101# is an integer. It can be used for numbering the objects. However
102# this is just for convinience since it is ignored when scanning
103# the file. internally the first parameter object that appear in
104# the file is labeled with `0' the second with `1', and so on.
105#
106# IMPORTANT: the distribution object in the unur_..._new() call
107# has to be encoded by `@distr@'.
108# Example: to get a parameter object for method TDR and change
109# the parameter c you have to write:
110# par[0] = unur_tdr_new(@distr@);
111# unur_tdr_set_c(par[0],0.);
112#
113# It is also possible to change an existing generator object.
114# The generator object must be called `gen'.
115# It is not necessary (and even verboten) to call unur_init().
116# Example: To get a generator for method SROU, change the domain
117# of the distribution, and reinitialize the generator
118# you have to write:
119# par[1] = unur_srou_new(@distr@);
120# unur_srou_chg_domain(gen,0.9,0.91);
121# unur_srou_upd_pdfarea(gen);
122# unur_srou_upd_mode(gen);
123# unur_srou_reinit(gen);
124#
125#
126# [validate - distributions:]
127# List of distributions. Each distribution object has to be
128# declared by the corresponding UNU.RAN calls.
129# Different distibutions are separated by empty lines.
130# If a pointer to a double array is required use `darray'.
131# If an array for parameters of the PDF is required use `fpm'.
132# The distribution object must be called `distr[x]', where
133# `x' is an integer. `x' is used to refer to this distribution
134# object.
135#
136# IMPORTANT: when there n distributions, all the `x' must be
137# different and run through 1,...,n. There is no checking! (However
138# the C compiler might complain.)
139#
140#
141# [validate - test chi2:]
142# Run chi-square goodness-of-fit tests.
143# The threshold p-value for a failure is set by the constant
144# PVAL_LIMIT in file 'testunuran.h' (currently 1.e-3).
145# A failed test is repeated once.
146# The entire test is failed if
147# - a particular test fails twice
148# - more than 'CHI2_FAILURES_TOLERATED' particular tests fail
149# at least once
150# The default for CHI2_FAILURES_TOLERATED is 2 and can be changed
151# In section [main] in the '*.conf' file (see above).
152# Notice: "Real" failures count for 1000 "soft" failures.
153#
154# The section contains a table which test has to be performed.
155# Each line starts with `<dd>' where `dd' indicates the number of the
156# distributions as declared in section [validate - distributions:].
157# One lines contains the tests that should be performed by with
158# a particular distribution.
159# Each line consists of the `<dd>' marker followed by a list of
160# one character symbols. All entries are separated by white space
161# characters. There must be one symbol for each of the generator
162# types declared in subsection [validate - generators:] that
163# describes the expected result of the test when performed with the
164# choosen generator and the choosen distribution.
165# The following symbols can be used:
166# + should pass test
167# 0 should fail to initialize generator
168# - should fail to iniialize or fail the test (not implemented yet)
169# / either init fails or test successful (necessary for special generators)
170# . do not run the test
171#
172# Each line can be preceded by the letters 'x' or 'X' to exclude the
173# corresponding tests from 'make check' runs.
174# These optional tests are then only run when the environment variable
175# 'UNURANFULLCHECK' is defined (regardless of the actual value of the
176# variable). Likewise it is possible to mark particular tests for a
177# distribution by prefixing the corresponding symbol ('+', '0', '-',
178# '/', or '.') by a single 'x' or 'X'; no blanks are allowed between
179# 'x' and the symbol.
180#
181# Example:
182#
183# #par [0] [1] [2]
184# #---------------------------
185# <0> + + .
186# <1> - + 0
187# <2> - + 0
188# <3> + + -
189# <4> + - .
190# x<5> + . -
191# <6> x+ + x+
192#
193# That is:
194# run test and expect that the test is passed for
195# distribution 0 with generator 0 and 1
196# distribution 1 with generator 1
197# distribution 2 with generator 1
198# distribution 3 with generator 0 and 1
199# distribution 4 with generator 0
200# expect that initialization of the generator fails
201# distribution 1 with generator 2
202# distribution 2 with generator 2
203# expect that initialization of the generator fails or
204# that the test is expected to fail for
205# distribution 1 with generator 0
206# distribution 2 with generator 0
207# distribution 3 with generator 2
208# distribution 4 with generator 1
209# do not run the test for
210# distribution 0 with generator 2
211# distribution 4 with generator 2
212#
213# run the tests only in fullcheck mode for
214# distribution 5
215# distribution 6 with generators 0 and 2
216#
217# Notice that the line
218# #par [0] [1] [2]
219# is just a comment line for convinience. Moreover the numbering
220# [0], [1], and [2] coincides with the order of definition in the
221# subsection [validate - generators:].
222#
223# [validate - verify hat:]
224# Tests if condition of method is satisfied. It counts the number
225# occurences when unur_errno is equal to UNUR_ERR_GEN_CONDITION,
226# i.e. when when one of the following conditions is violated
227# squeeze <= PDF <= hat
228# or a violation is detected during an adaptive step.
229#
230# Contains a table which test has to be performed.
231# Each line starts with `<dd>' where `dd' indicates the number of the
232# distributions as declared in section [validate - distributions:].
233# One lines contains the tests that should be performed by with
234# a particular distribution.
235# Each line consists of the `<dd>' marker followed by a list of
236# one character symbols. All entries are separated by white space
237# characters. There must be one symbol for each of the generator
238# types declared in subsection [validate - generators:] that
239# describes the expected result of the test when performed with the
240# choosen generator and the choosen distribution.
241# The following symbols can be used:
242# + should pass test
243# ~ condition might fail in at most 1% of all samples
244# 0 should fail to initialize generator
245# - should fail to iniialize or fail the test (not implemented yet)
246# / either init fails or test successful (necessary for special generators)
247# . do not run the test
248#
249# Each line can be preceded by the letters 'x' or 'X' to exclude the
250# corresponding tests from 'make check' runs.
251# These optional tests are then only run when the environment variable
252# 'UNURANFULLCHECK' is defined (regardless of the actual value of the
253# variable). Likewise it is possible to mark particular tests for a
254# distribution by prefixing the corresponding symbol ('+', '~', '0', '-',
255# '/', or '.') by a single 'x' or 'X'; no blanks are allowed between
256# 'x' and the symbol.
257#
258# Example:
259#
260# #par [0] [1] [2]
261# #---------------------------
262# <0> + ~ .
263# <1> - + 0
264# <2> - + 0
265# <3> + + -
266# <4> + - .
267# x<5> + . -
268# <6> x+ + x+
269#
270# That is:
271# run test and expect that the test is passed for
272# distribution 0 with generator 0
273# distribution 1 with generator 1
274# distribution 2 with generator 1
275# distribution 3 with generator 0 and 1
276# distribution 4 with generator 0
277# run test and expect that in at most of 1% the test fails for
278# distribution 0 with generator 1
279# expect that initialization of the generator fails
280# distribution 1 with generator 2
281# distribution 2 with generator 2
282# expect that initialization of the generator fails or
283# that the test is expected to fail for
284# distribution 1 with generator 0
285# distribution 2 with generator 0
286# distribution 3 with generator 2
287# distribution 4 with generator 1
288# do not run the test for
289# distribution 0 with generator 2
290# distribution 4 with generator 2
291#
292# run the tests only in fullcheck mode for
293# distribution 5
294# distribution 6 with generators 0 and 2
295#
296# Notice that the line
297# #par [0] [1] [2]
298# is just a comment line for convinience. Moreover the numbering
299# [0], [1], and [2] coincides with the order of definition in the
300# subsection [validate - generators:].
301#
302#
303#############################################################################
304#
305# All other sections
306#
307# Each of these sections decribe tests.
308# For each subsection definitions can be but into the subsection label,
309# eg.: [reinit - exist:
310# double fpar[2] = {0.,1.};
311# distr = unur_distr_normal(fpar,2);
312# par = unur_srou_new(distr);
313# gen = unur_init( par ); <-- ! NULL ]
314# (the "<-- ! NULL" (in the same line) indicates, that the result should
315# be checked for an invalid NULL pointer.)
316#
317# The following names _must_ be used through out.
318# distr ... for distribution objects.
319# par ... for parameter objects.
320# gen ... for generator objects.
321# These there variables are declared automatically whenever they occur.
322#
323# Tests are separated by empty lines. Each test has the form
324# [ <set of C calls> ] --> <name of test> [ --> <expected error code> ]
325# (the first and the third part are optional).
326#
327# eg.:
328# unur_srou_new( distr );
329# --> expected_NULL --> UNUR_ERR_NULL
330#
331# It is also possible to insert C code without a test, e.g. for
332# freeing some memory.
333#
334# A ~ (tilde) at the beginning of a line is expanded to
335# unur_<method>_<sect>.
336# e.g. in file srou.c, section [set]
337# ~_cdfatmode(par,0.); is equivalent to unur_srou_set_cdfatmode(par,0.);
338#
339#
340# List of tests:
341#
342# --> none
343# do not check return value (useful if only error code in unur_errno
344# should be tested).
345#
346# --> expected_NULL
347# check if the last C call returns a NULL pointer.
348#
349# --> expected_zero
350# check if the last C call return zero (int 0).
351#
352# --> expected_INFINITY
353# --> expected_negINFINITY
354# check if last C call returns INFINITY or -INFINITY, resp.
355#
356# --> expected_INTMAX
357# check if the last C call return INTMAX (of type int).
358#
359# --> expected_setfailed
360# check if the last set of chg call has failed.
361#
362# --> expected_reinit
363# check if unur_reinit works.
364#
365# --> run_verify_generator
366# run a generator in the verifying mode.
367#
368# --> compare_sequence_par_start
369# --> compare_sequence_par
370# compare random string generated by generator created by last
371# parameter object with the random string generated by generator
372# object from the last compare_double_sequence_par_start test.
373#
374# --> compare_sequence_gen
375# --> compare_sequence_gen_start
376# Analogously except that a generator object is used.
377#
378# -->compare_double_sequence_urng_start
379# Analogously but for the output of uniform random number generators.
380#
381#############################################################################
382