==28097== Memcheck, a memory error detector ==28097== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. ==28097== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info ==28097== Command: /data/blackswan/ripley/R/R-devel-vg/bin/exec/R -f vegas.R --restore --save --no-readline --vanilla ==28097== R Under development (unstable) (2018-07-01 r74950) -- "Unsuffered Consequences" Copyright (C) 2018 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > #dyn.load("../src/R2Cuba.so");source("../R/vegas.R"); source("../R/commoncuba.R") > library("R2Cuba") > > # DEMO EXAMPLES > # +++++++++++++++++++++++++++++++ > integrand <- function(arg, weight) { + + x <- arg[1] + y <- arg[2] + z <- arg[3] + # print( weight) + ff <- sin(x)*cos(y)*exp(z); + return(ff) + } # fin integrand > # ---------------------------------------- > > NDIM <- 3 > NCOMP <- 1 > EPSREL <- 1e-3 > EPSABS <- 1e-12 > VERBOSE <- 0 > > vegas(NDIM, NCOMP, integrand, + rel.tol=EPSREL, abs.tol=EPSABS, + flags=list(verbose=VERBOSE)) integral: 0.6648107 (+-0.00049) number of evaluations: 10000; probability: 0.08870493 > # ---------------------------------------- > # Essai avec ... > integrandp <- function(arg, weight, ...) { + + x <- arg[1] + y <- arg[2] + z <- arg[3] + # print( weight, ...) + ff <- sin(x)*cos(y)*exp(z); + return(ff) + } # fin integrandp > vegas(NDIM, NCOMP, integrandp, digits=1, + rel.tol=EPSREL, abs.tol=EPSABS, + flags=list(verbose=0)) integral: 0.6648107 (+-0.00049) number of evaluations: 10000; probability: 0.08870493 > # ---------------------------------------- > # Essai avec state > vegas(NDIM, NCOMP, integrand, + rel.tol=1e-50, abs.tol=1e-50, + flags=list(verbose=VERBOSE), state.file="toto") ==28097== Syscall param write(buf) points to uninitialised byte(s) ==28097== at 0x730B280: __write_nocancel (in /usr/lib64/libpthread-2.25.so) ==28097== by 0x1529ECD9: vegasIntegrate (packages/tests-vg/R2Cuba/src/vegas_Integrate.c:244) ==28097== by 0x1529F6D2: Vegas (packages/tests-vg/R2Cuba/src/vegas_Vegas.c:103) ==28097== by 0x49C055: do_dotCode (svn/R-devel/src/main/dotcode.c:1852) ==28097== by 0x4CC357: bcEval (svn/R-devel/src/main/eval.c:6785) ==28097== by 0x4DA76F: Rf_eval (svn/R-devel/src/main/eval.c:624) ==28097== by 0x4DC09E: R_execClosure (svn/R-devel/src/main/eval.c:1777) ==28097== by 0x4DA8FC: Rf_eval (svn/R-devel/src/main/eval.c:747) ==28097== by 0x50620C: Rf_ReplIteration (svn/R-devel/src/main/main.c:258) ==28097== by 0x5065E7: R_ReplConsole (svn/R-devel/src/main/main.c:308) ==28097== by 0x5076A4: run_Rmainloop (svn/R-devel/src/main/main.c:1082) ==28097== by 0x41AA77: main (svn/R-devel/src/main/Rmain.c:29) ==28097== Address 0x1ffeff248c is on thread 1's stack ==28097== in frame #1, created by vegasIntegrate (vegas_Integrate.c:42) ==28097== Uninitialised value was created by a stack allocation ==28097== at 0x1529E355: vegasIntegrate (packages/tests-vg/R2Cuba/src/vegas_Integrate.c:42) ==28097== integral: 0.6647079 (+-0.00015) number of evaluations: 52000; probability: 0.0120485 failed with message 'Dimension out of range' > > vegas(NDIM, NCOMP, integrand, + rel.tol=EPSREL, abs.tol=EPSABS, + flags=list(verbose=VERBOSE), state.file="toto") integral: 0.6646798 (+-0.00014) number of evaluations: 59500; probability: 0.01606268 > > # ---------------------------------------- > # Essai avec mersenne > vegas(NDIM, NCOMP, integrand, + rel.tol=EPSREL, abs.tol=EPSABS, + flags=list(verbose=0, pseudo.random=1, mersenne.seed=10)) integral: 0.6640216 (+-0.00065) number of evaluations: 13500; probability: 0.07234709 > > # ---------------------------------------- > # Essai avec nbatch > vegas(NDIM, NCOMP, integrand, + rel.tol=EPSREL, abs.tol=EPSABS, + flags=list(verbose=0, vegas.nbatch=500)) integral: 0.6648107 (+-0.00049) number of evaluations: 10000; probability: 0.08870493 > # ---------------------------------------- > # Essai avec gridno > #dyn.load("../src/cuba.so");source("../R/vegas.R"); source("../R/commoncuba.R") > vegas(NDIM, NCOMP, integrand, + rel.tol=EPSREL, abs.tol=EPSABS, + flags=list(verbose=3, pseudo.random=1, mersenne.seed=10, + vegas.gridno=4)) Vegas input parameters: ndim 3 ncomp 1 rel.tol 0.001 abs.tol 1e-12 smooth 0 pseudo.random 1 final 0 verbose 3 min.eval 0 max.eval 50000 nstart 1000 nincrease 500 vegas.gridno 0 vegas.state "" Iteration 1: 1000 integrand evaluations so far [1] 0.666187 +- 0.014126 chisq 0 (0 df) Iteration 2: 2500 integrand evaluations so far [1] 0.663884 +- 0.0048976 chisq 0.0302145 (1 df) Iteration 3: 4500 integrand evaluations so far [1] 0.6631 +- 0.00224811 chisq 0.0626448 (2 df) Iteration 4: 7000 integrand evaluations so far [1] 0.662786 +- 0.00127313 chisq 0.0914002 (3 df) Iteration 5: 10000 integrand evaluations so far [1] 0.663624 +- 0.000891107 chisq 0.942088 (4 df) Iteration 6: 13500 integrand evaluations so far [1] 0.664022 +- 0.000651656 chisq 1.3692 (5 df) integral: 0.6640216 (+-0.00065) number of evaluations: 13500; probability: 0.07234709 > vegas(NDIM, NCOMP, integrand, + rel.tol=EPSREL, abs.tol=EPSABS, + flags=list(verbose=0, pseudo.random=1, mersenne.seed=10, + vegas.gridno=4)) integral: 0.6640216 (+-0.00065) number of evaluations: 13500; probability: 0.07234709 > vegas(NDIM, NCOMP, integrand, + rel.tol=EPSREL, abs.tol=EPSABS, + flags=list(verbose=0, pseudo.random=1, mersenne.seed=10, + vegas.gridno=-4)) integral: 0.6640216 (+-0.00065) number of evaluations: 13500; probability: 0.07234709 > > proc.time() user system elapsed 45.082 0.299 44.315 ==28097== ==28097== HEAP SUMMARY: ==28097== in use at exit: 53,860,590 bytes in 9,747 blocks ==28097== total heap usage: 24,623 allocs, 14,876 frees, 83,234,696 bytes allocated ==28097== ==28097== LEAK SUMMARY: ==28097== definitely lost: 0 bytes in 0 blocks ==28097== indirectly lost: 0 bytes in 0 blocks ==28097== possibly lost: 0 bytes in 0 blocks ==28097== still reachable: 53,860,590 bytes in 9,747 blocks ==28097== suppressed: 0 bytes in 0 blocks ==28097== Reachable blocks (those to which a pointer was found) are not shown. ==28097== To see them, rerun with: --leak-check=full --show-leak-kinds=all ==28097== ==28097== For counts of detected and suppressed errors, rerun with: -v ==28097== ERROR SUMMARY: 13 errors from 1 contexts (suppressed: 0 from 0)