==570931== Memcheck, a memory error detector ==570931== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. ==570931== Using Valgrind-3.16.1 and LibVEX; rerun with -h for copyright info ==570931== Command: /data/blackswan/ripley/R/R-devel-vg/bin/exec/R --vanilla ==570931== R Under development (unstable) (2021-04-15 r80174) -- "Unsuffered Consequences" Copyright (C) 2021 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 <- "tmg" > source(file.path(R.home("share"), "R", "examples-header.R")) > options(warn = 1) > library('tmg') > > base::assign(".oldSearch", base::search(), pos = 'CheckExEnv') > base::assign(".old_wd", base::getwd(), pos = 'CheckExEnv') > cleanEx() > nameEx("rtmg") > ### * rtmg > > flush(stderr()); flush(stdout()) > > ### Name: rtmg > ### Title: Sample from truncated multivariate Gaussians > ### Aliases: rtmg > ### Keywords: distribution > > ### ** Examples > > # Set number of samples > n=15000; > > #Define precision matrix and linear term > M = matrix(c(.5,-.4, -.4,.5), 2,2) > r = c(0,0) > > # Set initial point for the Markov chain > initial = c(4,1) > > # Define two linear constraints > f = diag(2) > f[1,2] = 1 > g = c(0,0) > > # Define two quadratic constraints > A1 = matrix(c(-1/8,0,0,-1/2),2,2) > B1 = c(.5,.5) > C1 = 3/4 > constr1 = list(A1,B1,C1) > > A2 = matrix(c(4,-1,-1,8),2,2) > B2 = c(0,5) > C2 = -1 > constr2 = list(A2,B2,C2) > > q = list(constr1,constr2) > > # Sample and plot > samples = rtmg(n, M, r, initial, f,g, q); ==570931== Use of uninitialised value of size 8 ==570931== at 0x48BE1DE: magnet::math::ferrariQuarticSolve(double const&, double const&, double const&, double const&, double&, double&, double&, double&) (packages/tests-vg/tmg/src/../inst/include/magnet/math/quartic_ferrari.hpp:159) ==570931== by 0x48BF01D: magnet::math::quarticSolve(double const&, double const&, double const&, double const&, double&, double&, double&, double&) (packages/tests-vg/tmg/src/../inst/include/magnet/math/quartic.hpp:92) ==570931== by 0x48BA3ED: HmcSampler::_getNextQuadraticHitTime(Eigen::Matrix const&, Eigen::Matrix const&, double&, int&, bool) (packages/tests-vg/tmg/src/HmcSampler.cpp:221) ==570931== by 0x48BAA4C: HmcSampler::sampleNext(bool) (packages/tests-vg/tmg/src/HmcSampler.cpp:72) ==570931== by 0x48C172D: rtmg (packages/tests-vg/tmg/src/rtmg.cpp:60) ==570931== by 0x49D2A1: R_doDotCall (svn/R-devel/src/main/dotcode.c:624) ==570931== by 0x49D823: do_dotcall (svn/R-devel/src/main/dotcode.c:1281) ==570931== by 0x4D3726: bcEval (svn/R-devel/src/main/eval.c:7115) ==570931== by 0x4F0237: Rf_eval (svn/R-devel/src/main/eval.c:727) ==570931== by 0x4F1C4D: R_execClosure (svn/R-devel/src/main/eval.c:1897) ==570931== by 0x4F2943: Rf_applyClosure (svn/R-devel/src/main/eval.c:1823) ==570931== by 0x4F0403: Rf_eval (svn/R-devel/src/main/eval.c:850) ==570931== Uninitialised value was created by a stack allocation ==570931== at 0x48B7700: ??? (in /data/blackswan/ripley/R/packages/tests-vg/tmg.Rcheck/tmg/libs/tmg.so) ==570931== ==570931== Conditional jump or move depends on uninitialised value(s) ==570931== at 0x48BDEDD: magnet::math::ferrariQuarticSolve(double const&, double const&, double const&, double const&, double&, double&, double&, double&) (packages/tests-vg/tmg/src/../inst/include/magnet/math/quartic_ferrari.hpp:160) ==570931== by 0x48BF01D: magnet::math::quarticSolve(double const&, double const&, double const&, double const&, double&, double&, double&, double&) (packages/tests-vg/tmg/src/../inst/include/magnet/math/quartic.hpp:92) ==570931== by 0x48BA3ED: HmcSampler::_getNextQuadraticHitTime(Eigen::Matrix const&, Eigen::Matrix const&, double&, int&, bool) (packages/tests-vg/tmg/src/HmcSampler.cpp:221) ==570931== by 0x48BAA4C: HmcSampler::sampleNext(bool) (packages/tests-vg/tmg/src/HmcSampler.cpp:72) ==570931== by 0x48C172D: rtmg (packages/tests-vg/tmg/src/rtmg.cpp:60) ==570931== by 0x49D2A1: R_doDotCall (svn/R-devel/src/main/dotcode.c:624) ==570931== by 0x49D823: do_dotcall (svn/R-devel/src/main/dotcode.c:1281) ==570931== by 0x4D3726: bcEval (svn/R-devel/src/main/eval.c:7115) ==570931== by 0x4F0237: Rf_eval (svn/R-devel/src/main/eval.c:727) ==570931== by 0x4F1C4D: R_execClosure (svn/R-devel/src/main/eval.c:1897) ==570931== by 0x4F2943: Rf_applyClosure (svn/R-devel/src/main/eval.c:1823) ==570931== by 0x4F0403: Rf_eval (svn/R-devel/src/main/eval.c:850) ==570931== Uninitialised value was created by a stack allocation ==570931== at 0x48B7700: ??? (in /data/blackswan/ripley/R/packages/tests-vg/tmg.Rcheck/tmg/libs/tmg.so) ==570931== ==570931== Use of uninitialised value of size 8 ==570931== at 0x48BDEEF: magnet::math::ferrariQuarticSolve(double const&, double const&, double const&, double const&, double&, double&, double&, double&) (packages/tests-vg/tmg/src/../inst/include/magnet/math/quartic_ferrari.hpp:163) ==570931== by 0x48BF01D: magnet::math::quarticSolve(double const&, double const&, double const&, double const&, double&, double&, double&, double&) (packages/tests-vg/tmg/src/../inst/include/magnet/math/quartic.hpp:92) ==570931== by 0x48BA3ED: HmcSampler::_getNextQuadraticHitTime(Eigen::Matrix const&, Eigen::Matrix const&, double&, int&, bool) (packages/tests-vg/tmg/src/HmcSampler.cpp:221) ==570931== by 0x48BAA4C: HmcSampler::sampleNext(bool) (packages/tests-vg/tmg/src/HmcSampler.cpp:72) ==570931== by 0x48C172D: rtmg (packages/tests-vg/tmg/src/rtmg.cpp:60) ==570931== by 0x49D2A1: R_doDotCall (svn/R-devel/src/main/dotcode.c:624) ==570931== by 0x49D823: do_dotcall (svn/R-devel/src/main/dotcode.c:1281) ==570931== by 0x4D3726: bcEval (svn/R-devel/src/main/eval.c:7115) ==570931== by 0x4F0237: Rf_eval (svn/R-devel/src/main/eval.c:727) ==570931== by 0x4F1C4D: R_execClosure (svn/R-devel/src/main/eval.c:1897) ==570931== by 0x4F2943: Rf_applyClosure (svn/R-devel/src/main/eval.c:1823) ==570931== by 0x4F0403: Rf_eval (svn/R-devel/src/main/eval.c:850) ==570931== Uninitialised value was created by a stack allocation ==570931== at 0x48B7700: ??? (in /data/blackswan/ripley/R/packages/tests-vg/tmg.Rcheck/tmg/libs/tmg.so) ==570931== ==570931== Use of uninitialised value of size 8 ==570931== at 0x48BD648: magnet::math::neumarkQuarticSolve(double const&, double const&, double const&, double const&, double&, double&, double&, double&) (packages/tests-vg/tmg/src/../inst/include/magnet/math/quartic_neumark.hpp:168) ==570931== by 0x48BE51F: magnet::math::quarticSolve(double const&, double const&, double const&, double const&, double&, double&, double&, double&) (packages/tests-vg/tmg/src/../inst/include/magnet/math/quartic.hpp:103) ==570931== by 0x48BA3ED: HmcSampler::_getNextQuadraticHitTime(Eigen::Matrix const&, Eigen::Matrix const&, double&, int&, bool) (packages/tests-vg/tmg/src/HmcSampler.cpp:221) ==570931== by 0x48BAA4C: HmcSampler::sampleNext(bool) (packages/tests-vg/tmg/src/HmcSampler.cpp:72) ==570931== by 0x48C172D: rtmg (packages/tests-vg/tmg/src/rtmg.cpp:60) ==570931== by 0x49D2A1: R_doDotCall (svn/R-devel/src/main/dotcode.c:624) ==570931== by 0x49D823: do_dotcall (svn/R-devel/src/main/dotcode.c:1281) ==570931== by 0x4D3726: bcEval (svn/R-devel/src/main/eval.c:7115) ==570931== by 0x4F0237: Rf_eval (svn/R-devel/src/main/eval.c:727) ==570931== by 0x4F1C4D: R_execClosure (svn/R-devel/src/main/eval.c:1897) ==570931== by 0x4F2943: Rf_applyClosure (svn/R-devel/src/main/eval.c:1823) ==570931== by 0x4F0403: Rf_eval (svn/R-devel/src/main/eval.c:850) ==570931== Uninitialised value was created by a stack allocation ==570931== at 0x48B7700: ??? (in /data/blackswan/ripley/R/packages/tests-vg/tmg.Rcheck/tmg/libs/tmg.so) ==570931== ==570931== Conditional jump or move depends on uninitialised value(s) ==570931== at 0x48BD65A: magnet::math::neumarkQuarticSolve(double const&, double const&, double const&, double const&, double&, double&, double&, double&) (packages/tests-vg/tmg/src/../inst/include/magnet/math/quartic_neumark.hpp:169) ==570931== by 0x48BE51F: magnet::math::quarticSolve(double const&, double const&, double const&, double const&, double&, double&, double&, double&) (packages/tests-vg/tmg/src/../inst/include/magnet/math/quartic.hpp:103) ==570931== by 0x48BA3ED: HmcSampler::_getNextQuadraticHitTime(Eigen::Matrix const&, Eigen::Matrix const&, double&, int&, bool) (packages/tests-vg/tmg/src/HmcSampler.cpp:221) ==570931== by 0x48BAA4C: HmcSampler::sampleNext(bool) (packages/tests-vg/tmg/src/HmcSampler.cpp:72) ==570931== by 0x48C172D: rtmg (packages/tests-vg/tmg/src/rtmg.cpp:60) ==570931== by 0x49D2A1: R_doDotCall (svn/R-devel/src/main/dotcode.c:624) ==570931== by 0x49D823: do_dotcall (svn/R-devel/src/main/dotcode.c:1281) ==570931== by 0x4D3726: bcEval (svn/R-devel/src/main/eval.c:7115) ==570931== by 0x4F0237: Rf_eval (svn/R-devel/src/main/eval.c:727) ==570931== by 0x4F1C4D: R_execClosure (svn/R-devel/src/main/eval.c:1897) ==570931== by 0x4F2943: Rf_applyClosure (svn/R-devel/src/main/eval.c:1823) ==570931== by 0x4F0403: Rf_eval (svn/R-devel/src/main/eval.c:850) ==570931== Uninitialised value was created by a stack allocation ==570931== at 0x48B7700: ??? (in /data/blackswan/ripley/R/packages/tests-vg/tmg.Rcheck/tmg/libs/tmg.so) ==570931== ==570931== Use of uninitialised value of size 8 ==570931== at 0x48BD5BA: magnet::math::neumarkQuarticSolve(double const&, double const&, double const&, double const&, double&, double&, double&, double&) (packages/tests-vg/tmg/src/../inst/include/magnet/math/quartic_neumark.hpp:172) ==570931== by 0x48BE51F: magnet::math::quarticSolve(double const&, double const&, double const&, double const&, double&, double&, double&, double&) (packages/tests-vg/tmg/src/../inst/include/magnet/math/quartic.hpp:103) ==570931== by 0x48BA3ED: HmcSampler::_getNextQuadraticHitTime(Eigen::Matrix const&, Eigen::Matrix const&, double&, int&, bool) (packages/tests-vg/tmg/src/HmcSampler.cpp:221) ==570931== by 0x48BAA4C: HmcSampler::sampleNext(bool) (packages/tests-vg/tmg/src/HmcSampler.cpp:72) ==570931== by 0x48C172D: rtmg (packages/tests-vg/tmg/src/rtmg.cpp:60) ==570931== by 0x49D2A1: R_doDotCall (svn/R-devel/src/main/dotcode.c:624) ==570931== by 0x49D823: do_dotcall (svn/R-devel/src/main/dotcode.c:1281) ==570931== by 0x4D3726: bcEval (svn/R-devel/src/main/eval.c:7115) ==570931== by 0x4F0237: Rf_eval (svn/R-devel/src/main/eval.c:727) ==570931== by 0x4F1C4D: R_execClosure (svn/R-devel/src/main/eval.c:1897) ==570931== by 0x4F2943: Rf_applyClosure (svn/R-devel/src/main/eval.c:1823) ==570931== by 0x4F0403: Rf_eval (svn/R-devel/src/main/eval.c:850) ==570931== Uninitialised value was created by a stack allocation ==570931== at 0x48B7700: ??? (in /data/blackswan/ripley/R/packages/tests-vg/tmg.Rcheck/tmg/libs/tmg.so) ==570931== > plot(samples, pch=".") > > > > > ### *