diff --git a/.github/workflows/root-ci-config/buildconfig/alma10-clang_ninja.txt b/.github/workflows/root-ci-config/buildconfig/alma10-clang_ninja.txt index 1ecdd6500b5d4..e5cddf82110ed 100644 --- a/.github/workflows/root-ci-config/buildconfig/alma10-clang_ninja.txt +++ b/.github/workflows/root-ci-config/buildconfig/alma10-clang_ninja.txt @@ -8,6 +8,7 @@ builtin_jpeg=ON builtin_lz4=ON builtin_lzma=ON builtin_png=ON +builtin_unuran=ON builtin_vdt=ON builtin_zlib=ON builtin_zstd=ON diff --git a/builtins/unuran/0001-allow-CMake-compilation.patch b/builtins/unuran/0001-allow-CMake-compilation.patch new file mode 100644 index 0000000000000..9483de40ea9f2 --- /dev/null +++ b/builtins/unuran/0001-allow-CMake-compilation.patch @@ -0,0 +1,653 @@ +From 116d7dd642f2665586b32f873131b159096bc352 Mon Sep 17 00:00:00 2001 +From: ferdymercury +Date: Thu, 16 Apr 2026 12:12:21 +0200 +Subject: [PATCH 1/2] allow CMake compilation + +--- + src/CMakeLists.txt | 434 +++++++++++++++++++++++++ + src/distr/discr.c | 1 + + src/distributions/d_geometric.c | 1 + + src/distributions/d_logarithmic.c | 1 + + src/distributions/d_negativebinomial.c | 1 + + src/distributions/d_poisson.c | 1 + + src/distributions/d_zipf.c | 1 + + src/methods/dari.c | 1 + + src/methods/dau.c | 1 + + src/methods/dgt.c | 1 + + src/methods/dss.c | 1 + + src/methods/dstd.c | 1 + + src/parser/stringparser.c | 2 + + src/unur_source.h | 4 +- + src/urng/urng.c | 1 + + src/urng/urng_unuran.c | 1 + + 16 files changed, 451 insertions(+), 2 deletions(-) + create mode 100644 src/CMakeLists.txt + +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +new file mode 100644 +index 00000000..30e797da +--- /dev/null ++++ b/src/CMakeLists.txt +@@ -0,0 +1,434 @@ ++cmake_minimum_required(VERSION 3.22) ++project(UNURAN VERSION 1.0) # The version does not matter here ++ ++add_library(unuran STATIC) ++ ++target_sources(unuran ++PRIVATE ++ distr/cemp.c ++ distr/condi.c ++ distr/cont.c ++ distr/corder.c ++ distr/cvec.c ++ distr/cvemp.c ++ distr/cxtrans.c ++ distr/deprecated_distr.c ++ distr/discr.c ++ distr/distr_info.c ++ distr/distr.c ++ distr/matr.c ++ distributions/c_beta_gen.c ++ distributions/c_beta.c ++ distributions/c_burr.c ++ distributions/c_cauchy.c ++ distributions/c_chi_gen.c ++ distributions/c_chi.c ++ distributions/c_chisquare.c ++ distributions/c_exponential_gen.c ++ distributions/c_exponential.c ++ distributions/c_extremeI.c ++ distributions/c_extremeII.c ++ distributions/c_F.c ++ distributions/c_gamma_gen.c ++ distributions/c_gamma.c ++ distributions/c_ghyp.c ++ distributions/c_gig_gen.c ++ distributions/c_gig.c ++ distributions/c_gig2.c ++ distributions/c_hyperbolic.c ++ distributions/c_ig.c ++ distributions/c_laplace.c ++ distributions/c_logistic.c ++ distributions/c_lognormal.c ++ distributions/c_lomax.c ++ distributions/c_meixner.c ++ distributions/c_normal_gen.c ++ distributions/c_normal.c ++ distributions/c_pareto.c ++ distributions/c_powerexponential_gen.c ++ distributions/c_powerexponential.c ++ distributions/c_rayleigh.c ++ distributions/c_slash_gen.c ++ distributions/c_slash.c ++ distributions/c_student_gen.c ++ distributions/c_student.c ++ distributions/c_triangular.c ++ distributions/c_uniform.c ++ distributions/c_vg.c ++ distributions/c_weibull.c ++ distributions/d_binomial_gen.c ++ distributions/d_binomial.c ++ distributions/d_geometric.c ++ distributions/d_hypergeometric_gen.c ++ distributions/d_hypergeometric.c ++ distributions/d_logarithmic_gen.c ++ distributions/d_logarithmic.c ++ distributions/d_negativebinomial.c ++ distributions/d_poisson_gen.c ++ distributions/d_poisson.c ++ distributions/d_zipf_gen.c ++ distributions/d_zipf.c ++ distributions/m_correlation.c ++ distributions/vc_copula.c ++ distributions/vc_multicauchy.c ++ distributions/vc_multiexponential.c ++ distributions/vc_multinormal_gen.c ++ distributions/vc_multinormal.c ++ distributions/vc_multistudent.c ++ methods/arou.c ++ methods/ars.c ++ methods/auto.c ++ methods/cext.c ++ methods/cstd.c ++ methods/dari.c ++ methods/dau.c ++ methods/deprecated_methods.c ++ methods/deprecated_vmt.c ++ methods/dext.c ++ methods/dgt.c ++ methods/dsrou.c ++ methods/dss.c ++ methods/dstd.c ++ methods/empk.c ++ methods/empl.c ++ methods/gibbs.c ++ methods/hinv.c ++ methods/hist.c ++ methods/hitro.c ++ methods/hrb.c ++ methods/hrd.c ++ methods/hri.c ++ methods/itdr.c ++ methods/mcorr.c ++ methods/mixt.c ++ methods/mvstd.c ++ methods/mvtdr.c ++ methods/ninv.c ++ methods/norta.c ++ methods/nrou.c ++ methods/pinv.c ++ methods/srou.c ++ methods/ssr.c ++ methods/tabl.c ++ methods/tdr.c ++ methods/unif.c ++ methods/utdr.c ++ methods/vempk.c ++ methods/vnrou.c ++ methods/x_gen.c ++ parser/functparser.c ++ parser/parser.c ++ parser/stringparser.c ++ specfunct/bessel_asympt.c ++ specfunct/cephes_gamma.c ++ specfunct/cephes_igam.c ++ specfunct/cephes_incbet.c ++ specfunct/cephes_ndtr.c ++ specfunct/cephes_ndtri.c ++ specfunct/cephes_polevl.c ++ specfunct/cgamma.c ++ specfunct/hypot.c ++ specfunct/log1p.c ++ tests/chi2test.c ++ tests/correlation.c ++ tests/countpdf.c ++ tests/counturn.c ++ tests/inverror.c ++ tests/moments.c ++ tests/printsample.c ++ tests/quantiles.c ++ tests/tests.c ++ tests/timing.c ++ uniform/fish.c ++ uniform/mrg31k3p.c ++ uniform/mstd.c ++ uniform/urng_builtin.c ++ uniform/urng_fvoid.c ++ uniform/urng_gsl.c ++ uniform/urng_gslqrng.c ++ uniform/urng_prng.c ++ uniform/urng_randomshift.c ++ uniform/urng_rngstreams.c ++ urng/urng_default.c ++ urng/urng_set.c ++ urng/urng_unuran.c ++ urng/urng.c ++ utils/debug.c ++ utils/eigensystem.c ++ utils/error.c ++ utils/fmax.c ++ utils/hooke.c ++ utils/lobatto.c ++ utils/matrix.c ++ utils/mrou_rectangle.c ++ utils/slist.c ++ utils/stream.c ++ utils/string.c ++ utils/umalloc.c ++ utils/umath.c ++ utils/unur_fp.c ++ utils/vector.c ++PUBLIC ++ FILE_SET HEADERS ++ BASE_DIRS ./ # distr distributions methods parser specfunct tests uniform urng utils ++ FILES ++ distr/cemp.h ++ distr/condi.h ++ distr/cont.h ++ distr/corder.h ++ distr/cvec.h ++ distr/cvemp.h ++ distr/cxtrans.h ++ distr/deprecated_distr.h ++ distr/discr.h ++ distr/distr_source.h ++ distr/distr_struct.h ++ distr/distr.h ++ distr/matr.h ++ distributions/unur_distributions_source.h ++ distributions/unur_distributions.h ++ distributions/unur_stddistr.h ++ methods/arou_struct.h ++ methods/arou.h ++ methods/ars_struct.h ++ methods/ars.h ++ methods/auto_struct.h ++ methods/auto.h ++ methods/cext_struct.h ++ methods/cext.h ++ methods/cstd_struct.h ++ methods/cstd.h ++ methods/dari_struct.h ++ methods/dari.h ++ methods/dau_struct.h ++ methods/dau.h ++ methods/deprecated_methods.h ++ methods/deprecated_tdrgw.h ++ methods/deprecated_vmt_struct.h ++ methods/deprecated_vmt.h ++ methods/dext_struct.h ++ methods/dext.h ++ methods/dgt_struct.h ++ methods/dgt.h ++ methods/dsrou_struct.h ++ methods/dsrou.h ++ methods/dss_struct.h ++ methods/dss.h ++ methods/dstd_struct.h ++ methods/dstd.h ++ methods/empk_struct.h ++ methods/empk.h ++ methods/empl_struct.h ++ methods/empl.h ++ methods/gibbs_struct.h ++ methods/gibbs.h ++ methods/hinv_struct.h ++ methods/hinv.h ++ methods/hist_struct.h ++ methods/hist.h ++ methods/hitro_struct.h ++ methods/hitro.h ++ methods/hrb_struct.h ++ methods/hrb.h ++ methods/hrd_struct.h ++ methods/hrd.h ++ methods/hri_struct.h ++ methods/hri.h ++ methods/itdr_struct.h ++ methods/itdr.h ++ methods/mcorr_struct.h ++ methods/mcorr.h ++ methods/mixt_struct.h ++ methods/mixt.h ++ methods/mvstd_struct.h ++ methods/mvstd.h ++ methods/mvtdr_struct.h ++ methods/mvtdr.h ++ methods/ninv_struct.h ++ methods/ninv.h ++ methods/norta_struct.h ++ methods/norta.h ++ methods/nrou_struct.h ++ methods/nrou.h ++ methods/pinv_struct.h ++ methods/pinv.h ++ methods/srou_struct.h ++ methods/srou.h ++ methods/ssr_struct.h ++ methods/ssr.h ++ methods/tabl_struct.h ++ methods/tabl.h ++ methods/tdr_struct.h ++ methods/tdr.h ++ methods/unif_struct.h ++ methods/unif.h ++ methods/unur_methods_source.h ++ methods/unur_methods.h ++ methods/utdr_struct.h ++ methods/utdr.h ++ methods/vempk_struct.h ++ methods/vempk.h ++ methods/vnrou_struct.h ++ methods/vnrou.h ++ methods/x_gen_source.h ++ methods/x_gen_struct.h ++ methods/x_gen.h ++ parser/functparser_source.h ++ parser/functparser_struct.h ++ parser/functparser_symbols.h ++ parser/parser_source.h ++ parser/parser.h ++ specfunct/cephes_source.h ++ specfunct/unur_specfunct_source.h ++ tests/unuran_tests.h ++ uniform/unuran_urng_gsl.h ++ uniform/unuran_urng_prng.h ++ uniform/unuran_urng_rngstreams.h ++ uniform/urng_builtin.h ++ uniform/urng_fvoid.h ++ uniform/urng_gsl.h ++ uniform/urng_gslqrng.h ++ uniform/urng_prng.h ++ uniform/urng_randomshift.h ++ uniform/urng_rngstreams.h ++ unur_cookies.h ++ unur_source.h ++ unur_struct.h ++ unur_typedefs.h ++ unuran_config.h ++ # unuran.h ++ urng/urng_source.h ++ urng/urng_struct.h ++ urng/urng.h ++ utils/debug_source.h ++ utils/debug.h ++ utils/error_source.h ++ utils/error.h ++ utils/fmax_source.h ++ utils/hooke_source.h ++ utils/lobatto_source.h ++ utils/lobatto_struct.h ++ utils/matrix_source.h ++ utils/mrou_rectangle_source.h ++ utils/mrou_rectangle_struct.h ++ utils/slist_struct.h ++ utils/slist.h ++ utils/stream_source.h ++ utils/stream.h ++ utils/string_source.h ++ utils/string_struct.h ++ utils/umalloc_source.h ++ utils/umath_source.h ++ utils/umath.h ++ utils/unur_errno.h ++ utils/unur_fp_const_source.h ++ utils/unur_fp_source.h ++ utils/unur_math_source.h ++ utils/vector_source.h ++) ++ ++target_compile_definitions(unuran PRIVATE ++ HAVE_DECL_HUGE_VAL=1 ++ HAVE_DECL_SIGNAL=1 ++ HAVE_DECL_SNPRINTF=1 ++ HAVE_DECL_VSNPRINTF=1 ++ HAVE_FLOAT_H=1 ++ HAVE_FLOOR=1 ++ HAVE_IEEE_COMPARISONS=1 ++ HAVE_LIBM=1 ++ HAVE_LIMITS_H=1 ++ HAVE_POW=1 ++ HAVE_SIGNAL=1 ++ HAVE_SQRT=1 ++ HAVE_STDLIB_H=1 ++ HAVE_STRCHR=1 ++ HAVE_STRING_H=1 ++ HAVE_STRTOL=1 ++ HAVE_STRTOUL=1 ++ HAVE_SYS_STAT_H=1 ++ HAVE_SYS_TYPES_H=1 ++ #LT_OBJDIR=".libs/" ++ PACKAGE="unuran" ++ PACKAGE_BUGREPORT="unuran@statmath.wu.ac.at" ++ PACKAGE_NAME="unuran" ++ PACKAGE_STRING="unuran ${PROJECT_VERSION}" ++ PACKAGE_TARNAME="unuran" ++ PACKAGE_URL="" ++ PACKAGE_VERSION="${PROJECT_VERSION}" ++ STDC_HEADERS=1 ++ UNUR_ENABLE_INFO=1 ++ VERSION=${PROJECT_VERSION} ++) ++if(WIN32) ++target_compile_definitions(unuran PRIVATE ++ HAVE_MEMORY_H=1 ++ inline=__inline ++ #log1p=_unur_log1p ++) ++else() ++target_compile_definitions(unuran PRIVATE ++ HAVE_ALARM=1 ++ HAVE_DECL_ALARM=1 ++ HAVE_DECL_DBL_MAX=1 ++ HAVE_DECL_GETOPT=1 ++ HAVE_DECL_HYPOT=1 ++ HAVE_DECL_INFINITY=1 ++ HAVE_DECL_ISFINITE=1 ++ HAVE_DECL_ISINF=1 ++ HAVE_DECL_ISNAN=1 ++ HAVE_DECL_LOG1P=1 ++ HAVE_DIVIDE_BY_ZERO=1 ++ HAVE_DLFCN_H=1 ++ HAVE_GETTIMEOFDAY=1 ++ HAVE_INTTYPES_H=1 ++ HAVE_LIBGSL=1 ++ HAVE_LIBGSLCBLAS=1 ++ HAVE_MEMSET=1 ++ HAVE_STDINT_H=1 ++ HAVE_STDIO_H=1 ++ HAVE_STRCASECMP=1 ++ HAVE_STRINGS_H=1 ++ HAVE_SYS_TIME_H=1 ++ HAVE_UNISTD_H=1 ++) ++endif() ++ ++#---Define special compiler settings for unuran----------------------------------------------------- ++if(ROOT_ARCHITECTURE MATCHES hpuxia64acc) ++ set(UNR_CFLAGS "+DD64 -Ae") ++elseif(ROOT_ARCHITECTURE MATCHES linuxppc64gcc) ++ set(UNR_CFLAGS "-m64 -fPIC") ++elseif(ROOT_ARCHITECTURE MATCHES linuxx8664gcc) ++ set(UNR_CFLAGS "-m64 -fPIC") ++elseif(ROOT_ARCHITECTURE MATCHES linuxicc) ++ set(UNR_CFLAGS "-m32") ++elseif(ROOT_ARCHITECTURE MATCHES linuxx8664icc) ++ set(UNR_CFLAGS "-m64") ++elseif(ROOT_ARCHITECTURE MATCHES win32 OR ROOT_ARCHITECTURE MATCHES win64) ++ set(UNR_CFLAGS "-MD -G5 -GX") ++endif() ++if(CMAKE_OSX_SYSROOT) ++ set(UNR_CFLAGS "${UNR_CFLAGS} -isysroot ${CMAKE_OSX_SYSROOT}") ++endif() ++set(CMAKE_C_FLAGS ${UNR_CFLAGS}) ++ ++# target_include_directories(unuran PUBLIC ./) ++ ++# Create all-in-one header ++get_target_property(HeaderList unuran HEADER_SET) ++add_custom_command( ++ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/unuran.h" ++ COMMAND ${CMAKE_COMMAND} -E cat ${HeaderList} > "${CMAKE_CURRENT_BINARY_DIR}/unuran.h" ++ DEPENDS ${HeaderList} ++ COMMENT "Merging all headers into one file" ++) ++add_custom_target(unuran_single_header ALL ++ DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/unuran.h" ++) ++install(FILES ${CMAKE_CURRENT_BINARY_DIR}/unuran.h DESTINATION ${CMAKE_INSTALL_PREFIX}/include) ++ ++# Install the target and its file sets ++install(TARGETS unuran ++ FILE_SET HEADERS DESTINATION ${CMAKE_INSTALL_PREFIX}/include ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib ++) +diff --git a/src/distr/discr.c b/src/distr/discr.c +index 938c17bc..ab3eb885 100644 +--- a/src/distr/discr.c ++++ b/src/distr/discr.c +@@ -42,6 +42,7 @@ + #include "distr_source.h" + #include "distr.h" + #include "discr.h" ++#include "limits.h" + + /*---------------------------------------------------------------------------*/ + +diff --git a/src/distributions/d_geometric.c b/src/distributions/d_geometric.c +index 5ec863c3..04ea1f33 100644 +--- a/src/distributions/d_geometric.c ++++ b/src/distributions/d_geometric.c +@@ -54,6 +54,7 @@ + #include "unur_distributions.h" + #include "unur_distributions_source.h" + #include "unur_stddistr.h" ++#include "limits.h" + + /*---------------------------------------------------------------------------*/ + +diff --git a/src/distributions/d_logarithmic.c b/src/distributions/d_logarithmic.c +index 147dfecf..284ec22c 100644 +--- a/src/distributions/d_logarithmic.c ++++ b/src/distributions/d_logarithmic.c +@@ -54,6 +54,7 @@ + #include "unur_distributions.h" + #include "unur_distributions_source.h" + #include "unur_stddistr.h" ++#include "limits.h" + + /*---------------------------------------------------------------------------*/ + +diff --git a/src/distributions/d_negativebinomial.c b/src/distributions/d_negativebinomial.c +index c1b5a79a..eb8e8899 100644 +--- a/src/distributions/d_negativebinomial.c ++++ b/src/distributions/d_negativebinomial.c +@@ -55,6 +55,7 @@ + #include "unur_distributions.h" + #include "unur_distributions_source.h" + #include "unur_stddistr.h" ++#include "limits.h" + + /*---------------------------------------------------------------------------*/ + +diff --git a/src/distributions/d_poisson.c b/src/distributions/d_poisson.c +index 5fe88215..f248bc82 100644 +--- a/src/distributions/d_poisson.c ++++ b/src/distributions/d_poisson.c +@@ -54,6 +54,7 @@ + #include "unur_distributions.h" + #include "unur_distributions_source.h" + #include "unur_stddistr.h" ++#include "limits.h" + + /*---------------------------------------------------------------------------*/ + +diff --git a/src/distributions/d_zipf.c b/src/distributions/d_zipf.c +index 5dc08f3f..4e793256 100644 +--- a/src/distributions/d_zipf.c ++++ b/src/distributions/d_zipf.c +@@ -56,6 +56,7 @@ + #include "unur_distributions.h" + #include "unur_distributions_source.h" + #include "unur_stddistr.h" ++#include "limits.h" + + /*---------------------------------------------------------------------------*/ + +diff --git a/src/methods/dari.c b/src/methods/dari.c +index e8cf2e9a..e0f3ca1b 100644 +--- a/src/methods/dari.c ++++ b/src/methods/dari.c +@@ -62,6 +62,7 @@ + #include "x_gen_source.h" + #include "dari.h" + #include "dari_struct.h" ++#include "limits.h" + + #ifdef UNUR_ENABLE_INFO + # include +diff --git a/src/methods/dau.c b/src/methods/dau.c +index b95a3110..fc85527c 100644 +--- a/src/methods/dau.c ++++ b/src/methods/dau.c +@@ -114,6 +114,7 @@ + #include "x_gen_source.h" + #include "dau.h" + #include "dau_struct.h" ++#include "limits.h" + + /*---------------------------------------------------------------------------*/ + /* Variants: none */ +diff --git a/src/methods/dgt.c b/src/methods/dgt.c +index 89e9e7c9..62626d86 100644 +--- a/src/methods/dgt.c ++++ b/src/methods/dgt.c +@@ -92,6 +92,7 @@ + #include "x_gen_source.h" + #include "dgt.h" + #include "dgt_struct.h" ++#include "limits.h" + + /*---------------------------------------------------------------------------*/ + /* Variants */ +diff --git a/src/methods/dss.c b/src/methods/dss.c +index 02d1feaa..36578c3a 100644 +--- a/src/methods/dss.c ++++ b/src/methods/dss.c +@@ -62,6 +62,7 @@ + #include "x_gen_source.h" + #include "dss.h" + #include "dss_struct.h" ++#include "limits.h" + + /*---------------------------------------------------------------------------*/ + /* Variants */ +diff --git a/src/methods/dstd.c b/src/methods/dstd.c +index c41307ff..5786d05e 100644 +--- a/src/methods/dstd.c ++++ b/src/methods/dstd.c +@@ -85,6 +85,7 @@ + #include "cstd.h" /* required for UNUR_STDGEN_* macros */ + #include "dstd.h" + #include "dstd_struct.h" ++#include "limits.h" + + #ifdef UNUR_ENABLE_INFO + # include +diff --git a/src/parser/stringparser.c b/src/parser/stringparser.c +index 682213a9..caed8b16 100644 +--- a/src/parser/stringparser.c ++++ b/src/parser/stringparser.c +@@ -182,6 +182,8 @@ + #include + #include + ++#include "limits.h" ++ + #if defined(UNUR_URNG_UNURAN) && defined(UNURAN_HAS_PRNG) + #include + #endif +diff --git a/src/unur_source.h b/src/unur_source.h +index 6d9a04f6..3af5bd19 100644 +--- a/src/unur_source.h ++++ b/src/unur_source.h +@@ -40,9 +40,9 @@ + /* config file generated be autoconf */ + + #ifdef HAVE_CONFIG_H +-# include ++// # include + #else +-# error "config.h" required ++// # error "config.h" required + #endif + + /*---------------------------------------------------------------------------*/ +diff --git a/src/urng/urng.c b/src/urng/urng.c +index 8f81ea3b..d843b469 100644 +--- a/src/urng/urng.c ++++ b/src/urng/urng.c +@@ -33,6 +33,7 @@ + /*---------------------------------------------------------------------------*/ + #include + #include "urng.h" ++#include "limits.h" + /*---------------------------------------------------------------------------*/ + + /*****************************************************************************/ +diff --git a/src/urng/urng_unuran.c b/src/urng/urng_unuran.c +index e1f04b04..1c29d3f5 100644 +--- a/src/urng/urng_unuran.c ++++ b/src/urng/urng_unuran.c +@@ -33,6 +33,7 @@ + /*---------------------------------------------------------------------------*/ + #include + #include "urng.h" ++#include "limits.h" + /*---------------------------------------------------------------------------*/ + #ifdef UNUR_URNG_UNURAN + /*---------------------------------------------------------------------------*/ +-- +2.34.1 + diff --git a/builtins/unuran/0002-fix-missing-files.patch b/builtins/unuran/0002-fix-missing-files.patch new file mode 100644 index 0000000000000..9d163e21e0281 --- /dev/null +++ b/builtins/unuran/0002-fix-missing-files.patch @@ -0,0 +1,2009 @@ +From 5831bb131d401d6a3488bff0d1058dfec51e4a6f Mon Sep 17 00:00:00 2001 +From: ferdymercury +Date: Thu, 16 Apr 2026 13:00:42 +0200 +Subject: [PATCH 2/2] fix missing files + +--- + src/CMakeLists.txt | 6 +- + src/parser/stringparser_lists.ch | 1928 ++++++++++++++++++++++++++++++ + src/utils/unur_fp_const_source.h | 38 + + 3 files changed, 1969 insertions(+), 3 deletions(-) + create mode 100644 src/parser/stringparser_lists.ch + create mode 100644 src/utils/unur_fp_const_source.h + +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 30e797da..788179ae 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -281,9 +281,9 @@ PUBLIC + specfunct/cephes_source.h + specfunct/unur_specfunct_source.h + tests/unuran_tests.h +- uniform/unuran_urng_gsl.h +- uniform/unuran_urng_prng.h +- uniform/unuran_urng_rngstreams.h ++ # uniform/unuran_urng_gsl.h ++ # uniform/unuran_urng_prng.h ++ # uniform/unuran_urng_rngstreams.h + uniform/urng_builtin.h + uniform/urng_fvoid.h + uniform/urng_gsl.h +diff --git a/src/parser/stringparser_lists.ch b/src/parser/stringparser_lists.ch +new file mode 100644 +index 00000000..8003958c +--- /dev/null ++++ b/src/parser/stringparser_lists.ch +@@ -0,0 +1,1927 @@ ++/***************************************************************************** ++ * * ++ * UNURAN -- Universal Non-Uniform Random number generator * ++ * * ++ ***************************************************************************** ++ * * ++ * FILE: stringparser_lists.ch.in / stringparser_lists.ch * ++ * * ++ * * ++ * DESCRIPTION: * ++ * * ++ * Switch lists for string parser. * ++ * (See file stringparser.c) * ++ * * ++ ***************************************************************************** ++ * * ++ * This file is parsed by the perl script make_stringparser.pl which * ++ * replaces the * ++ * =INPUT keyword * ++ * tags with search lists created from the information found within the * ++ * header files of the source code. * ++ * These lists (implemented via 'if' rules together with switch lists to * ++ * with the first letter of the set calls as simple hash function) are * ++ * used to call the corresponding ..._set and ..._new calls for the * ++ * the keywords found in the string. * ++ * * ++ ***************************************************************************** ++ * * ++ * Copyright (c) 2000-2006 Wolfgang Hoermann and Josef Leydold * ++ * Department of Statistics and Mathematics, WU Wien, Austria * ++ * * ++ * This program is free software; you can redistribute it and/or modify * ++ * it under the terms of the GNU General Public License as published by * ++ * the Free Software Foundation; either version 2 of the License, or * ++ * (at your option) any later version. * ++ * * ++ * This program is distributed in the hope that it will be useful, * ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of * ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * ++ * GNU General Public License for more details. * ++ * * ++ * You should have received a copy of the GNU General Public License * ++ * along with this program; if not, write to the * ++ * Free Software Foundation, Inc., * ++ * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA * ++ * * ++ *****************************************************************************/ ++ ++ ++/*****************************************************************************/ ++/** Distributions **/ ++/*****************************************************************************/ ++ ++struct unur_distr * ++_unur_str_distr_new( char *distribution ) ++ /*----------------------------------------------------------------------*/ ++ /* get new distribution object */ ++ /* */ ++ /* parameters: */ ++ /* distribution ... string that contains distribution name */ ++ /* params ... string that contains list of parameters */ ++ /* */ ++ /* return: */ ++ /* distribution object (pointer to structure) */ ++ /* */ ++ /* error: */ ++ /* return NULL */ ++ /*----------------------------------------------------------------------*/ ++{ ++ struct unur_distr *distr = NULL; /* pointer to distribution object */ ++ char distr_unknown; ++ ++#ifdef UNUR_ENABLE_LOGGING ++ char *name; /* pointer to name of distribution */ ++#endif ++ char *params; /* pointer to parameter list of distr */ ++ ++ double *darray = NULL; /* array of arguments for distribution */ ++ int n_darray = 0; /* size of array of parameters */ ++ ++#ifdef UNUR_ENABLE_LOGGING ++ /* name of distribution */ ++ name = distribution; ++#endif ++ ++ /* get parameter list */ ++ params = strchr(distribution,'('); ++ if (params != NULL) { ++ *params = '\0'; /* terminate key string */ ++ ++params; /* set pointer to value string */ ++ } ++ ++ /* get parameter list */ ++ n_darray = _unur_parse_dlist(params, &darray ); ++ ++#ifdef UNUR_ENABLE_LOGGING ++ /* write info into LOG file */ ++ if (_unur_default_debugflag & UNUR_DEBUG_SETUP) ++ _unur_str_debug_distr(1,name,darray,n_darray); ++#endif ++ ++ /* mark distribution as unknown (this is a very ugly hack) */ ++ distr = (struct unur_distr *) &distr_unknown; ++ ++ switch (*distribution) { ++ case 'b': ++ if ( !strcmp( distribution, "beta") ) { ++ distr = unur_distr_beta (darray,n_darray); ++ break; ++ } ++ if ( !strcmp( distribution, "binomial") ) { ++ distr = unur_distr_binomial (darray,n_darray); ++ break; ++ } ++ break; ++ case 'c': ++ if ( !strcmp( distribution, "cauchy") ) { ++ distr = unur_distr_cauchy (darray,n_darray); ++ break; ++ } ++ if ( !strcmp( distribution, "chi") ) { ++ distr = unur_distr_chi (darray,n_darray); ++ break; ++ } ++ if ( !strcmp( distribution, "chisquare") ) { ++ distr = unur_distr_chisquare (darray,n_darray); ++ break; ++ } ++ break; ++ case 'e': ++ if ( !strcmp( distribution, "exponential") ) { ++ distr = unur_distr_exponential (darray,n_darray); ++ break; ++ } ++ if ( !strcmp( distribution, "extremei") ) { ++ distr = unur_distr_extremeI (darray,n_darray); ++ break; ++ } ++ if ( !strcmp( distribution, "extremeii") ) { ++ distr = unur_distr_extremeII (darray,n_darray); ++ break; ++ } ++ break; ++ case 'f': ++ if ( !strcmp( distribution, "f") ) { ++ distr = unur_distr_F (darray,n_darray); ++ break; ++ } ++ break; ++ case 'g': ++ if ( !strcmp( distribution, "gamma") ) { ++ distr = unur_distr_gamma (darray,n_darray); ++ break; ++ } ++ if ( !strcmp( distribution, "geometric") ) { ++ distr = unur_distr_geometric (darray,n_darray); ++ break; ++ } ++ if ( !strcmp( distribution, "gig") ) { ++ distr = unur_distr_gig (darray,n_darray); ++ break; ++ } ++ if ( !strcmp( distribution, "gig2") ) { ++ distr = unur_distr_gig2 (darray,n_darray); ++ break; ++ } ++ break; ++ case 'h': ++ if ( !strcmp( distribution, "hyperbolic") ) { ++ distr = unur_distr_hyperbolic (darray,n_darray); ++ break; ++ } ++ if ( !strcmp( distribution, "hypergeometric") ) { ++ distr = unur_distr_hypergeometric (darray,n_darray); ++ break; ++ } ++ break; ++ case 'i': ++ if ( !strcmp( distribution, "ig") ) { ++ distr = unur_distr_ig (darray,n_darray); ++ break; ++ } ++ break; ++ case 'l': ++ if ( !strcmp( distribution, "laplace") ) { ++ distr = unur_distr_laplace (darray,n_darray); ++ break; ++ } ++ if ( !strcmp( distribution, "logarithmic") ) { ++ distr = unur_distr_logarithmic (darray,n_darray); ++ break; ++ } ++ if ( !strcmp( distribution, "logistic") ) { ++ distr = unur_distr_logistic (darray,n_darray); ++ break; ++ } ++ if ( !strcmp( distribution, "lognormal") ) { ++ distr = unur_distr_lognormal (darray,n_darray); ++ break; ++ } ++ if ( !strcmp( distribution, "lomax") ) { ++ distr = unur_distr_lomax (darray,n_darray); ++ break; ++ } ++ break; ++ case 'n': ++ if ( !strcmp( distribution, "negativebinomial") ) { ++ distr = unur_distr_negativebinomial (darray,n_darray); ++ break; ++ } ++ if ( !strcmp( distribution, "normal") ) { ++ distr = unur_distr_normal (darray,n_darray); ++ break; ++ } ++ break; ++ case 'p': ++ if ( !strcmp( distribution, "pareto") ) { ++ distr = unur_distr_pareto (darray,n_darray); ++ break; ++ } ++ if ( !strcmp( distribution, "poisson") ) { ++ distr = unur_distr_poisson (darray,n_darray); ++ break; ++ } ++ if ( !strcmp( distribution, "powerexponential") ) { ++ distr = unur_distr_powerexponential (darray,n_darray); ++ break; ++ } ++ break; ++ case 'r': ++ if ( !strcmp( distribution, "rayleigh") ) { ++ distr = unur_distr_rayleigh (darray,n_darray); ++ break; ++ } ++ break; ++ case 's': ++ if ( !strcmp( distribution, "slash") ) { ++ distr = unur_distr_slash (darray,n_darray); ++ break; ++ } ++ if ( !strcmp( distribution, "student") ) { ++ distr = unur_distr_student (darray,n_darray); ++ break; ++ } ++ break; ++ case 't': ++ if ( !strcmp( distribution, "triangular") ) { ++ distr = unur_distr_triangular (darray,n_darray); ++ break; ++ } ++ break; ++ case 'u': ++ if ( !strcmp( distribution, "uniform") ) { ++ distr = unur_distr_uniform (darray,n_darray); ++ break; ++ } ++ break; ++ case 'w': ++ if ( !strcmp( distribution, "weibull") ) { ++ distr = unur_distr_weibull (darray,n_darray); ++ break; ++ } ++ } ++ ++ /* get pointer to generic distribution object */ ++ if (distr == (struct unur_distr *) &distr_unknown) { ++ do { ++ if ( !strcmp( distribution, "cemp") ) { ++ distr = unur_distr_cemp_new(); ++ break; ++ } ++ if ( !strcmp( distribution, "cont") ) { ++ distr = unur_distr_cont_new(); ++ break; ++ } ++ if ( !strcmp( distribution, "discr") ) { ++ distr = unur_distr_discr_new(); ++ break; ++ } ++ } while (0); ++ } ++ ++ ++ if (distr == (struct unur_distr *) &distr_unknown) { ++ /* unknown method */ ++ _unur_error_unknown(distribution,"distribution"); ++ distr = NULL; ++ } ++ else if (distr == NULL) { ++ /* invalid data for chosen method */ ++ _unur_error_invalid(distribution,"distribution"); ++ } ++ ++ /* clear memory */ ++ if (darray) free(darray); ++ ++ /* return result */ ++ return distr; ++ ++} /* end of _unur_str_distr_new() */ ++ ++/*---------------------------------------------------------------------------*/ ++ ++int ++_unur_str_distr_set( UNUR_DISTR **ptr_distr, const char *key, char *value ) ++ /*----------------------------------------------------------------------*/ ++ /* set parameters for distribution */ ++ /* */ ++ /* it also makes a distribution object for an order statistics for */ ++ /* the given distribution when the key word "orderstatistics" occurs. */ ++ /* Thus the distribution object itself might be changed. */ ++ /* */ ++ /* parameters: */ ++ /* ptr_distr ... holds pointer to distribution object */ ++ /* key ... string that contains key for parameter */ ++ /* value ... string that contains list of arguments for parameter */ ++ /* */ ++ /* return: */ ++ /* UNUR_SUCCESS ... on success */ ++ /* error code ... on error */ ++ /* */ ++ /* error: */ ++ /* return error code */ ++ /*----------------------------------------------------------------------*/ ++{ ++ int result; /* result of UNU.RAN set call */ ++ ++ /* derefence pointer to distribution object */ ++ struct unur_distr *distr = *ptr_distr; ++ ++ /* storing arguments of set calls: */ ++ char type_args[MAX_SET_ARGS+1]; /* array containing info about arguments */ ++ char *args[MAX_SET_ARGS+1]; /* pointers to argument strings */ ++ ++ /* tokenize argument string */ ++ if (_unur_str_set_args( value, type_args, args, MAX_SET_ARGS ) < 0) { ++ /* error */ ++ return UNUR_ERR_STR_SYNTAX; ++ } ++ ++ /* set result indicator to unknown */ ++ result = UNUR_ERR_STR_UNKNOWN; ++ ++ /* find and execute set call */ ++ ++ switch (distr->type) { ++ case UNUR_DISTR_CEMP: ++ switch (*key) { ++ case 'd': ++ if ( !strcmp(key, "data") ) { ++ /* n = 2; type = Di: UNUR_DISTR *distribution, const double *sample, int n_sample */ ++ result = _unur_str_distr_set_Di(distr,key,type_args,args,unur_distr_cemp_set_data); ++ break; ++ } ++ break; ++ case 'h': ++ if ( !strcmp(key, "hist_bins") ) { ++ /* n = 2; type = Di: UNUR_DISTR *distribution, const double *bins, int n_bins */ ++ result = _unur_str_distr_set_Di(distr,key,type_args,args,unur_distr_cemp_set_hist_bins); ++ break; ++ } ++ if ( !strcmp(key, "hist_domain") ) { ++ /* n = 2; type = dd: UNUR_DISTR *distribution, double xmin, double xmax */ ++ result = _unur_str_distr_set_dd(distr,key,type_args,args,unur_distr_cemp_set_hist_domain); ++ break; ++ } ++ if ( !strcmp(key, "hist_prob") ) { ++ /* n = 2; type = Di: UNUR_DISTR *distribution, const double *prob, int n_prob */ ++ result = _unur_str_distr_set_Di(distr,key,type_args,args,unur_distr_cemp_set_hist_prob); ++ break; ++ } ++ } ++ break; ++ case UNUR_DISTR_CONT: ++ switch (*key) { ++ case 'c': ++ if ( !strcmp(key, "cdf") ) { ++ /* n = 1; type = C: UNUR_DISTR *distribution, const char *cdfstr */ ++ result = _unur_str_distr_set_C(distr,key,type_args,args,unur_distr_cont_set_cdfstr); ++ break; ++ } ++ if ( !strcmp(key, "cdfstr") ) { ++ /* n = 1; type = C: UNUR_DISTR *distribution, const char *cdfstr */ ++ result = _unur_str_distr_set_C(distr,key,type_args,args,unur_distr_cont_set_cdfstr); ++ break; ++ } ++ if ( !strcmp(key, "center") ) { ++ /* n = 1; type = d: UNUR_DISTR *distribution, double center */ ++ result = _unur_str_distr_set_d(distr,key,type_args,args,unur_distr_cont_set_center); ++ break; ++ } ++ break; ++ case 'd': ++ if ( !strcmp(key, "domain") ) { ++ /* n = 2; type = dd: UNUR_DISTR *distribution, double left, double right */ ++ result = _unur_str_distr_set_dd(distr,key,type_args,args,unur_distr_cont_set_domain); ++ break; ++ } ++ break; ++ case 'h': ++ if ( !strcmp(key, "hr") ) { ++ /* n = 1; type = C: UNUR_DISTR *distribution, const char *hrstr */ ++ result = _unur_str_distr_set_C(distr,key,type_args,args,unur_distr_cont_set_hrstr); ++ break; ++ } ++ if ( !strcmp(key, "hrstr") ) { ++ /* n = 1; type = C: UNUR_DISTR *distribution, const char *hrstr */ ++ result = _unur_str_distr_set_C(distr,key,type_args,args,unur_distr_cont_set_hrstr); ++ break; ++ } ++ break; ++ case 'l': ++ if ( !strcmp(key, "logcdf") ) { ++ /* n = 1; type = C: UNUR_DISTR *distribution, const char *logcdfstr */ ++ result = _unur_str_distr_set_C(distr,key,type_args,args,unur_distr_cont_set_logcdfstr); ++ break; ++ } ++ if ( !strcmp(key, "logcdfstr") ) { ++ /* n = 1; type = C: UNUR_DISTR *distribution, const char *logcdfstr */ ++ result = _unur_str_distr_set_C(distr,key,type_args,args,unur_distr_cont_set_logcdfstr); ++ break; ++ } ++ if ( !strcmp(key, "logpdf") ) { ++ /* n = 1; type = C: UNUR_DISTR *distribution, const char *logpdfstr */ ++ result = _unur_str_distr_set_C(distr,key,type_args,args,unur_distr_cont_set_logpdfstr); ++ break; ++ } ++ if ( !strcmp(key, "logpdfstr") ) { ++ /* n = 1; type = C: UNUR_DISTR *distribution, const char *logpdfstr */ ++ result = _unur_str_distr_set_C(distr,key,type_args,args,unur_distr_cont_set_logpdfstr); ++ break; ++ } ++ break; ++ case 'm': ++ if ( !strcmp(key, "mode") ) { ++ /* n = 1; type = d: UNUR_DISTR *distribution, double mode */ ++ result = _unur_str_distr_set_d(distr,key,type_args,args,unur_distr_cont_set_mode); ++ break; ++ } ++ break; ++ case 'p': ++ if ( !strcmp(key, "pdf") ) { ++ /* n = 1; type = C: UNUR_DISTR *distribution, const char *pdfstr */ ++ result = _unur_str_distr_set_C(distr,key,type_args,args,unur_distr_cont_set_pdfstr); ++ break; ++ } ++ if ( !strcmp(key, "pdfarea") ) { ++ /* n = 1; type = d: UNUR_DISTR *distribution, double area */ ++ result = _unur_str_distr_set_d(distr,key,type_args,args,unur_distr_cont_set_pdfarea); ++ break; ++ } ++ if ( !strcmp(key, "pdfparams") ) { ++ /* n = 2; type = Di: UNUR_DISTR *distribution, const double *params, int n_params */ ++ result = _unur_str_distr_set_Di(distr,key,type_args,args,unur_distr_cont_set_pdfparams); ++ break; ++ } ++ if ( !strcmp(key, "pdfstr") ) { ++ /* n = 1; type = C: UNUR_DISTR *distribution, const char *pdfstr */ ++ result = _unur_str_distr_set_C(distr,key,type_args,args,unur_distr_cont_set_pdfstr); ++ break; ++ } ++ } ++ break; ++ case UNUR_DISTR_DISCR: ++ switch (*key) { ++ case 'c': ++ if ( !strcmp(key, "cdf") ) { ++ /* n = 1; type = C: UNUR_DISTR *distribution, const char *cdfstr */ ++ result = _unur_str_distr_set_C(distr,key,type_args,args,unur_distr_discr_set_cdfstr); ++ break; ++ } ++ if ( !strcmp(key, "cdfstr") ) { ++ /* n = 1; type = C: UNUR_DISTR *distribution, const char *cdfstr */ ++ result = _unur_str_distr_set_C(distr,key,type_args,args,unur_distr_discr_set_cdfstr); ++ break; ++ } ++ break; ++ case 'd': ++ if ( !strcmp(key, "domain") ) { ++ /* n = 2; type = ii: UNUR_DISTR *distribution, int left, int right */ ++ result = _unur_str_distr_set_ii(distr,key,type_args,args,unur_distr_discr_set_domain); ++ break; ++ } ++ break; ++ case 'm': ++ if ( !strcmp(key, "mode") ) { ++ /* n = 1; type = i: UNUR_DISTR *distribution, int mode */ ++ result = _unur_str_distr_set_i(distr,key,type_args,args,unur_distr_discr_set_mode); ++ break; ++ } ++ break; ++ case 'p': ++ if ( !strcmp(key, "pmf") ) { ++ /* n = 1; type = C: UNUR_DISTR *distribution, const char *pmfstr */ ++ result = _unur_str_distr_set_C(distr,key,type_args,args,unur_distr_discr_set_pmfstr); ++ break; ++ } ++ if ( !strcmp(key, "pmfparams") ) { ++ /* n = 2; type = Di: UNUR_DISTR *distribution, const double *params, int n_params */ ++ result = _unur_str_distr_set_Di(distr,key,type_args,args,unur_distr_discr_set_pmfparams); ++ break; ++ } ++ if ( !strcmp(key, "pmfstr") ) { ++ /* n = 1; type = C: UNUR_DISTR *distribution, const char *pmfstr */ ++ result = _unur_str_distr_set_C(distr,key,type_args,args,unur_distr_discr_set_pmfstr); ++ break; ++ } ++ if ( !strcmp(key, "pmfsum") ) { ++ /* n = 1; type = d: UNUR_DISTR *distribution, double sum */ ++ result = _unur_str_distr_set_d(distr,key,type_args,args,unur_distr_discr_set_pmfsum); ++ break; ++ } ++ if ( !strcmp(key, "pv") ) { ++ /* n = 2; type = Di: UNUR_DISTR *distribution, const double *pv, int n_pv */ ++ result = _unur_str_distr_set_Di(distr,key,type_args,args,unur_distr_discr_set_pv); ++ break; ++ } ++ } ++ break; ++ } ++ ++ /* set calls for all distribution types */ ++ if (result == UNUR_ERR_STR_UNKNOWN) { ++ switch (*key) { ++ case 'n': ++ if ( !strcmp(key, "name") ) { ++ /* n = 1; type = C: UNUR_DISTR *distribution, const char *name */ ++ result = _unur_str_distr_set_C(distr,key,type_args,args,unur_distr_set_name); ++ break; ++ } ++ } ++ } ++ ++ ++ /* Ignored set commands: */ ++ /* int unur_distr_cont_set_pdf( UNUR_DISTR *distribution, UNUR_FUNCT_CONT *pdf ); ++ n = 1; type = ? */ ++ /* int unur_distr_cont_set_dpdf( UNUR_DISTR *distribution, UNUR_FUNCT_CONT *dpdf ); ++ n = 1; type = ? */ ++ /* int unur_distr_cont_set_cdf( UNUR_DISTR *distribution, UNUR_FUNCT_CONT *cdf ); ++ n = 1; type = ? */ ++ /* int unur_distr_cont_set_logpdf( UNUR_DISTR *distribution, UNUR_FUNCT_CONT *logpdf ); ++ n = 1; type = ? */ ++ /* int unur_distr_cont_set_dlogpdf( UNUR_DISTR *distribution, UNUR_FUNCT_CONT *dlogpdf ); ++ n = 1; type = ? */ ++ /* int unur_distr_cont_set_logcdf( UNUR_DISTR *distribution, UNUR_FUNCT_CONT *logcdf ); ++ n = 1; type = ? */ ++ /* int unur_distr_cont_set_hr( UNUR_DISTR *distribution, UNUR_FUNCT_CONT *hazard ); ++ n = 1; type = ? */ ++ /* int unur_distr_discr_set_pmf( UNUR_DISTR *distribution, UNUR_FUNCT_DISCR *pmf ); ++ n = 1; type = ? */ ++ /* int unur_distr_discr_set_cdf( UNUR_DISTR *distribution, UNUR_FUNCT_DISCR *cdf ); ++ n = 1; type = ? */ ++ /* int unur_distr_set_extobj( UNUR_DISTR *distribution, const void *extobj ); ++ n = 1; type = ? */ ++ ++ ++ /* Subsituted set commands: */ ++ /* int unur_distr_cont_set_pdfstr( UNUR_DISTR *distribution, const char *pdfstr ); ++ n = 1; type = C */ ++ /* int unur_distr_cont_set_cdfstr( UNUR_DISTR *distribution, const char *cdfstr ); ++ n = 1; type = C */ ++ /* int unur_distr_cont_set_logpdfstr( UNUR_DISTR *distribution, const char *logpdfstr ); ++ n = 1; type = C */ ++ /* int unur_distr_cont_set_logcdfstr( UNUR_DISTR *distribution, const char *logcdfstr ); ++ n = 1; type = C */ ++ /* int unur_distr_cont_set_hrstr( UNUR_DISTR *distribution, const char *hrstr ); ++ n = 1; type = C */ ++ /* int unur_distr_discr_set_pmfstr( UNUR_DISTR *distribution, const char *pmfstr ); ++ n = 1; type = C */ ++ /* int unur_distr_discr_set_cdfstr( UNUR_DISTR *distribution, const char *cdfstr ); ++ n = 1; type = C */ ++ ++ ++ /* Unsupported set commands: */ ++ /* int unur_distr_cemp_set_hist( UNUR_DISTR *distribution, const double *prob, int n_prob, double xmin, double xmax ); ++ n = 4; type = Didd */ ++ /* int unur_distr_cont_set_invcdf( UNUR_DISTR *distribution, UNUR_FUNCT_CONT *invcdf ); ++ n = 1; type = ? */ ++ /* int unur_distr_cont_set_pdfparams_vec( UNUR_DISTR *distribution, int par, const double *param_vec, int n_param_vec ); ++ n = 3; type = iDi */ ++ /* int unur_distr_discr_set_invcdf( UNUR_DISTR *distribution, UNUR_IFUNCT_DISCR *invcdf ); ++ n = 1; type = ? */ ++ ++ ++ /* special keyword */ ++ if (result == UNUR_ERR_STR_UNKNOWN) ++ if (distr->type == UNUR_DISTR_CONT) { ++ if ( !strcmp(key, "orderstatistics") ) { ++ /* make order statistics and replace distribution object */ ++ *ptr_distr = _unur_str_distr_make_os (distr, key, type_args, args); ++ result = (*ptr_distr == NULL) ? UNUR_ERR_STR_SYNTAX : UNUR_SUCCESS; ++ } ++ } ++ ++ if (result == UNUR_ERR_STR_UNKNOWN) { ++ /* unknown parameter */ ++ _unur_error_unknown(key,"parameter for given distribution"); ++ return UNUR_ERR_STR_UNKNOWN; ++ } ++ else if (result != UNUR_SUCCESS) { ++ /* invalid data for parameter */ ++ _unur_error_invalid(key,"set call"); ++ return UNUR_ERR_STR_SYNTAX; ++ } ++ ++ return UNUR_SUCCESS; ++ ++} /* end of _unur_str_distr_set() */ ++ ++/*---------------------------------------------------------------------------*/ ++ ++/*****************************************************************************/ ++/** Methods **/ ++/*****************************************************************************/ ++ ++/*---------------------------------------------------------------------------*/ ++ ++struct unur_par * ++_unur_str_par_new( const char *method, const UNUR_DISTR *distr ) ++ /*----------------------------------------------------------------------*/ ++ /* get new parameter object for method */ ++ /* */ ++ /* parameters: */ ++ /* method ... string that contains method name */ ++ /* distr ... pointer to distribution object */ ++ /* */ ++ /* return: */ ++ /* default parameters (pointer to structure) */ ++ /* */ ++ /* error: */ ++ /* return NULL */ ++ /*----------------------------------------------------------------------*/ ++{ ++ struct unur_par *par = NULL; ++ char method_unknown; ++ ++#ifdef UNUR_ENABLE_LOGGING ++ /* write info into LOG file */ ++ if (_unur_default_debugflag & UNUR_DEBUG_SETUP) ++ _unur_str_debug_string(1,"method",method); ++#endif ++ ++ /* mark method as unknown (this is a very ugly hack) */ ++ par = (struct unur_par *) &method_unknown; ++ ++ switch (*method) { ++ case 'a': ++ if ( !strcmp( method, "arou") ) { ++ par = unur_arou_new(distr); ++ break; ++ } ++ if ( !strcmp( method, "ars") ) { ++ par = unur_ars_new(distr); ++ break; ++ } ++ if ( !strcmp( method, "auto") ) { ++ par = unur_auto_new(distr); ++ break; ++ } ++ break; ++ case 'c': ++ if ( !strcmp( method, "cstd") ) { ++ par = unur_cstd_new(distr); ++ break; ++ } ++ break; ++ case 'd': ++ if ( !strcmp( method, "dari") ) { ++ par = unur_dari_new(distr); ++ break; ++ } ++ if ( !strcmp( method, "dau") ) { ++ par = unur_dau_new(distr); ++ break; ++ } ++ if ( !strcmp( method, "dgt") ) { ++ par = unur_dgt_new(distr); ++ break; ++ } ++ if ( !strcmp( method, "dsrou") ) { ++ par = unur_dsrou_new(distr); ++ break; ++ } ++ if ( !strcmp( method, "dss") ) { ++ par = unur_dss_new(distr); ++ break; ++ } ++ if ( !strcmp( method, "dstd") ) { ++ par = unur_dstd_new(distr); ++ break; ++ } ++ break; ++ case 'e': ++ if ( !strcmp( method, "empk") ) { ++ par = unur_empk_new(distr); ++ break; ++ } ++ if ( !strcmp( method, "empl") ) { ++ par = unur_empl_new(distr); ++ break; ++ } ++ break; ++ case 'g': ++ if ( !strcmp( method, "gibbs") ) { ++ par = unur_gibbs_new(distr); ++ break; ++ } ++ break; ++ case 'h': ++ if ( !strcmp( method, "hinv") ) { ++ par = unur_hinv_new(distr); ++ break; ++ } ++ if ( !strcmp( method, "hist") ) { ++ par = unur_hist_new(distr); ++ break; ++ } ++ if ( !strcmp( method, "hitro") ) { ++ par = unur_hitro_new(distr); ++ break; ++ } ++ if ( !strcmp( method, "hrb") ) { ++ par = unur_hrb_new(distr); ++ break; ++ } ++ if ( !strcmp( method, "hrd") ) { ++ par = unur_hrd_new(distr); ++ break; ++ } ++ if ( !strcmp( method, "hri") ) { ++ par = unur_hri_new(distr); ++ break; ++ } ++ break; ++ case 'i': ++ if ( !strcmp( method, "itdr") ) { ++ par = unur_itdr_new(distr); ++ break; ++ } ++ break; ++ case 'm': ++ if ( !strcmp( method, "mcorr") ) { ++ par = unur_mcorr_new(distr); ++ break; ++ } ++ if ( !strcmp( method, "mvstd") ) { ++ par = unur_mvstd_new(distr); ++ break; ++ } ++ if ( !strcmp( method, "mvtdr") ) { ++ par = unur_mvtdr_new(distr); ++ break; ++ } ++ break; ++ case 'n': ++ if ( !strcmp( method, "ninv") ) { ++ par = unur_ninv_new(distr); ++ break; ++ } ++ if ( !strcmp( method, "norta") ) { ++ par = unur_norta_new(distr); ++ break; ++ } ++ if ( !strcmp( method, "nrou") ) { ++ par = unur_nrou_new(distr); ++ break; ++ } ++ break; ++ case 'p': ++ if ( !strcmp( method, "pinv") ) { ++ par = unur_pinv_new(distr); ++ break; ++ } ++ break; ++ case 's': ++ if ( !strcmp( method, "srou") ) { ++ par = unur_srou_new(distr); ++ break; ++ } ++ if ( !strcmp( method, "ssr") ) { ++ par = unur_ssr_new(distr); ++ break; ++ } ++ break; ++ case 't': ++ if ( !strcmp( method, "tabl") ) { ++ par = unur_tabl_new(distr); ++ break; ++ } ++ if ( !strcmp( method, "tdr") ) { ++ par = unur_tdr_new(distr); ++ break; ++ } ++ break; ++ case 'u': ++ if ( !strcmp( method, "unif") ) { ++ par = unur_unif_new(distr); ++ break; ++ } ++ if ( !strcmp( method, "utdr") ) { ++ par = unur_utdr_new(distr); ++ break; ++ } ++ break; ++ case 'v': ++ if ( !strcmp( method, "vempk") ) { ++ par = unur_vempk_new(distr); ++ break; ++ } ++ if ( !strcmp( method, "vnrou") ) { ++ par = unur_vnrou_new(distr); ++ break; ++ } ++ } ++ ++ if (par == (struct unur_par *) &method_unknown) { ++ /* unknown method */ ++ _unur_error_unknown(method,"method"); ++ par = NULL; ++ } ++ else if (par == NULL) { ++ /* invalid data for chosen method */ ++ _unur_error_invalid(method,"method"); ++ } ++ ++ return par; ++} /* end of _unur_str_par_new() */ ++ ++/*---------------------------------------------------------------------------*/ ++ ++int ++_unur_str_par_set( UNUR_PAR *par, const char *key, char *value, struct unur_slist *mlist ) ++ /*----------------------------------------------------------------------*/ ++ /* set parameters for method */ ++ /* */ ++ /* parameters: */ ++ /* par ... pointer to parameter for building generator object */ ++ /* key ... string that contains key for parameter */ ++ /* value ... string that contains list of arguments for parameter */ ++ /* mlist ... list of allocated memory blocks */ ++ /* */ ++ /* return: */ ++ /* UNUR_SUCCESS ... on success */ ++ /* error code ... on error */ ++ /*----------------------------------------------------------------------*/ ++{ ++ int result = 0; /* result of UNU.RAN set call (0 or 1) */ ++ ++ /* storing arguments of set calls: */ ++ char type_args[MAX_SET_ARGS+1]; /* array containing info about arguments */ ++ char *args[MAX_SET_ARGS+1]; /* pointers to argument strings */ ++ ++ /* tokenize argument string */ ++ if (_unur_str_set_args( value, type_args, args, MAX_SET_ARGS ) < 0) { ++ /* error */ ++ return UNUR_ERR_STR_SYNTAX; ++ } ++ ++ /* set result indicator to unknown */ ++ result = UNUR_ERR_STR_UNKNOWN; ++ ++ /* find and execute set call */ ++ switch (par->method) { ++ case UNUR_METH_AROU: ++ switch (*key) { ++ case 'c': ++ if ( !strcmp(key, "cpoints") ) { ++ /* n = 2; type = iD: UNUR_PAR *parameters, int n_stp, const double *stp */ ++ result = _unur_str_par_set_iD(par,key,type_args,args,unur_arou_set_cpoints,mlist); ++ break; ++ } ++ break; ++ case 'd': ++ if ( !strcmp(key, "darsfactor") ) { ++ /* n = 1; type = d: UNUR_PAR *parameters, double factor */ ++ result = _unur_str_par_set_d(par,key,type_args,args,unur_arou_set_darsfactor); ++ break; ++ } ++ break; ++ case 'g': ++ if ( !strcmp(key, "guidefactor") ) { ++ /* n = 1; type = d: UNUR_PAR *parameters, double factor */ ++ result = _unur_str_par_set_d(par,key,type_args,args,unur_arou_set_guidefactor); ++ break; ++ } ++ break; ++ case 'm': ++ if ( !strcmp(key, "max_segments") ) { ++ /* n = 1; type = i: UNUR_PAR *parameters, int max_segs */ ++ result = _unur_str_par_set_i(par,key,type_args,args,unur_arou_set_max_segments); ++ break; ++ } ++ if ( !strcmp(key, "max_sqhratio") ) { ++ /* n = 1; type = d: UNUR_PAR *parameters, double max_ratio */ ++ result = _unur_str_par_set_d(par,key,type_args,args,unur_arou_set_max_sqhratio); ++ break; ++ } ++ break; ++ case 'p': ++ if ( !strcmp(key, "pedantic") ) { ++ /* n = 1; type = i: UNUR_PAR *parameters, int pedantic */ ++ result = _unur_str_par_set_i(par,key,type_args,args,unur_arou_set_pedantic); ++ break; ++ } ++ break; ++ case 'u': ++ if ( !strcmp(key, "usecenter") ) { ++ /* n = 1; type = i: UNUR_PAR *parameters, int usecenter */ ++ result = _unur_str_par_set_i(par,key,type_args,args,unur_arou_set_usecenter); ++ break; ++ } ++ if ( !strcmp(key, "usedars") ) { ++ /* n = 1; type = i: UNUR_PAR *parameters, int usedars */ ++ result = _unur_str_par_set_i(par,key,type_args,args,unur_arou_set_usedars); ++ break; ++ } ++ break; ++ case 'v': ++ if ( !strcmp(key, "verify") ) { ++ /* n = 1; type = i: UNUR_PAR *parameters, int verify */ ++ result = _unur_str_par_set_i(par,key,type_args,args,unur_arou_set_verify); ++ break; ++ } ++ } ++ break; ++ case UNUR_METH_ARS: ++ switch (*key) { ++ case 'c': ++ if ( !strcmp(key, "cpoints") ) { ++ /* n = 2; type = iD: UNUR_PAR *parameters, int n_cpoints, const double *cpoints */ ++ result = _unur_str_par_set_iD(par,key,type_args,args,unur_ars_set_cpoints,mlist); ++ break; ++ } ++ break; ++ case 'm': ++ if ( !strcmp(key, "max_intervals") ) { ++ /* n = 1; type = i: UNUR_PAR *parameters, int max_ivs */ ++ result = _unur_str_par_set_i(par,key,type_args,args,unur_ars_set_max_intervals); ++ break; ++ } ++ if ( !strcmp(key, "max_iter") ) { ++ /* n = 1; type = i: UNUR_PAR *parameters, int max_iter */ ++ result = _unur_str_par_set_i(par,key,type_args,args,unur_ars_set_max_iter); ++ break; ++ } ++ break; ++ case 'p': ++ if ( !strcmp(key, "pedantic") ) { ++ /* n = 1; type = i: UNUR_PAR *parameters, int pedantic */ ++ result = _unur_str_par_set_i(par,key,type_args,args,unur_ars_set_pedantic); ++ break; ++ } ++ break; ++ case 'r': ++ if ( !strcmp(key, "reinit_ncpoints") ) { ++ /* n = 1; type = i: UNUR_PAR *parameters, int ncpoints */ ++ result = _unur_str_par_set_i(par,key,type_args,args,unur_ars_set_reinit_ncpoints); ++ break; ++ } ++ if ( !strcmp(key, "reinit_percentiles") ) { ++ /* n = 2; type = iD: UNUR_PAR *parameters, int n_percentiles, const double *percentiles */ ++ result = _unur_str_par_set_iD(par,key,type_args,args,unur_ars_set_reinit_percentiles,mlist); ++ break; ++ } ++ break; ++ case 'v': ++ if ( !strcmp(key, "verify") ) { ++ /* n = 1; type = i: UNUR_PAR *parameters, int verify */ ++ result = _unur_str_par_set_i(par,key,type_args,args,unur_ars_set_verify); ++ break; ++ } ++ } ++ break; ++ case UNUR_METH_AUTO: ++ switch (*key) { ++ case 'l': ++ if ( !strcmp(key, "logss") ) { ++ /* n = 1; type = i: UNUR_PAR *parameters, int logss */ ++ result = _unur_str_par_set_i(par,key,type_args,args,unur_auto_set_logss); ++ break; ++ } ++ } ++ break; ++ case UNUR_METH_CSTD: ++ switch (*key) { ++ case 'v': ++ if ( !strcmp(key, "variant") ) { ++ /* n = 1; type = u: UNUR_PAR *parameters, unsigned variant */ ++ result = _unur_str_par_set_u(par,key,type_args,args,unur_cstd_set_variant); ++ break; ++ } ++ } ++ break; ++ case UNUR_METH_DARI: ++ switch (*key) { ++ case 'c': ++ if ( !strcmp(key, "cpfactor") ) { ++ /* n = 1; type = d: UNUR_PAR *parameters, double cp_factor */ ++ result = _unur_str_par_set_d(par,key,type_args,args,unur_dari_set_cpfactor); ++ break; ++ } ++ break; ++ case 's': ++ if ( !strcmp(key, "squeeze") ) { ++ /* n = 1; type = i: UNUR_PAR *parameters, int squeeze */ ++ result = _unur_str_par_set_i(par,key,type_args,args,unur_dari_set_squeeze); ++ break; ++ } ++ break; ++ case 't': ++ if ( !strcmp(key, "tablesize") ) { ++ /* n = 1; type = i: UNUR_PAR *parameters, int size */ ++ result = _unur_str_par_set_i(par,key,type_args,args,unur_dari_set_tablesize); ++ break; ++ } ++ break; ++ case 'v': ++ if ( !strcmp(key, "verify") ) { ++ /* n = 1; type = i: UNUR_PAR *parameters, int verify */ ++ result = _unur_str_par_set_i(par,key,type_args,args,unur_dari_set_verify); ++ break; ++ } ++ } ++ break; ++ case UNUR_METH_DAU: ++ switch (*key) { ++ case 'u': ++ if ( !strcmp(key, "urnfactor") ) { ++ /* n = 1; type = d: UNUR_PAR *parameters, double factor */ ++ result = _unur_str_par_set_d(par,key,type_args,args,unur_dau_set_urnfactor); ++ break; ++ } ++ } ++ break; ++ case UNUR_METH_DGT: ++ switch (*key) { ++ case 'g': ++ if ( !strcmp(key, "guidefactor") ) { ++ /* n = 1; type = d: UNUR_PAR *parameters, double factor */ ++ result = _unur_str_par_set_d(par,key,type_args,args,unur_dgt_set_guidefactor); ++ break; ++ } ++ break; ++ case 'v': ++ if ( !strcmp(key, "variant") ) { ++ /* n = 1; type = u: UNUR_PAR *parameters, unsigned variant */ ++ result = _unur_str_par_set_u(par,key,type_args,args,unur_dgt_set_variant); ++ break; ++ } ++ } ++ break; ++ case UNUR_METH_DSROU: ++ switch (*key) { ++ case 'c': ++ if ( !strcmp(key, "cdfatmode") ) { ++ /* n = 1; type = d: UNUR_PAR *parameters, double Fmode */ ++ result = _unur_str_par_set_d(par,key,type_args,args,unur_dsrou_set_cdfatmode); ++ break; ++ } ++ break; ++ case 'v': ++ if ( !strcmp(key, "verify") ) { ++ /* n = 1; type = i: UNUR_PAR *parameters, int verify */ ++ result = _unur_str_par_set_i(par,key,type_args,args,unur_dsrou_set_verify); ++ break; ++ } ++ } ++ break; ++ case UNUR_METH_DSTD: ++ switch (*key) { ++ case 'v': ++ if ( !strcmp(key, "variant") ) { ++ /* n = 1; type = u: UNUR_PAR *parameters, unsigned variant */ ++ result = _unur_str_par_set_u(par,key,type_args,args,unur_dstd_set_variant); ++ break; ++ } ++ } ++ break; ++ case UNUR_METH_EMPK: ++ switch (*key) { ++ case 'b': ++ if ( !strcmp(key, "beta") ) { ++ /* n = 1; type = d: UNUR_PAR *parameters, double beta */ ++ result = _unur_str_par_set_d(par,key,type_args,args,unur_empk_set_beta); ++ break; ++ } ++ break; ++ case 'k': ++ if ( !strcmp(key, "kernel") ) { ++ /* n = 1; type = u: UNUR_PAR *parameters, unsigned kernel*/ ++ result = _unur_str_par_set_u(par,key,type_args,args,unur_empk_set_kernel); ++ break; ++ } ++ break; ++ case 'p': ++ if ( !strcmp(key, "positive") ) { ++ /* n = 1; type = i: UNUR_PAR *parameters, int positive */ ++ result = _unur_str_par_set_i(par,key,type_args,args,unur_empk_set_positive); ++ break; ++ } ++ break; ++ case 's': ++ if ( !strcmp(key, "smoothing") ) { ++ /* n = 1; type = d: UNUR_PAR *parameters, double smoothing */ ++ result = _unur_str_par_set_d(par,key,type_args,args,unur_empk_set_smoothing); ++ break; ++ } ++ break; ++ case 'v': ++ if ( !strcmp(key, "varcor") ) { ++ /* n = 1; type = i: UNUR_PAR *parameters, int varcor */ ++ result = _unur_str_par_set_i(par,key,type_args,args,unur_empk_set_varcor); ++ break; ++ } ++ } ++ break; ++ case UNUR_METH_GIBBS: ++ switch (*key) { ++ case 'b': ++ if ( !strcmp(key, "burnin") ) { ++ /* n = 1; type = i: UNUR_PAR *parameters, int burnin */ ++ result = _unur_str_par_set_i(par,key,type_args,args,unur_gibbs_set_burnin); ++ break; ++ } ++ break; ++ case 'c': ++ if ( !strcmp(key, "c") ) { ++ /* n = 1; type = d: UNUR_PAR *parameters, double c */ ++ result = _unur_str_par_set_d(par,key,type_args,args,unur_gibbs_set_c); ++ break; ++ } ++ break; ++ case 't': ++ if ( !strcmp(key, "thinning") ) { ++ /* n = 1; type = i: UNUR_PAR *parameters, int thinning */ ++ result = _unur_str_par_set_i(par,key,type_args,args,unur_gibbs_set_thinning); ++ break; ++ } ++ break; ++ case 'v': ++ if ( !strcmp(key, "variant_coordinate") ) { ++ /* n = 0; type = : UNUR_PAR *parameters */ ++ result = _unur_str_par_set_void(par,key,type_args,args,unur_gibbs_set_variant_coordinate); ++ break; ++ } ++ if ( !strcmp(key, "variant_random_direction") ) { ++ /* n = 0; type = : UNUR_PAR *parameters */ ++ result = _unur_str_par_set_void(par,key,type_args,args,unur_gibbs_set_variant_random_direction); ++ break; ++ } ++ } ++ break; ++ case UNUR_METH_HINV: ++ switch (*key) { ++ case 'b': ++ if ( !strcmp(key, "boundary") ) { ++ /* n = 2; type = dd: UNUR_PAR *parameters, double left, double right */ ++ result = _unur_str_par_set_dd(par,key,type_args,args,unur_hinv_set_boundary); ++ break; ++ } ++ break; ++ case 'c': ++ if ( !strcmp(key, "cpoints") ) { ++ /* n = 2; type = Di: UNUR_PAR *parameters, const double *stp, int n_stp */ ++ result = _unur_str_par_set_Di(par,key,type_args,args,unur_hinv_set_cpoints,mlist); ++ break; ++ } ++ break; ++ case 'g': ++ if ( !strcmp(key, "guidefactor") ) { ++ /* n = 1; type = d: UNUR_PAR *parameters, double factor */ ++ result = _unur_str_par_set_d(par,key,type_args,args,unur_hinv_set_guidefactor); ++ break; ++ } ++ break; ++ case 'm': ++ if ( !strcmp(key, "max_intervals") ) { ++ /* n = 1; type = i: UNUR_PAR *parameters, int max_ivs */ ++ result = _unur_str_par_set_i(par,key,type_args,args,unur_hinv_set_max_intervals); ++ break; ++ } ++ break; ++ case 'o': ++ if ( !strcmp(key, "order") ) { ++ /* n = 1; type = i: UNUR_PAR *parameters, int order*/ ++ result = _unur_str_par_set_i(par,key,type_args,args,unur_hinv_set_order); ++ break; ++ } ++ break; ++ case 'u': ++ if ( !strcmp(key, "u_resolution") ) { ++ /* n = 1; type = d: UNUR_PAR *parameters, double u_resolution*/ ++ result = _unur_str_par_set_d(par,key,type_args,args,unur_hinv_set_u_resolution); ++ break; ++ } ++ } ++ break; ++ case UNUR_METH_HITRO: ++ switch (*key) { ++ case 'a': ++ if ( !strcmp(key, "adaptive_multiplier") ) { ++ /* n = 1; type = d: UNUR_PAR *parameters, double factor */ ++ result = _unur_str_par_set_d(par,key,type_args,args,unur_hitro_set_adaptive_multiplier); ++ break; ++ } ++ break; ++ case 'b': ++ if ( !strcmp(key, "burnin") ) { ++ /* n = 1; type = i: UNUR_PAR *parameters, int burnin */ ++ result = _unur_str_par_set_i(par,key,type_args,args,unur_hitro_set_burnin); ++ break; ++ } ++ break; ++ case 'r': ++ if ( !strcmp(key, "r") ) { ++ /* n = 1; type = d: UNUR_PAR *parameters, double r */ ++ result = _unur_str_par_set_d(par,key,type_args,args,unur_hitro_set_r); ++ break; ++ } ++ break; ++ case 't': ++ if ( !strcmp(key, "thinning") ) { ++ /* n = 1; type = i: UNUR_PAR *parameters, int thinning */ ++ result = _unur_str_par_set_i(par,key,type_args,args,unur_hitro_set_thinning); ++ break; ++ } ++ break; ++ case 'u': ++ if ( !strcmp(key, "use_adaptiveline") ) { ++ /* n = 1; type = i: UNUR_PAR *parameters, int adaptive */ ++ result = _unur_str_par_set_i(par,key,type_args,args,unur_hitro_set_use_adaptiveline); ++ break; ++ } ++ if ( !strcmp(key, "use_adaptiverectangle") ) { ++ /* n = 1; type = i: UNUR_PAR *parameters, int adaptive */ ++ result = _unur_str_par_set_i(par,key,type_args,args,unur_hitro_set_use_adaptiverectangle); ++ break; ++ } ++ if ( !strcmp(key, "use_boundingrectangle") ) { ++ /* n = 1; type = i: UNUR_PAR *parameters, int rectangle */ ++ result = _unur_str_par_set_i(par,key,type_args,args,unur_hitro_set_use_boundingrectangle); ++ break; ++ } ++ break; ++ case 'v': ++ if ( !strcmp(key, "v") ) { ++ /* n = 1; type = d: UNUR_PAR *parameters, double vmax */ ++ result = _unur_str_par_set_d(par,key,type_args,args,unur_hitro_set_v); ++ break; ++ } ++ if ( !strcmp(key, "variant_coordinate") ) { ++ /* n = 0; type = : UNUR_PAR *parameters */ ++ result = _unur_str_par_set_void(par,key,type_args,args,unur_hitro_set_variant_coordinate); ++ break; ++ } ++ if ( !strcmp(key, "variant_random_direction") ) { ++ /* n = 0; type = : UNUR_PAR *parameters */ ++ result = _unur_str_par_set_void(par,key,type_args,args,unur_hitro_set_variant_random_direction); ++ break; ++ } ++ } ++ break; ++ case UNUR_METH_HRB: ++ switch (*key) { ++ case 'u': ++ if ( !strcmp(key, "upperbound") ) { ++ /* n = 1; type = d: UNUR_PAR *parameters, double upperbound */ ++ result = _unur_str_par_set_d(par,key,type_args,args,unur_hrb_set_upperbound); ++ break; ++ } ++ break; ++ case 'v': ++ if ( !strcmp(key, "verify") ) { ++ /* n = 1; type = i: UNUR_PAR *parameters, int verify */ ++ result = _unur_str_par_set_i(par,key,type_args,args,unur_hrb_set_verify); ++ break; ++ } ++ } ++ break; ++ case UNUR_METH_HRD: ++ switch (*key) { ++ case 'v': ++ if ( !strcmp(key, "verify") ) { ++ /* n = 1; type = i: UNUR_PAR *parameters, int verify */ ++ result = _unur_str_par_set_i(par,key,type_args,args,unur_hrd_set_verify); ++ break; ++ } ++ } ++ break; ++ case UNUR_METH_HRI: ++ switch (*key) { ++ case 'p': ++ if ( !strcmp(key, "p0") ) { ++ /* n = 1; type = d: UNUR_PAR *parameters, double p0 */ ++ result = _unur_str_par_set_d(par,key,type_args,args,unur_hri_set_p0); ++ break; ++ } ++ break; ++ case 'v': ++ if ( !strcmp(key, "verify") ) { ++ /* n = 1; type = i: UNUR_PAR *parameters, int verify */ ++ result = _unur_str_par_set_i(par,key,type_args,args,unur_hri_set_verify); ++ break; ++ } ++ } ++ break; ++ case UNUR_METH_ITDR: ++ switch (*key) { ++ case 'c': ++ if ( !strcmp(key, "cp") ) { ++ /* n = 1; type = d: UNUR_PAR *parameters, double cp */ ++ result = _unur_str_par_set_d(par,key,type_args,args,unur_itdr_set_cp); ++ break; ++ } ++ if ( !strcmp(key, "ct") ) { ++ /* n = 1; type = d: UNUR_PAR *parameters, double ct */ ++ result = _unur_str_par_set_d(par,key,type_args,args,unur_itdr_set_ct); ++ break; ++ } ++ break; ++ case 'v': ++ if ( !strcmp(key, "verify") ) { ++ /* n = 1; type = i: UNUR_PAR *parameters, int verify */ ++ result = _unur_str_par_set_i(par,key,type_args,args,unur_itdr_set_verify); ++ break; ++ } ++ break; ++ case 'x': ++ if ( !strcmp(key, "xi") ) { ++ /* n = 1; type = d: UNUR_PAR *parameters, double xi */ ++ result = _unur_str_par_set_d(par,key,type_args,args,unur_itdr_set_xi); ++ break; ++ } ++ } ++ break; ++ case UNUR_METH_MVTDR: ++ switch (*key) { ++ case 'b': ++ if ( !strcmp(key, "boundsplitting") ) { ++ /* n = 1; type = d: UNUR_PAR *parameters, double boundsplitting */ ++ result = _unur_str_par_set_d(par,key,type_args,args,unur_mvtdr_set_boundsplitting); ++ break; ++ } ++ break; ++ case 'm': ++ if ( !strcmp(key, "maxcones") ) { ++ /* n = 1; type = i: UNUR_PAR *parameters, int maxcones */ ++ result = _unur_str_par_set_i(par,key,type_args,args,unur_mvtdr_set_maxcones); ++ break; ++ } ++ break; ++ case 's': ++ if ( !strcmp(key, "stepsmin") ) { ++ /* n = 1; type = i: UNUR_PAR *parameters, int stepsmin */ ++ result = _unur_str_par_set_i(par,key,type_args,args,unur_mvtdr_set_stepsmin); ++ break; ++ } ++ break; ++ case 'v': ++ if ( !strcmp(key, "verify") ) { ++ /* n = 1; type = i: UNUR_PAR *parameters, int verify */ ++ result = _unur_str_par_set_i(par,key,type_args,args,unur_mvtdr_set_verify); ++ break; ++ } ++ } ++ break; ++ case UNUR_METH_NINV: ++ switch (*key) { ++ case 'm': ++ if ( !strcmp(key, "max_iter") ) { ++ /* n = 1; type = i: UNUR_PAR *parameters, int max_iter */ ++ result = _unur_str_par_set_i(par,key,type_args,args,unur_ninv_set_max_iter); ++ break; ++ } ++ break; ++ case 's': ++ if ( !strcmp(key, "start") ) { ++ /* n = 2; type = dd: UNUR_PAR *parameters, double left, double right*/ ++ result = _unur_str_par_set_dd(par,key,type_args,args,unur_ninv_set_start); ++ break; ++ } ++ break; ++ case 't': ++ if ( !strcmp(key, "table") ) { ++ /* n = 1; type = i: UNUR_PAR *parameters, int no_of_points*/ ++ result = _unur_str_par_set_i(par,key,type_args,args,unur_ninv_set_table); ++ break; ++ } ++ break; ++ case 'u': ++ if ( !strcmp(key, "u_resolution") ) { ++ /* n = 1; type = d: UNUR_PAR *parameters, double u_resolution*/ ++ result = _unur_str_par_set_d(par,key,type_args,args,unur_ninv_set_u_resolution); ++ break; ++ } ++ if ( !strcmp(key, "usebisect") ) { ++ /* n = 0; type = : UNUR_PAR *parameters */ ++ result = _unur_str_par_set_void(par,key,type_args,args,unur_ninv_set_usebisect); ++ break; ++ } ++ if ( !strcmp(key, "usenewton") ) { ++ /* n = 0; type = : UNUR_PAR *parameters */ ++ result = _unur_str_par_set_void(par,key,type_args,args,unur_ninv_set_usenewton); ++ break; ++ } ++ if ( !strcmp(key, "useregula") ) { ++ /* n = 0; type = : UNUR_PAR *parameters */ ++ result = _unur_str_par_set_void(par,key,type_args,args,unur_ninv_set_useregula); ++ break; ++ } ++ break; ++ case 'x': ++ if ( !strcmp(key, "x_resolution") ) { ++ /* n = 1; type = d: UNUR_PAR *parameters, double x_resolution*/ ++ result = _unur_str_par_set_d(par,key,type_args,args,unur_ninv_set_x_resolution); ++ break; ++ } ++ } ++ break; ++ case UNUR_METH_NROU: ++ switch (*key) { ++ case 'c': ++ if ( !strcmp(key, "center") ) { ++ /* n = 1; type = d: UNUR_PAR *parameters, double center */ ++ result = _unur_str_par_set_d(par,key,type_args,args,unur_nrou_set_center); ++ break; ++ } ++ break; ++ case 'r': ++ if ( !strcmp(key, "r") ) { ++ /* n = 1; type = d: UNUR_PAR *parameters, double r */ ++ result = _unur_str_par_set_d(par,key,type_args,args,unur_nrou_set_r); ++ break; ++ } ++ break; ++ case 'u': ++ if ( !strcmp(key, "u") ) { ++ /* n = 2; type = dd: UNUR_PAR *parameters, double umin, double umax */ ++ result = _unur_str_par_set_dd(par,key,type_args,args,unur_nrou_set_u); ++ break; ++ } ++ break; ++ case 'v': ++ if ( !strcmp(key, "v") ) { ++ /* n = 1; type = d: UNUR_PAR *parameters, double vmax */ ++ result = _unur_str_par_set_d(par,key,type_args,args,unur_nrou_set_v); ++ break; ++ } ++ if ( !strcmp(key, "verify") ) { ++ /* n = 1; type = i: UNUR_PAR *parameters, int verify */ ++ result = _unur_str_par_set_i(par,key,type_args,args,unur_nrou_set_verify); ++ break; ++ } ++ } ++ break; ++ case UNUR_METH_PINV: ++ switch (*key) { ++ case 'b': ++ if ( !strcmp(key, "boundary") ) { ++ /* n = 2; type = dd: UNUR_PAR *parameters, double left, double right */ ++ result = _unur_str_par_set_dd(par,key,type_args,args,unur_pinv_set_boundary); ++ break; ++ } ++ break; ++ case 'e': ++ if ( !strcmp(key, "extra_testpoints") ) { ++ /* n = 1; type = i: UNUR_PAR *parameters, int n_points*/ ++ result = _unur_str_par_set_i(par,key,type_args,args,unur_pinv_set_extra_testpoints); ++ break; ++ } ++ break; ++ case 'k': ++ if ( !strcmp(key, "keepcdf") ) { ++ /* n = 1; type = i: UNUR_PAR *parameters, int keepcdf*/ ++ result = _unur_str_par_set_i(par,key,type_args,args,unur_pinv_set_keepcdf); ++ break; ++ } ++ break; ++ case 'm': ++ if ( !strcmp(key, "max_intervals") ) { ++ /* n = 1; type = i: UNUR_PAR *parameters, int max_ivs */ ++ result = _unur_str_par_set_i(par,key,type_args,args,unur_pinv_set_max_intervals); ++ break; ++ } ++ break; ++ case 'o': ++ if ( !strcmp(key, "order") ) { ++ /* n = 1; type = i: UNUR_PAR *parameters, int order*/ ++ result = _unur_str_par_set_i(par,key,type_args,args,unur_pinv_set_order); ++ break; ++ } ++ break; ++ case 's': ++ if ( !strcmp(key, "searchboundary") ) { ++ /* n = 2; type = ii: UNUR_PAR *parameters, int left, int right */ ++ result = _unur_str_par_set_ii(par,key,type_args,args,unur_pinv_set_searchboundary); ++ break; ++ } ++ if ( !strcmp(key, "smoothness") ) { ++ /* n = 1; type = i: UNUR_PAR *parameters, int smoothness*/ ++ result = _unur_str_par_set_i(par,key,type_args,args,unur_pinv_set_smoothness); ++ break; ++ } ++ break; ++ case 'u': ++ if ( !strcmp(key, "u_resolution") ) { ++ /* n = 1; type = d: UNUR_PAR *parameters, double u_resolution*/ ++ result = _unur_str_par_set_d(par,key,type_args,args,unur_pinv_set_u_resolution); ++ break; ++ } ++ if ( !strcmp(key, "use_upoints") ) { ++ /* n = 1; type = i: UNUR_PAR *parameters, int use_upoints */ ++ result = _unur_str_par_set_i(par,key,type_args,args,unur_pinv_set_use_upoints); ++ break; ++ } ++ if ( !strcmp(key, "usecdf") ) { ++ /* n = 0; type = : UNUR_PAR *parameters */ ++ result = _unur_str_par_set_void(par,key,type_args,args,unur_pinv_set_usecdf); ++ break; ++ } ++ if ( !strcmp(key, "usepdf") ) { ++ /* n = 0; type = : UNUR_PAR *parameters */ ++ result = _unur_str_par_set_void(par,key,type_args,args,unur_pinv_set_usepdf); ++ break; ++ } ++ } ++ break; ++ case UNUR_METH_SROU: ++ switch (*key) { ++ case 'c': ++ if ( !strcmp(key, "cdfatmode") ) { ++ /* n = 1; type = d: UNUR_PAR *parameters, double Fmode */ ++ result = _unur_str_par_set_d(par,key,type_args,args,unur_srou_set_cdfatmode); ++ break; ++ } ++ break; ++ case 'p': ++ if ( !strcmp(key, "pdfatmode") ) { ++ /* n = 1; type = d: UNUR_PAR *parameters, double fmode */ ++ result = _unur_str_par_set_d(par,key,type_args,args,unur_srou_set_pdfatmode); ++ break; ++ } ++ break; ++ case 'r': ++ if ( !strcmp(key, "r") ) { ++ /* n = 1; type = d: UNUR_PAR *parameters, double r */ ++ result = _unur_str_par_set_d(par,key,type_args,args,unur_srou_set_r); ++ break; ++ } ++ break; ++ case 'u': ++ if ( !strcmp(key, "usemirror") ) { ++ /* n = 1; type = i: UNUR_PAR *parameters, int usemirror */ ++ result = _unur_str_par_set_i(par,key,type_args,args,unur_srou_set_usemirror); ++ break; ++ } ++ if ( !strcmp(key, "usesqueeze") ) { ++ /* n = 1; type = i: UNUR_PAR *parameters, int usesqueeze */ ++ result = _unur_str_par_set_i(par,key,type_args,args,unur_srou_set_usesqueeze); ++ break; ++ } ++ break; ++ case 'v': ++ if ( !strcmp(key, "verify") ) { ++ /* n = 1; type = i: UNUR_PAR *parameters, int verify */ ++ result = _unur_str_par_set_i(par,key,type_args,args,unur_srou_set_verify); ++ break; ++ } ++ } ++ break; ++ case UNUR_METH_SSR: ++ switch (*key) { ++ case 'c': ++ if ( !strcmp(key, "cdfatmode") ) { ++ /* n = 1; type = d: UNUR_PAR *parameters, double Fmode */ ++ result = _unur_str_par_set_d(par,key,type_args,args,unur_ssr_set_cdfatmode); ++ break; ++ } ++ break; ++ case 'p': ++ if ( !strcmp(key, "pdfatmode") ) { ++ /* n = 1; type = d: UNUR_PAR *parameters, double fmode */ ++ result = _unur_str_par_set_d(par,key,type_args,args,unur_ssr_set_pdfatmode); ++ break; ++ } ++ break; ++ case 'u': ++ if ( !strcmp(key, "usesqueeze") ) { ++ /* n = 1; type = i: UNUR_PAR *parameters, int usesqueeze */ ++ result = _unur_str_par_set_i(par,key,type_args,args,unur_ssr_set_usesqueeze); ++ break; ++ } ++ break; ++ case 'v': ++ if ( !strcmp(key, "verify") ) { ++ /* n = 1; type = i: UNUR_PAR *parameters, int verify */ ++ result = _unur_str_par_set_i(par,key,type_args,args,unur_ssr_set_verify); ++ break; ++ } ++ } ++ break; ++ case UNUR_METH_TABL: ++ switch (*key) { ++ case 'a': ++ if ( !strcmp(key, "areafraction") ) { ++ /* n = 1; type = d: UNUR_PAR *parameters, double fraction */ ++ result = _unur_str_par_set_d(par,key,type_args,args,unur_tabl_set_areafraction); ++ break; ++ } ++ break; ++ case 'b': ++ if ( !strcmp(key, "boundary") ) { ++ /* n = 2; type = dd: UNUR_PAR *parameters, double left, double right */ ++ result = _unur_str_par_set_dd(par,key,type_args,args,unur_tabl_set_boundary); ++ break; ++ } ++ break; ++ case 'c': ++ if ( !strcmp(key, "cpoints") ) { ++ /* n = 2; type = iD: UNUR_PAR *parameters, int n_cpoints, const double *cpoints */ ++ result = _unur_str_par_set_iD(par,key,type_args,args,unur_tabl_set_cpoints,mlist); ++ break; ++ } ++ break; ++ case 'd': ++ if ( !strcmp(key, "darsfactor") ) { ++ /* n = 1; type = d: UNUR_PAR *parameters, double factor */ ++ result = _unur_str_par_set_d(par,key,type_args,args,unur_tabl_set_darsfactor); ++ break; ++ } ++ break; ++ case 'g': ++ if ( !strcmp(key, "guidefactor") ) { ++ /* n = 1; type = d: UNUR_PAR *parameters, double factor */ ++ result = _unur_str_par_set_d(par,key,type_args,args,unur_tabl_set_guidefactor); ++ break; ++ } ++ break; ++ case 'm': ++ if ( !strcmp(key, "max_intervals") ) { ++ /* n = 1; type = i: UNUR_PAR *parameters, int max_ivs */ ++ result = _unur_str_par_set_i(par,key,type_args,args,unur_tabl_set_max_intervals); ++ break; ++ } ++ if ( !strcmp(key, "max_sqhratio") ) { ++ /* n = 1; type = d: UNUR_PAR *parameters, double max_ratio */ ++ result = _unur_str_par_set_d(par,key,type_args,args,unur_tabl_set_max_sqhratio); ++ break; ++ } ++ break; ++ case 'n': ++ if ( !strcmp(key, "nstp") ) { ++ /* n = 1; type = i: UNUR_PAR *parameters, int n_stp */ ++ result = _unur_str_par_set_i(par,key,type_args,args,unur_tabl_set_nstp); ++ break; ++ } ++ break; ++ case 'p': ++ if ( !strcmp(key, "pedantic") ) { ++ /* n = 1; type = i: UNUR_PAR *parameters, int pedantic */ ++ result = _unur_str_par_set_i(par,key,type_args,args,unur_tabl_set_pedantic); ++ break; ++ } ++ break; ++ case 's': ++ if ( !strcmp(key, "slopes") ) { ++ /* n = 2; type = Di: UNUR_PAR *parameters, const double *slopes, int n_slopes */ ++ result = _unur_str_par_set_Di(par,key,type_args,args,unur_tabl_set_slopes,mlist); ++ break; ++ } ++ break; ++ case 'u': ++ if ( !strcmp(key, "usedars") ) { ++ /* n = 1; type = i: UNUR_PAR *parameters, int usedars */ ++ result = _unur_str_par_set_i(par,key,type_args,args,unur_tabl_set_usedars); ++ break; ++ } ++ if ( !strcmp(key, "useear") ) { ++ /* n = 1; type = i: UNUR_PAR *parameters, int useear */ ++ result = _unur_str_par_set_i(par,key,type_args,args,unur_tabl_set_useear); ++ break; ++ } ++ break; ++ case 'v': ++ if ( !strcmp(key, "variant_ia") ) { ++ /* n = 1; type = i: UNUR_PAR *parameters, int use_ia */ ++ result = _unur_str_par_set_i(par,key,type_args,args,unur_tabl_set_variant_ia); ++ break; ++ } ++ if ( !strcmp(key, "variant_splitmode") ) { ++ /* n = 1; type = u: UNUR_PAR *parameters, unsigned splitmode */ ++ result = _unur_str_par_set_u(par,key,type_args,args,unur_tabl_set_variant_splitmode); ++ break; ++ } ++ if ( !strcmp(key, "verify") ) { ++ /* n = 1; type = i: UNUR_PAR *parameters, int verify */ ++ result = _unur_str_par_set_i(par,key,type_args,args,unur_tabl_set_verify); ++ break; ++ } ++ } ++ break; ++ case UNUR_METH_TDR: ++ switch (*key) { ++ case 'c': ++ if ( !strcmp(key, "c") ) { ++ /* n = 1; type = d: UNUR_PAR *parameters, double c */ ++ result = _unur_str_par_set_d(par,key,type_args,args,unur_tdr_set_c); ++ break; ++ } ++ if ( !strcmp(key, "cpoints") ) { ++ /* n = 2; type = iD: UNUR_PAR *parameters, int n_stp, const double *stp */ ++ result = _unur_str_par_set_iD(par,key,type_args,args,unur_tdr_set_cpoints,mlist); ++ break; ++ } ++ break; ++ case 'd': ++ if ( !strcmp(key, "darsfactor") ) { ++ /* n = 1; type = d: UNUR_PAR *parameters, double factor */ ++ result = _unur_str_par_set_d(par,key,type_args,args,unur_tdr_set_darsfactor); ++ break; ++ } ++ break; ++ case 'g': ++ if ( !strcmp(key, "guidefactor") ) { ++ /* n = 1; type = d: UNUR_PAR *parameters, double factor */ ++ result = _unur_str_par_set_d(par,key,type_args,args,unur_tdr_set_guidefactor); ++ break; ++ } ++ break; ++ case 'm': ++ if ( !strcmp(key, "max_intervals") ) { ++ /* n = 1; type = i: UNUR_PAR *parameters, int max_ivs */ ++ result = _unur_str_par_set_i(par,key,type_args,args,unur_tdr_set_max_intervals); ++ break; ++ } ++ if ( !strcmp(key, "max_sqhratio") ) { ++ /* n = 1; type = d: UNUR_PAR *parameters, double max_ratio */ ++ result = _unur_str_par_set_d(par,key,type_args,args,unur_tdr_set_max_sqhratio); ++ break; ++ } ++ break; ++ case 'p': ++ if ( !strcmp(key, "pedantic") ) { ++ /* n = 1; type = i: UNUR_PAR *parameters, int pedantic */ ++ result = _unur_str_par_set_i(par,key,type_args,args,unur_tdr_set_pedantic); ++ break; ++ } ++ break; ++ case 'r': ++ if ( !strcmp(key, "reinit_ncpoints") ) { ++ /* n = 1; type = i: UNUR_PAR *parameters, int ncpoints */ ++ result = _unur_str_par_set_i(par,key,type_args,args,unur_tdr_set_reinit_ncpoints); ++ break; ++ } ++ if ( !strcmp(key, "reinit_percentiles") ) { ++ /* n = 2; type = iD: UNUR_PAR *parameters, int n_percentiles, const double *percentiles */ ++ result = _unur_str_par_set_iD(par,key,type_args,args,unur_tdr_set_reinit_percentiles,mlist); ++ break; ++ } ++ break; ++ case 'u': ++ if ( !strcmp(key, "usecenter") ) { ++ /* n = 1; type = i: UNUR_PAR *parameters, int usecenter */ ++ result = _unur_str_par_set_i(par,key,type_args,args,unur_tdr_set_usecenter); ++ break; ++ } ++ if ( !strcmp(key, "usedars") ) { ++ /* n = 1; type = i: UNUR_PAR *parameters, int usedars */ ++ result = _unur_str_par_set_i(par,key,type_args,args,unur_tdr_set_usedars); ++ break; ++ } ++ if ( !strcmp(key, "usemode") ) { ++ /* n = 1; type = i: UNUR_PAR *parameters, int usemode */ ++ result = _unur_str_par_set_i(par,key,type_args,args,unur_tdr_set_usemode); ++ break; ++ } ++ break; ++ case 'v': ++ if ( !strcmp(key, "variant_gw") ) { ++ /* n = 0; type = : UNUR_PAR *parameters */ ++ result = _unur_str_par_set_void(par,key,type_args,args,unur_tdr_set_variant_gw); ++ break; ++ } ++ if ( !strcmp(key, "variant_ia") ) { ++ /* n = 0; type = : UNUR_PAR *parameters */ ++ result = _unur_str_par_set_void(par,key,type_args,args,unur_tdr_set_variant_ia); ++ break; ++ } ++ if ( !strcmp(key, "variant_ps") ) { ++ /* n = 0; type = : UNUR_PAR *parameters */ ++ result = _unur_str_par_set_void(par,key,type_args,args,unur_tdr_set_variant_ps); ++ break; ++ } ++ if ( !strcmp(key, "verify") ) { ++ /* n = 1; type = i: UNUR_PAR *parameters, int verify */ ++ result = _unur_str_par_set_i(par,key,type_args,args,unur_tdr_set_verify); ++ break; ++ } ++ } ++ break; ++ case UNUR_METH_UTDR: ++ switch (*key) { ++ case 'c': ++ if ( !strcmp(key, "cpfactor") ) { ++ /* n = 1; type = d: UNUR_PAR *parameters, double cp_factor */ ++ result = _unur_str_par_set_d(par,key,type_args,args,unur_utdr_set_cpfactor); ++ break; ++ } ++ break; ++ case 'd': ++ if ( !strcmp(key, "deltafactor") ) { ++ /* n = 1; type = d: UNUR_PAR *parameters, double delta */ ++ result = _unur_str_par_set_d(par,key,type_args,args,unur_utdr_set_deltafactor); ++ break; ++ } ++ break; ++ case 'p': ++ if ( !strcmp(key, "pdfatmode") ) { ++ /* n = 1; type = d: UNUR_PAR *parameters, double fmode */ ++ result = _unur_str_par_set_d(par,key,type_args,args,unur_utdr_set_pdfatmode); ++ break; ++ } ++ break; ++ case 'v': ++ if ( !strcmp(key, "verify") ) { ++ /* n = 1; type = i: UNUR_PAR *parameters, int verify */ ++ result = _unur_str_par_set_i(par,key,type_args,args,unur_utdr_set_verify); ++ break; ++ } ++ } ++ break; ++ case UNUR_METH_VEMPK: ++ switch (*key) { ++ case 's': ++ if ( !strcmp(key, "smoothing") ) { ++ /* n = 1; type = d: UNUR_PAR *parameters, double smoothing */ ++ result = _unur_str_par_set_d(par,key,type_args,args,unur_vempk_set_smoothing); ++ break; ++ } ++ break; ++ case 'v': ++ if ( !strcmp(key, "varcor") ) { ++ /* n = 1; type = i: UNUR_PAR *parameters, int varcor */ ++ result = _unur_str_par_set_i(par,key,type_args,args,unur_vempk_set_varcor); ++ break; ++ } ++ } ++ break; ++ case UNUR_METH_VNROU: ++ switch (*key) { ++ case 'r': ++ if ( !strcmp(key, "r") ) { ++ /* n = 1; type = d: UNUR_PAR *parameters, double r */ ++ result = _unur_str_par_set_d(par,key,type_args,args,unur_vnrou_set_r); ++ break; ++ } ++ break; ++ case 'v': ++ if ( !strcmp(key, "v") ) { ++ /* n = 1; type = d: UNUR_PAR *parameters, double vmax */ ++ result = _unur_str_par_set_d(par,key,type_args,args,unur_vnrou_set_v); ++ break; ++ } ++ if ( !strcmp(key, "verify") ) { ++ /* n = 1; type = i: UNUR_PAR *parameters, int verify */ ++ result = _unur_str_par_set_i(par,key,type_args,args,unur_vnrou_set_verify); ++ break; ++ } ++ } ++ break; ++ } ++ ++ /* Ignored set commands: */ ++ /* int unur_mixt_set_useinversion( UNUR_PAR *parameters, int useinv ); ++ n = 1; type = i */ ++ ++ ++ /* Unsupported set commands: */ ++ /* int unur_cext_set_init( UNUR_PAR *parameters, int (*init)(UNUR_GEN *gen) ); ++ n = 1; type = I */ ++ /* int unur_cext_set_sample( UNUR_PAR *parameters, double (*sample)(UNUR_GEN *gen) ); ++ n = 1; type = D */ ++ /* int unur_dext_set_init( UNUR_PAR *parameters, int (*init)(UNUR_GEN *gen) ); ++ n = 1; type = I */ ++ /* int unur_dext_set_sample( UNUR_PAR *parameters, int (*sample)(UNUR_GEN *gen) ); ++ n = 1; type = I */ ++ /* int unur_empk_set_kernelgen( UNUR_PAR *parameters, const UNUR_GEN *kernelgen, double alpha, double kernelvar ); ++ n = 3; type = ?dd */ ++ /* int unur_gibbs_set_startingpoint( UNUR_PAR *parameters, const double *x0 ); ++ n = 1; type = D */ ++ /* int unur_hitro_set_u( UNUR_PAR *parameters, const double *umin, const double *umax ); ++ n = 2; type = DD */ ++ /* int unur_hitro_set_startingpoint( UNUR_PAR *parameters, const double *x0 ); ++ n = 1; type = D */ ++ /* int unur_mcorr_set_eigenvalues( UNUR_PAR *par, const double *eigenvalues ); ++ n = 1; type = D */ ++ /* int unur_vnrou_set_u( UNUR_PAR *parameters, double *umin, double *umax ); ++ n = 2; type = DD */ ++ ++ ++ if (result == UNUR_ERR_STR_UNKNOWN) { ++ /* no valid parameter found */ ++ /* try extra keywords */ ++ if ( !strcmp(key, "debug") ) { ++ /* n = 1; type = u: UNUR_PAR *parameters, unsigned DEBUG */ ++ result = _unur_str_par_set_u(par,key,type_args,args,unur_set_debug); ++ } ++ } ++ ++ /* check result */ ++ if (result == UNUR_ERR_STR_UNKNOWN) { ++ /* unknown parameter */ ++ _unur_error_unknown(key,"parameter for given method"); ++ return UNUR_ERR_STR_UNKNOWN; ++ } ++ else if (result != UNUR_SUCCESS) { ++ /* invalid data for parameter */ ++ _unur_error_invalid(key,"set call"); ++ return UNUR_ERR_STR_SYNTAX; ++ } ++ ++ return UNUR_SUCCESS; ++ ++} /* end of _unur_str_par_set() */ ++ ++/*---------------------------------------------------------------------------*/ +diff --git a/src/utils/unur_fp_const_source.h b/src/utils/unur_fp_const_source.h +new file mode 100644 +index 00000000..b60a13d8 +--- /dev/null ++++ b/src/utils/unur_fp_const_source.h +@@ -0,0 +1,38 @@ ++/** File automatically created by scripts/compute_machine_constants **/ ++ ++/***************************************************************************** ++ * * ++ * unuran -- Universal Non-Uniform Random number generator * ++ * * ++ *****************************************************************************/ ++ ++/*---------------------------------------------------------------------------*/ ++#ifndef UNUR_FP_CONST_SOURCE_H_SEEN ++#define UNUR_FP_CONST_SOURCE_H_SEEN ++/*---------------------------------------------------------------------------*/ ++ ++/* maximal relative error when testing equality of two doubles */ ++#define UNUR_EPSILON 2.22044604925031308084726333618e-14 ++ ++/* square root of DBL_EPSILON */ ++#define UNUR_SQRT_DBL_EPSILON 1.490116119384765625e-08 ++ ++/* log of DBL_EPSILON */ ++#define UNUR_LOG_DBL_EPSILON -36.0436533891171535515240975656 ++ ++/* the machine roundoff error */ ++#define MACHEP 1.11022302462515654042363166809e-16 ++ ++/* largest argument for exp() */ ++#define MAXLOG 709.782712893383973096206318587 ++ ++/* smallest argument for exp() without underflow */ ++#define MINLOG -708.396418532264078748994506896 ++ ++/* the maximal number that pow(x,x-0.5) has no overflow */ ++/* we use a (very) conservative portable bound */ ++#define MAXSTIR 108.116855767857671821730036754 ++ ++/*---------------------------------------------------------------------------*/ ++#endif /* UNUR_FP_CONST_SOURCE_H_SEEN */ ++/*---------------------------------------------------------------------------*/ +-- +2.34.1 diff --git a/builtins/unuran/CMakeLists.txt b/builtins/unuran/CMakeLists.txt new file mode 100644 index 0000000000000..81137d3f0b926 --- /dev/null +++ b/builtins/unuran/CMakeLists.txt @@ -0,0 +1,96 @@ +# Copyright (C) 1995-2019, Rene Brun and Fons Rademakers. +# All rights reserved. +# +# For the licensing terms see $ROOTSYS/LICENSE. +# For the list of contributors see $ROOTSYS/README/CREDITS. + +# **PLEASE UPDATE ALSO THE FOLLOWING LINE WHEN UPDATING THE VERSION** +# 20 Apr 2023, https://github.com/unuran/unuran/releases/tag/unuran-1.11.0 +set(ROOT_UNURAN_VERSION 1.11.0) +set(ROOT_UNURAN_URL "https://github.com/unuran/unuran/archive/refs/tags/unuran-${ROOT_UNURAN_VERSION}.tar.gz") # TODO Move to LCG +set(ROOT_UNURAN_HASH "e46c15eff050150966988ec56969526b60ce0b97120a7821aa96703d0f175623") +set(ROOT_UNURAN_PREFIX ${CMAKE_BINARY_DIR}/builtins/UNURAN-prefix) +set(ROOT_UNURAN_LIBRARY ${ROOT_UNURAN_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}ftgl${CMAKE_STATIC_LIBRARY_SUFFIX}) +set(ROOT_UNURAN_PATCH_FILE_1 "${CMAKE_CURRENT_SOURCE_DIR}/0001-allow-CMake-compilation.patch") +set(ROOT_UNURAN_PATCH_FILE_2 "${CMAKE_CURRENT_SOURCE_DIR}/0002-fix-missing-files.patch") +if (NOT DEFINED GIT_EXECUTABLE) + set(GIT_EXECUTABLE "git") +endif() + + +include(ExternalProject) + +# Clear cache variables set by find_package(UNURAN) +# to ensure that we use the builtin version +foreach(var UNURAN_LIBRARIES UNURAN_LIBRARY UNURAN_LIBRARY_DEBUG UNURAN_LIBRARY_RELEASE UNURAN_FOUND UNURAN_VERSION UNURAN_INCLUDE_DIR UNURAN_LIBRARY UNURAN_LIBRARIES) + unset(${var}) + unset(${var} CACHE) +endforeach() + +if(WIN32 AND NOT CMAKE_GENERATOR MATCHES Ninja) + if(winrtdebug) + set(ROOT_UNURAN_BUILD_COMMAND_FLAGS "--config Debug") + else() + set(ROOT_UNURAN_BUILD_COMMAND_FLAGS "--config $,RelWithDebInfo,Release>") + endif() +endif() + +ExternalProject_Add( + BUILTIN_UNURAN + PREFIX ${ROOT_UNURAN_PREFIX} + URL ${ROOT_UNURAN_URL} + URL_HASH SHA256=${ROOT_UNURAN_HASH} + PATCH_COMMAND ${GIT_EXECUTABLE} apply --ignore-space-change --ignore-whitespace ${ROOT_UNURAN_PATCH_FILE_1} ${ROOT_UNURAN_PATCH_FILE_2} + SOURCE_SUBDIR src + LOG_DOWNLOAD TRUE + LOG_CONFIGURE TRUE + LOG_BUILD TRUE + LOG_INSTALL TRUE + LOG_OUTPUT_ON_FAILURE TRUE + CMAKE_ARGS -G ${CMAKE_GENERATOR} + -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} + -DCMAKE_INSTALL_PREFIX= + -DCMAKE_INSTALL_LIBDIR=/lib + -DCMAKE_POSITION_INDEPENDENT_CODE=ON + -DCMAKE_C_VISIBILITY_PRESET=hidden + # -DGSL_LIBRARIES=${GSL_LIBRARIES} + BUILD_COMMAND ${CMAKE_COMMAND} --build . + INSTALL_COMMAND ${CMAKE_COMMAND} --build . --target install + BUILD_BYPRODUCTS + ${ROOT_UNURAN_LIBRARY} + TIMEOUT 600 +) + +set(ROOT_UNURAN_INCLUDE_DIR ${ROOT_UNURAN_PREFIX}/include) +file(MAKE_DIRECTORY ${ROOT_UNURAN_INCLUDE_DIR}) +add_library(Unuran::unuran IMPORTED STATIC GLOBAL) +add_dependencies(Unuran::unuran BUILTIN_UNURAN) +target_compile_definitions(Unuran::unuran INTERFACE HAVE_CONFIG_H) +set_target_properties(Unuran::unuran PROPERTIES + IMPORTED_LOCATION ${ROOT_UNURAN_LIBRARY} + INTERFACE_INCLUDE_DIRECTORIES ${ROOT_UNURAN_INCLUDE_DIR}) + +# Set the canonical output of find_package according to +# https://cmake.org/cmake/help/latest/manual/cmake-developer.7.html#standard-variable-names +set(Unuran_INCLUDE_DIRS ${ROOT_UNURAN_INCLUDE_DIR} PARENT_SCOPE) +set(Unuran_LIBRARIES ${ROOT_UNURAN_LIBRARY} PARENT_SCOPE) +set(Unuran_FOUND TRUE PARENT_SCOPE) +set(Unuran_VERSION ${ROOT_UNURAN_VERSION} PARENT_SCOPE) + +# For compatibility with non-standard case FindUnuran.cmake +set(UNURAN_INCLUDE_DIRS ${ROOT_UNURAN_INCLUDE_DIR} PARENT_SCOPE) +set(UNURAN_LIBRARIES ${ROOT_UNURAN_LIBRARY} PARENT_SCOPE) +set(UNURAN_FOUND TRUE PARENT_SCOPE) +set(UNURAN_VERSION ${ROOT_UNURAN_VERSION} PARENT_SCOPE) + +##---We need to disable some warnings------------------------------------------------------------------- +#string(REPLACE -Wall "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") +#if(${CMAKE_CXX_COMPILER_ID} MATCHES Clang) +# ROOT_ADD_C_FLAG(CMAKE_C_FLAGS -Wno-parentheses-equality) +# ROOT_ADD_C_FLAG(CMAKE_C_FLAGS -Wno-deprecated-non-prototype) +#endif() +#if(${CMAKE_CXX_COMPILER_ID} MATCHES GNU) +# ROOT_ADD_C_FLAG(CMAKE_C_FLAGS -Wno-maybe-uninitialized) +# ROOT_ADD_C_FLAG(CMAKE_C_FLAGS -Wno-alloc-size-larger-than) +# +#endif() diff --git a/cmake/modules/FindUnuran.cmake b/cmake/modules/FindUnuran.cmake index 1011616c61807..fddb4526b94a4 100644 --- a/cmake/modules/FindUnuran.cmake +++ b/cmake/modules/FindUnuran.cmake @@ -27,3 +27,10 @@ INCLUDE(FindPackageHandleStandardArgs) FIND_PACKAGE_HANDLE_STANDARD_ARGS(Unuran DEFAULT_MSG UNURAN_LIBRARY UNURAN_INCLUDE_DIR) mark_as_advanced(UNURAN_FOUND UNURAN_INCLUDE_DIR UNURAN_LIBRARY) + +if(UNURAN_FOUND AND NOT TARGET Unuran::unuran) + add_library(Unuran::unuran UNKNOWN IMPORTED) + set_target_properties(Unuran::unuran PROPERTIES + IMPORTED_LOCATION "${UNURAN_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${UNURAN_INCLUDE_DIR}") +endif() diff --git a/cmake/modules/SearchInstalledSoftware.cmake b/cmake/modules/SearchInstalledSoftware.cmake index ec812855ad905..865546635e2e5 100644 --- a/cmake/modules/SearchInstalledSoftware.cmake +++ b/cmake/modules/SearchInstalledSoftware.cmake @@ -243,6 +243,10 @@ if(unuran AND NOT builtin_unuran) endif() endif() endif() +if (builtin_unuran) + list(APPEND ROOT_BUILTINS BUILTIN_UNURAN) + add_subdirectory(builtins/unuran) +endif() #---Check for Freetype--------------------------------------------------------------- ROOT_FIND_REQUIRED_DEP(Freetype builtin_freetype) # needed for asimage, but also outside of it (for "graf" target) diff --git a/math/unuran/CMakeLists.txt b/math/unuran/CMakeLists.txt index 1fd1c742a71b3..2fe2ff0877ceb 100644 --- a/math/unuran/CMakeLists.txt +++ b/math/unuran/CMakeLists.txt @@ -5,85 +5,9 @@ # For the list of contributors see $ROOTSYS/README/CREDITS. ############################################################################ -# CMakeLists.txt file for building ROOT math/unurun package +# CMakeLists.txt file for building ROOT math/unuran package ############################################################################ -#---Define package related variables----------------------------------------------------------------- - -if(builtin_unuran) - -set(UNR_SRCDIR ${CMAKE_CURRENT_SOURCE_DIR}/src) -set(UNR_VERSION "1.11.0") -set(UNR_TARNAME "unuran-${UNR_VERSION}") -set(UNR_TARGZFILE ${UNR_SRCDIR}/${UNR_TARNAME}.tar.gz) -set(UNR_TARFILE ${UNR_SRCDIR}/${UNR_TARNAME}.tar) -set(UNR_UNTARDIR ${CMAKE_CURRENT_BINARY_DIR}/${UNR_TARNAME}) - -#---Untar sources at configuration/generation time (needed for listing sources) -if(NOT EXISTS ${UNR_UNTARDIR}) - execute_process( COMMAND ${CMAKE_COMMAND} -E tar xzf ${UNR_TARGZFILE} - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) -endif() - -if(WIN32) - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.win.in ${UNR_UNTARDIR}/config.h) -else() - #---Define special compiler settings for unurun----------------------------------------------------- - set(UNR_CC ${CMAKE_C_COMPILER}) - if(ROOT_ARCHITECTURE MATCHES hpuxia64acc) - set(UNR_CC "${UNR_CC} +DD64 -Ae") - elseif(ROOT_ARCHITECTURE MATCHES linuxppc64gcc) - set(UNR_CC "${UNR_CC} -m64 -fPIC") - elseif(ROOT_ARCHITECTURE MATCHES linuxx8664gcc) - set(UNR_CFLAGS "-m64 -fPIC") - elseif(ROOT_ARCHITECTURE MATCHES linuxicc) - set(UNR_CFLAGS "-m32") - elseif(ROOT_ARCHITECTURE MATCHES linuxx8664icc) - set(UNR_CFLAGS "-m64") - elseif(ROOT_ARCHITECTURE MATCHES win32 OR ROOT_ARCHITECTURE MATCHES win64) - set(UNR_CFLAGS "-MD -G5 -GX") - endif() - if(CMAKE_OSX_SYSROOT) - set(UNR_CFLAGS "${UNR_CFLAGS} -isysroot ${CMAKE_OSX_SYSROOT}") - endif() - - #---configure unuran (required for creating the config.h used by unuran source files)---------------- - add_custom_command(OUTPUT ${UNR_UNTARDIR}/config.h - COMMAND GNUMAKE=make ./configure CC=${UNR_CC} CFLAGS=${UNR_CFLAGS} > /dev/null 2>& 1 - WORKING_DIRECTORY ${UNR_UNTARDIR}) -endif() - -#---We need to disable some warnings------------------------------------------------------------------- -string(REPLACE -Wall "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") -if(${CMAKE_CXX_COMPILER_ID} MATCHES Clang) - ROOT_ADD_C_FLAG(CMAKE_C_FLAGS -Wno-parentheses-equality) - ROOT_ADD_C_FLAG(CMAKE_C_FLAGS -Wno-deprecated-non-prototype) -endif() -if(${CMAKE_CXX_COMPILER_ID} MATCHES GNU) - ROOT_ADD_C_FLAG(CMAKE_C_FLAGS -Wno-maybe-uninitialized) - ROOT_ADD_C_FLAG(CMAKE_C_FLAGS -Wno-alloc-size-larger-than) - -endif() - -set(unrsources ${UNR_UNTARDIR}/src/utils/*.c - ${UNR_UNTARDIR}/src/methods/*.c - ${UNR_UNTARDIR}/src/specfunct/*.c - ${UNR_UNTARDIR}/src/distr/*.c - ${UNR_UNTARDIR}/src/distributions/*.c - ${UNR_UNTARDIR}/src/parser/*.c - ${UNR_UNTARDIR}/src/tests/*.c - ${UNR_UNTARDIR}/src/uniform/*.c - ${UNR_UNTARDIR}/src/urng/*.c ) -set(unrconfig ${UNR_UNTARDIR}/config.h) - -else() - -set(unrsources) -set(unrconfig) - -endif(builtin_unuran) - - ROOT_STANDARD_LIBRARY_PACKAGE(Unuran HEADERS TUnuran.h @@ -100,21 +24,12 @@ ROOT_STANDARD_LIBRARY_PACKAGE(Unuran src/TUnuranEmpDist.cxx src/TUnuranMultiContDist.cxx src/TUnuranSampler.cxx - ${unrconfig} - ${unrsources} LIBRARIES - ${UNURAN_LIBRARIES} + Unuran::unuran DEPENDENCIES Core Hist MathCore ) -if(builtin_unuran) - target_include_directories(Unuran SYSTEM BEFORE PRIVATE ${UNR_UNTARDIR} ${UNR_UNTARDIR}/src ${UNR_UNTARDIR}/src/utils) - target_compile_definitions(Unuran PRIVATE HAVE_CONFIG_H) -else() - target_include_directories(Unuran SYSTEM PRIVATE ${UNURAN_INCLUDE_DIRS}) -endif() - ROOT_ADD_TEST_SUBDIRECTORY(test) diff --git a/math/unuran/config.h.win.in b/math/unuran/config.h.win.in deleted file mode 100644 index 6db927ee07db4..0000000000000 --- a/math/unuran/config.h.win.in +++ /dev/null @@ -1,230 +0,0 @@ -/* config.h.win transformed into input to CMake configure_file() command */ -/* config.h. Generated from config.h.in by configure. */ -/* config.h.in. Generated from configure.ac by autoheader. */ - -/* Define to 1 if you have the `alarm' function. */ -/* #undef HAVE_ALARM */ - -/* Define to 1 if you have the declaration of `alarm', and to 0 if you don't. - */ -#define HAVE_DECL_ALARM 0 - -/* Define to 1 if you have the declaration of `getopt', and to 0 if you don't. - */ -#define HAVE_DECL_GETOPT 0 - -/* Define to 1 if you have the declaration of `HUGE_VAL', and to 0 if you - don't. */ -#define HAVE_DECL_HUGE_VAL 1 - -/* Define to 1 if you have the declaration of `INFINITY', and to 0 if you - don't. */ -#define HAVE_DECL_INFINITY 0 - -/* Define to 1 if you have the declaration of `isfinite', and to 0 if you - don't. */ -#define HAVE_DECL_ISFINITE 0 - -/* Define to 1 if you have the declaration of `isinf', and to 0 if you don't. - */ -#define HAVE_DECL_ISINF 0 - -/* Define to 1 if you have the declaration of `isnan', and to 0 if you don't. - */ -#define HAVE_DECL_ISNAN 0 - -/* Define to 1 if you have the declaration of `log1p', and to 0 if you don't. - */ -#define HAVE_DECL_LOG1P 0 - -/* Define to 1 if you have the declaration of `signal', and to 0 if you don't. - */ -#define HAVE_DECL_SIGNAL 1 - -/* Define to 1 if you have the declaration of `snprintf', and to 0 if you - don't. */ -#define HAVE_DECL_SNPRINTF 1 - -/* Define to 1 if you have the declaration of `vsnprintf', and to 0 if you - don't. */ -#define HAVE_DECL_VSNPRINTF 1 - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_DLFCN_H */ - -/* Define to 1 if you have the header file. */ -#define HAVE_FLOAT_H 1 - -/* Define to 1 if you have the `floor' function. */ -#define HAVE_FLOOR 1 - -/* Define to 1 if you have the `gettimeofday' function. */ -/* #undef HAVE_GETTIMEOFDAY */ - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_GSL_GSL_RNG_H */ - -/* Define to 1 if "x != x" is true for NaNs */ -#define HAVE_IEEE_COMPARISONS 1 - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_INTTYPES_H */ - -/* Define to 1 if you have the `gsl' library (-lgsl). */ -/* #undef HAVE_LIBGSL */ - -/* Define to 1 if you have the `m' library (-lm). */ -#define HAVE_LIBM 1 - -/* Define to 1 if you have the `prng' library (-lprng). */ -/* #undef HAVE_LIBPRNG */ - -/* Define to 1 if you have the `Rmath' library (-lRmath). */ -/* #undef HAVE_LIBRMATH */ - -/* Define to 1 if you have the `rngstreams' library (-lrngstreams). */ -/* #undef HAVE_LIBRNGSTREAMS */ - -/* Define to 1 if you have the header file. */ -#define HAVE_LIMITS_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_MEMORY_H 1 - -/* Define to 1 if you have the `pow' function. */ -#define HAVE_POW 1 - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_PRNG_H */ - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_RNGSTREAM_H */ - -/* Define to 1 if you have the `signal' function. */ -#define HAVE_SIGNAL 1 - -/* Define to 1 if you have the `sqrt' function. */ -#define HAVE_SQRT 1 - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_STDINT_H */ - -/* Define to 1 if you have the header file. */ -#define HAVE_STDLIB_H 1 - -/* Define to 1 if you have the `strcasecmp' function. */ -/* #undef HAVE_STRCASECMP */ - -/* Define to 1 if you have the `strchr' function. */ -#define HAVE_STRCHR 1 - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_STRINGS_H */ - -/* Define to 1 if you have the header file. */ -#define HAVE_STRING_H 1 - -/* Define to 1 if you have the `strtol' function. */ -#define HAVE_STRTOL 1 - -/* Define to 1 if you have the `strtoul' function. */ -#define HAVE_STRTOUL 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_STAT_H 1 - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_SYS_TIME_H */ - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_TYPES_H 1 - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_UNISTD_H */ - -/* Define to the sub-directory in which libtool stores uninstalled libraries. - */ -#define LT_OBJDIR ".libs/" - -/* Name of package */ -#define PACKAGE "unuran" - -/* Define to the address where bug reports for this package should be sent. */ -#define PACKAGE_BUGREPORT "unuran@statmath.wu.ac.at" - -/* Define to the full name of this package. */ -#define PACKAGE_NAME "unuran" - -/* Define to the full name and version of this package. */ -#define PACKAGE_STRING "unuran @UNR_VERSION@" - -/* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "@UNR_TARNAME@" - -/* Define to the home page for this package. */ -#define PACKAGE_URL "" - -/* Define to the version of this package. */ -#define PACKAGE_VERSION "@UNR_VERSION@" - -/* Define to 1 if you have the ANSI C header files. */ -#define STDC_HEADERS 1 - -/* Define to 1 if you can safely include both and . */ -/* #undef TIME_WITH_SYS_TIME */ - -/* Define to 1 if you use random number generators from GNU Scientific - Library. */ -/* #undef UNURAN_HAS_GSL */ - -/* Define to 1 if you use Otmar Lendl's PRNG library. */ -/* #undef UNURAN_HAS_PRNG */ - -/* Define to 1 if you use Pierre L'Ecuyer's RNGSTREAM library. */ -/* #undef UNURAN_HAS_RNGSTREAM */ - -/* Define to 1 if you want to use magic cookies to validate type of a pointer - */ -/* #undef UNUR_COOKIES */ - -/* Define to 1 if you want to perform additional checks against an invalid - NULL pointer */ -/* #undef UNUR_ENABLE_CHECKNULL */ - -/* Define to 1 if you want to use the info routine for printing information - about UNU.RAN objects */ -#define UNUR_ENABLE_INFO 1 - -/* Define to 1 if you want to use a logfile for logging information about - UNU.RAN objects */ -/* #undef UNUR_ENABLE_LOGGING */ - -/* Define to 1 if you use RNGSTREAM as global URNG. */ -/* #undef UNUR_URNG_DEFAULT_RNGSTREAM */ - -/* Define to 1 if you want to use deprecated code. */ -/* #undef USE_DEPRECATED_CODE */ - -/* Define to 1 if you want to use experimental code */ -/* #undef USE_EXPERIMENTAL_CODE */ - -/* Version number of package */ -#define VERSION "@UNR_VERSION@" - -/* Define to empty if `const' does not conform to ANSI C. */ -/* #undef const */ - -/* Define to `__inline__' or `__inline' if that's what the C compiler - calls it, or to nothing if 'inline' is not supported under any name. */ -#ifndef __cplusplus -#define inline __inline -#endif - -/* Define to `unsigned int' if does not define. */ -/* #undef size_t */ - -/* Substitute UNU.RAN functions for missing system functions */ - -#if !HAVE_DECL_LOG1P -#define log1p _unur_log1p -#endif diff --git a/math/unuran/src/unuran-1.11.0.tar.gz b/math/unuran/src/unuran-1.11.0.tar.gz deleted file mode 100644 index 891ccc0858210..0000000000000 Binary files a/math/unuran/src/unuran-1.11.0.tar.gz and /dev/null differ