==10442== Memcheck, a memory error detector ==10442== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. ==10442== Using Valgrind-3.15.0 and LibVEX; rerun with -h for copyright info ==10442== Command: /data/blackswan/ripley/R/R-devel-vg/bin/exec/R --vanilla ==10442== R Under development (unstable) (2020-01-11 r77654) -- "Unsuffered Consequences" Copyright (C) 2020 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. Natural language support but running in an English locale 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. > pkgname <- "GPB" > source(file.path(R.home("share"), "R", "examples-header.R")) > options(warn = 1) > library('GPB') > > base::assign(".oldSearch", base::search(), pos = 'CheckExEnv') > base::assign(".old_wd", base::getwd(), pos = 'CheckExEnv') > cleanEx() > nameEx("GPB-package") > ### * GPB-package > > flush(stderr()); flush(stdout()) > > ### Name: GPB-package > ### Title: Generalized Poisson Binomial Distribution > ### Aliases: GPB-package GPB > ### Keywords: package > > ### ** Examples > > pgpb(kk=0:11, pp=c(.1, .2, .3), aval=c(1,0,0), bval=c(2,3,1), wts=c(1,2,2)) ==10442== Invalid read of size 8 ==10442== at 0x48A251C: gpb_dft_cf (packages/tests-vg/GPB/src/dftcf.c:886) ==10442== by 0x49DEF7: do_dotCode (svn/R-devel/src/main/dotcode.c:1826) ==10442== by 0x4D181C: bcEval (svn/R-devel/src/main/eval.c:7054) ==10442== by 0x4E8197: Rf_eval (svn/R-devel/src/main/eval.c:688) ==10442== by 0x4E9D56: R_execClosure (svn/R-devel/src/main/eval.c:1853) ==10442== by 0x4EAB33: Rf_applyClosure (svn/R-devel/src/main/eval.c:1779) ==10442== by 0x4E8363: Rf_eval (svn/R-devel/src/main/eval.c:811) ==10442== by 0x517C8C: Rf_ReplIteration (svn/R-devel/src/main/main.c:264) ==10442== by 0x517C8C: Rf_ReplIteration (svn/R-devel/src/main/main.c:200) ==10442== by 0x517FC7: R_ReplConsole (svn/R-devel/src/main/main.c:314) ==10442== by 0x518054: run_Rmainloop (svn/R-devel/src/main/main.c:1113) ==10442== by 0x417717: main (svn/R-devel/src/main/Rmain.c:29) ==10442== Address 0x10931f38 is 5,416 bytes inside a block of size 7,960 alloc'd ==10442== at 0x483880B: malloc (/builddir/build/BUILD/valgrind-3.15.0/coregrind/m_replacemalloc/vg_replace_malloc.c:309) ==10442== by 0x5223E0: GetNewPage (svn/R-devel/src/main/memory.c:946) ==10442== by 0x52418B: Rf_allocVector3 (svn/R-devel/src/main/memory.c:2784) ==10442== by 0x57D340: Rf_allocVector (svn/R-devel/src/include/Rinlinedfuns.h:593) ==10442== by 0x57D340: ReadItem (svn/R-devel/src/main/serialize.c:1925) ==10442== by 0x57E239: ReadBCConsts (svn/R-devel/src/main/serialize.c:2094) ==10442== by 0x57E239: ReadBC1 (svn/R-devel/src/main/serialize.c:2111) ==10442== by 0x57CF5C: ReadBC (svn/R-devel/src/main/serialize.c:2122) ==10442== by 0x57CF5C: ReadItem (svn/R-devel/src/main/serialize.c:1959) ==10442== by 0x57C9F2: ReadItem (svn/R-devel/src/main/serialize.c:1867) ==10442== by 0x57C9D5: ReadItem (svn/R-devel/src/main/serialize.c:1865) ==10442== by 0x57C9F2: ReadItem (svn/R-devel/src/main/serialize.c:1867) ==10442== by 0x57C9F2: ReadItem (svn/R-devel/src/main/serialize.c:1867) ==10442== by 0x57C9F2: ReadItem (svn/R-devel/src/main/serialize.c:1867) ==10442== by 0x57C9F2: ReadItem (svn/R-devel/src/main/serialize.c:1867) ==10442== [1] 0.00000 0.28224 0.55552 0.63424 0.78112 0.91776 0.95712 0.97764 0.99472 [10] 0.99964 1.00000 1.00000 > dgpb(kk=0:11, pp=c(.1, .2, .3), aval=c(1,0,0), bval=c(2,3,1), wts=c(1,2,2)) ==10442== Invalid read of size 8 ==10442== at 0x48A2344: gpb_dft_cf (packages/tests-vg/GPB/src/dftcf.c:906) ==10442== by 0x49DEF7: do_dotCode (svn/R-devel/src/main/dotcode.c:1826) ==10442== by 0x4D181C: bcEval (svn/R-devel/src/main/eval.c:7054) ==10442== by 0x4E8197: Rf_eval (svn/R-devel/src/main/eval.c:688) ==10442== by 0x4E9D56: R_execClosure (svn/R-devel/src/main/eval.c:1853) ==10442== by 0x4EAB33: Rf_applyClosure (svn/R-devel/src/main/eval.c:1779) ==10442== by 0x4E8363: Rf_eval (svn/R-devel/src/main/eval.c:811) ==10442== by 0x517C8C: Rf_ReplIteration (svn/R-devel/src/main/main.c:264) ==10442== by 0x517C8C: Rf_ReplIteration (svn/R-devel/src/main/main.c:200) ==10442== by 0x517FC7: R_ReplConsole (svn/R-devel/src/main/main.c:314) ==10442== by 0x518054: run_Rmainloop (svn/R-devel/src/main/main.c:1113) ==10442== by 0x417717: main (svn/R-devel/src/main/Rmain.c:29) ==10442== Address 0x10924988 is 3,656 bytes inside a block of size 7,960 alloc'd ==10442== at 0x483880B: malloc (/builddir/build/BUILD/valgrind-3.15.0/coregrind/m_replacemalloc/vg_replace_malloc.c:309) ==10442== by 0x5223E0: GetNewPage (svn/R-devel/src/main/memory.c:946) ==10442== by 0x52418B: Rf_allocVector3 (svn/R-devel/src/main/memory.c:2784) ==10442== by 0x57D340: Rf_allocVector (svn/R-devel/src/include/Rinlinedfuns.h:593) ==10442== by 0x57D340: ReadItem (svn/R-devel/src/main/serialize.c:1925) ==10442== by 0x57E239: ReadBCConsts (svn/R-devel/src/main/serialize.c:2094) ==10442== by 0x57E239: ReadBC1 (svn/R-devel/src/main/serialize.c:2111) ==10442== by 0x57CF5C: ReadBC (svn/R-devel/src/main/serialize.c:2122) ==10442== by 0x57CF5C: ReadItem (svn/R-devel/src/main/serialize.c:1959) ==10442== by 0x57C9F2: ReadItem (svn/R-devel/src/main/serialize.c:1867) ==10442== by 0x57C9D5: ReadItem (svn/R-devel/src/main/serialize.c:1865) ==10442== by 0x57C9F2: ReadItem (svn/R-devel/src/main/serialize.c:1867) ==10442== by 0x57C9F2: ReadItem (svn/R-devel/src/main/serialize.c:1867) ==10442== by 0x57C9F2: ReadItem (svn/R-devel/src/main/serialize.c:1867) ==10442== by 0x57C9F2: ReadItem (svn/R-devel/src/main/serialize.c:1867) ==10442== [1] 0.00000 0.28224 0.27328 0.07872 0.14688 0.13664 0.03936 0.02052 0.01708 [10] 0.00492 0.00036 0.00000 > qgpb(qq=c(.1,.3), pp=c(.1, .2, .3), aval=c(1,0,0), bval=c(2,3,1), wts=c(1,2,2)) [1] 1 2 > rgpb(m=3, pp=c(.1, .2, .3), aval=c(1,0,0), bval=c(2,3,1), wts=c(1,2,2)) [1] 1 2 3 > > > > > cleanEx() > nameEx("pgpb") > ### * pgpb > > flush(stderr()); flush(stdout()) > > ### Name: pgpb > ### Title: Generalized Poisson Binomial Distribution > ### Aliases: pgpb dgpb qgpb rgpb gpb.args.check > > ### ** Examples > > > pgpb(kk=0:11, pp=c(.1, .2, .3), aval=c(1,0,0), bval=c(2,3,1), wts=c(1,2,2)) [1] 0.00000 0.28224 0.55552 0.63424 0.78112 0.91776 0.95712 0.97764 0.99472 [10] 0.99964 1.00000 1.00000 > dgpb(kk=0:11, pp=c(.1, .2, .3), aval=c(1,0,0), bval=c(2,3,1), wts=c(1,2,2)) [1] 0.00000 0.28224 0.27328 0.07872 0.14688 0.13664 0.03936 0.02052 0.01708 [10] 0.00492 0.00036 0.00000 > qgpb(qq=c(.1,.3), pp=c(.1, .2, .3), aval=c(1,0,0), bval=c(2,3,1), wts=c(1,2,2)) [1] 1 2 > rgpb(m=3, pp=c(.1, .2, .3), aval=c(1,0,0), bval=c(2,3,1), wts=c(1,2,2)) [1] 1 2 3 > > ## when a, b share large common dividers, the results of following cases is the same > pgpb(kk=c(60,70,80,90), pp=c(.1, .2, .3), aval=c(10,20,30), bval=c(20,30,40), wts=c(1,1,1)) [1] 0.504 0.902 0.994 1.000 > pgpb(kk=6:9, pp=c(.1, .2, .3), aval=c(1,2,3), bval=c(2,3,4), wts=c(1,1,1)) [1] 0.504 0.902 0.994 1.000 > > ## when a, b are non-integer values, the values of kk, aval, bval can multiply powers of 10 > aval=c(0.1,0.2,0.3)*10 > bval=c(0.2,0.3,0.4)*10 > kk=(0.6*10):(1.0*10) > pgpb(kk=kk, pp=c(.1, .2, .3), aval=aval, bval=bval, wts=c(1,1,1)) [1] 0.504 0.902 0.994 1.000 1.000 > > > > > ### *