#############################################################################

[main]

[main - data:]

# method (for information only: the program scans the file name)
method: AUTO

[main - header:]

/* prototypes */

int unur_auto_set_pedantic( struct unur_par *par, int pedantic );

\#define COMPARE_SAMPLE_SIZE   (10000)
\#define VIOLATE_SAMPLE_SIZE   (20)

#############################################################################

[new]

[new - invalid NULL ptr: 
   distr = NULL; ]

~( distr );
	--> expected_NULL --> UNUR_ERR_NULL


#############################################################################

[set]

[set - invalid NULL ptr: 
   par = NULL; ]

~_logss(par,1);

[set - invalid parameter object:
   distr = unur_distr_normal(NULL,0);
   par = unur_tdr_new(distr); ]

~_logss(par,1);
	--> expected_setfailed --> UNUR_ERR_PAR_INVALID

unur_par_free(par);

[set - invalid parameters:
   distr = unur_distr_normal(NULL,0);
   par = unur_auto_new(distr); ]

~_logss(par,-1);
	--> expected_setfailed --> UNUR_ERR_PAR_SET

unur_par_free(par);

#############################################################################

# [get]

#############################################################################

# [chg]

#############################################################################

# [init]

#############################################################################

# [reinit]

#[reinit - does not exist:
#   distr = unur_distr_normal(NULL,0);
#   par = unur_auto_new(distr);
#   gen = unur_init( par ); <-- ! NULL ]

#unur_reinit( gen );
#	--> expected_setfailed --> UNUR_ERR_NO_REINIT

#unur_sample_cont( gen );
#	--> expected_INFINITY --> UNUR_ERR_GEN_CONDITION


#############################################################################

[sample]

[sample - compare:
   double fpar[2] = {0.,1.};
   distr = unur_distr_normal(fpar,0); 
   par = NULL; ]

/* TDR */
par = unur_tdr_new(distr);
        -->compare_sequence_par_start

/* AUTO */
par = unur_auto_new(distr);
        -->compare_sequence_par

[sample - compare:
   double fpar[] = {0.1};
   distr = unur_distr_geometric(fpar,1);
   par = NULL; ]

/* DARI */
par = unur_dari_new(distr);
        -->compare_sequence_par_start

/* AUTO */
par = unur_auto_new(distr);
        -->compare_sequence_par

#.....................................................................

[sample - compare clone:
   UNUR_GEN *clone;
   distr = unur_distr_normal(NULL,0); 
   par = NULL;
   gen = NULL; ]

/* original generator object */
par = unur_auto_new(distr);
gen = unur_init(par);
        -->compare_sequence_gen_start

/* clone */
clone = unur_gen_clone(gen);
unur_free(gen);
gen = clone;
        -->compare_sequence_gen

#.....................................................................

[sample - compare stringparser - cont:
   distr = NULL;
   par = NULL;
   gen = NULL; ]

distr = unur_distr_normal(NULL,0); 
par = unur_auto_new(distr);
gen = unur_init(par);
	-->compare_sequence_gen_start

unur_free(gen); gen = NULL;
unur_distr_free(distr); distr = NULL;
gen = unur_str2gen( "normal()" );
	-->compare_sequence_gen

unur_free(gen); gen = NULL;
unur_distr_free(distr); distr = NULL;
gen = unur_str2gen( "normal() & method = auto" );
	-->compare_sequence_gen

#.....................................................................

[sample - compare stringparser discr:
   double fpar[] = {0.4};
   distr = NULL;
   par = NULL;
   gen = NULL; ]

distr = unur_distr_geometric(fpar,1); 
par = unur_auto_new(distr);
gen = unur_init(par);
	-->compare_sequence_gen_start

unur_free(gen); gen = NULL;
unur_distr_free(distr); distr = NULL;
gen = unur_str2gen( "geometric(0.4)");
	-->compare_sequence_gen

unur_free(gen); gen = NULL;
unur_distr_free(distr); distr = NULL;
gen = unur_str2gen( "geometric(0.4) & method = auto");
	-->compare_sequence_gen

#############################################################################

# [validate]

#############################################################################
#############################################################################

[verbatim]

/* no such function */
int unur_auto_set_pedantic( struct unur_par *par ATTRIBUTE__UNUSED, int pedantic ATTRIBUTE__UNUSED)
{ return 1; }

#############################################################################
