Package check result: ERROR Check: examples, Result: ERROR Running examples in ‘FLSSS-Ex.R’ failed The error most likely occurred in: > base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: arbFLSSS > ### Title: Multidimensional exact subset sum in arbitrary precision and > ### magnitude > ### Aliases: arbFLSSS > > ### ** Examples > > set.seed(1) > N = 200L # Superset size. > len = 20L # Subset size. > V = sapply(1:N, function(i) # Generate a set where every "number" has at most + # 100 digits. + { + a = 0:9 + left = sample(a, size = sample(50, 1), replace = TRUE) + right = sample(a, size = sample(50, 1), replace = TRUE) + x = paste0(paste0(left, collapse = ""), ".", paste0(right, collapse = "")) + if (runif(1) < 0.5) x = paste0("-", x) # Randomly add a negative sign. + x + }) > str(V) chr [1:200] "-6016.1204495968448844198032599533986587867596295" ... > > > sol = sample(N, len) # Make a solution. > target = FLSSS::addNumStrings(V[sol]) # An unexposed helper function. > > > # Uncomment the following block for testing the code since CRAN check uses > # Valgrind, which takes over 5s to run. > # system.time({ > # rst = FLSSS::arbFLSSS( > # len = len, V = Vstr, target, givenKsumTable = NULL, tlimit = 60, > # solutionNeed = 1e9, maxCore = 2, ksumK = 4, verbose = TRUE) > # }) > # > # > # # Validation. > # all(unlist(lapply(rst, function(x) > # { > # apply(Vstr, 2, function(u) FLSSS:::addNumStrings(u[x])) > # })) == targetStr) > > > > # ============================================================================== > # Mine in a multidimensional set. > # ============================================================================== > set.seed(2) > d = 4L # Set dimension. > N = 50L # Set size. > len = 10L # Subset size. > roundN = 4L # For rounding the numeric values before conversion to strings. > > > V = matrix(round(runif(N * d, -1, 1), roundN), nrow = N) # Make superset. > optionSave = options() > options(scipen = 999) # Ensure numeric-to-string conversion does not > # produce strings like "2e-3". > Vstr = matrix(as.character(V), nrow = N) > > > sol = sample(N, len) # Make a solution. > target = round(colSums(V[sol, ]), roundN) # Target subset sum. > targetStr = as.character(target) > > > system.time({ + rst = FLSSS::arbFLSSS( + len = len, V = Vstr, target, givenKsumTable = NULL, tlimit = 60, + solutionNeed = 1e9, maxCore = 2, ksumK = 4, verbose = TRUE) + }) Transform string input to bit streams and create flsss objects to mine.. ==3827508== ==3827508== Process terminating with default action of signal 15 (SIGTERM) ==3827508== at 0x1FF7B068: CharlieThreadPool::parFor(unsigned long, unsigned long, std::function, unsigned long, std::function, std::function) (/home/hornik/tmp/CRAN_special_valgrind/FLSSS.Rcheck/00_pkg_src/FLSSS/src/arbitraryDimFLSSS/charlieThreadPool.hpp:136) ==3827508== by 0x1FFA36A2: stringMatTo64bitIntMat(Rcpp::Matrix<16, Rcpp::PreserveStorage>&, Rcpp::Vector<16, Rcpp::PreserveStorage>&, int, CharlieThreadPool&, std::vector >&, std::vector >&, std::vector >&, std::vector >&, std::vector >&, int&, bool) (/home/hornik/tmp/CRAN_special_valgrind/FLSSS.Rcheck/00_pkg_src/FLSSS/src/arbitraryDimFLSSS/intString2intArray.hpp:394) ==3827508== by 0x1FFA7D15: bool makeMflsssObjs(int, Rcpp::Matrix<16, Rcpp::PreserveStorage>, Rcpp::Vector<16, Rcpp::PreserveStorage>, int, int, CharlieThreadPool&, std::vector, std::allocator > >&, std::vector >, std::allocator > > >&, Shared&, double, std::vector >&, TriM&, KsumLookUpTable&, bool) (/home/hornik/tmp/CRAN_special_valgrind/FLSSS.Rcheck/00_pkg_src/FLSSS/src/arbitraryDimFLSSS/mflsssDecomp.hpp:43) ==3827508== by 0x1FFA8B2B: Rcpp::Vector<19, Rcpp::PreserveStorage> mflsssArb(int, Rcpp::Matrix<16, Rcpp::PreserveStorage>, Rcpp::Vector<16, Rcpp::PreserveStorage>, int, CharlieThreadPool&, int, double, Rcpp::Vector<19, Rcpp::PreserveStorage>, int, int, bool) (/home/hornik/tmp/CRAN_special_valgrind/FLSSS.Rcheck/00_pkg_src/FLSSS/src/arbitraryDimFLSSS/mflsssDecomp.hpp:253) ==3827508== by 0x1FF7961A: arbFLSSS(int, Rcpp::Matrix<16, Rcpp::PreserveStorage>, Rcpp::Vector<16, Rcpp::PreserveStorage>, SEXPREC*, int, int, double, int, int, int, bool) (/home/hornik/tmp/CRAN_special_valgrind/FLSSS.Rcheck/00_pkg_src/FLSSS/src/mflsssArb.cpp:32) ==3827508== by 0x1FF1494D: _FLSSS_arbFLSSS (/home/hornik/tmp/CRAN_special_valgrind/FLSSS.Rcheck/00_pkg_src/FLSSS/src/RcppExports.cpp:329) ==3827508== by 0x495D863: R_doDotCall (/home/hornik/src/R/src/main/dotcode.c:801) ==3827508== by 0x49A2702: bcEval_loop (/home/hornik/src/R/src/main/eval.c:8668) ==3827508== by 0x49AA6B5: bcEval (/home/hornik/src/R/src/main/eval.c:7501) ==3827508== by 0x49AA6B5: bcEval (/home/hornik/src/R/src/main/eval.c:7486) ==3827508== by 0x49AAA2A: Rf_eval (/home/hornik/src/R/src/main/eval.c:1167) ==3827508== by 0x49ACB2D: R_execClosure (/home/hornik/src/R/src/main/eval.c:2393) ==3827508== by 0x49AD88C: applyClosure_core (/home/hornik/src/R/src/main/eval.c:2306) ==3827508== ==3827508== HEAP SUMMARY: ==3827508== in use at exit: 59,912,766 bytes in 12,890 blocks ==3827508== total heap usage: 35,010,407 allocs, 34,997,517 frees, 320,854,137 bytes allocated ==3827508== Examples with CPU (user + system) or elapsed time > 5s user system elapsed FLSSS 277.298 11.645 289.029 Post-processing issues found: File: FLSSS-Ex.Rout ==3827508== Memcheck, a memory error detector ==3827508== Copyright (C) 2002-2024, and GNU GPL'd, by Julian Seward et al. ==3827508== Using Valgrind-3.24.0 and LibVEX; rerun with -h for copyright info ==3827508== Command: /home/hornik/tmp/R-d-gcc-valg/bin/exec/R --vanilla ==3827508== ==3827508== ==3827508== Process terminating with default action of signal 15 (SIGTERM) ==3827508== at 0x1FF7B068: CharlieThreadPool::parFor(unsigned long, unsigned long, std::function, unsigned long, std::function, std::function) (/home/hornik/tmp/CRAN_special_valgrind/FLSSS.Rcheck/00_pkg_src/FLSSS/src/arbitraryDimFLSSS/charlieThreadPool.hpp:136) ==3827508== by 0x1FFA36A2: stringMatTo64bitIntMat(Rcpp::Matrix<16, Rcpp::PreserveStorage>&, Rcpp::Vector<16, Rcpp::PreserveStorage>&, int, CharlieThreadPool&, std::vector >&, std::vector >&, std::vector >&, std::vector >&, std::vector >&, int&, bool) (/home/hornik/tmp/CRAN_special_valgrind/FLSSS.Rcheck/00_pkg_src/FLSSS/src/arbitraryDimFLSSS/intString2intArray.hpp:394) ==3827508== by 0x1FFA7D15: bool makeMflsssObjs(int, Rcpp::Matrix<16, Rcpp::PreserveStorage>, Rcpp::Vector<16, Rcpp::PreserveStorage>, int, int, CharlieThreadPool&, std::vector, std::allocator > >&, std::vector >, std::allocator > > >&, Shared&, double, std::vector >&, TriM&, KsumLookUpTable&, bool) (/home/hornik/tmp/CRAN_special_valgrind/FLSSS.Rcheck/00_pkg_src/FLSSS/src/arbitraryDimFLSSS/mflsssDecomp.hpp:43) ==3827508== by 0x1FFA8B2B: Rcpp::Vector<19, Rcpp::PreserveStorage> mflsssArb(int, Rcpp::Matrix<16, Rcpp::PreserveStorage>, Rcpp::Vector<16, Rcpp::PreserveStorage>, int, CharlieThreadPool&, int, double, Rcpp::Vector<19, Rcpp::PreserveStorage>, int, int, bool) (/home/hornik/tmp/CRAN_special_valgrind/FLSSS.Rcheck/00_pkg_src/FLSSS/src/arbitraryDimFLSSS/mflsssDecomp.hpp:253) ==3827508== by 0x1FF7961A: arbFLSSS(int, Rcpp::Matrix<16, Rcpp::PreserveStorage>, Rcpp::Vector<16, Rcpp::PreserveStorage>, SEXPREC*, int, int, double, int, int, int, bool) (/home/hornik/tmp/CRAN_special_valgrind/FLSSS.Rcheck/00_pkg_src/FLSSS/src/mflsssArb.cpp:32) ==3827508== by 0x1FF1494D: _FLSSS_arbFLSSS (/home/hornik/tmp/CRAN_special_valgrind/FLSSS.Rcheck/00_pkg_src/FLSSS/src/RcppExports.cpp:329) ==3827508== by 0x495D863: R_doDotCall (/home/hornik/src/R/src/main/dotcode.c:801) ==3827508== by 0x49A2702: bcEval_loop (/home/hornik/src/R/src/main/eval.c:8668) ==3827508== by 0x49AA6B5: bcEval (/home/hornik/src/R/src/main/eval.c:7501) ==3827508== by 0x49AA6B5: bcEval (/home/hornik/src/R/src/main/eval.c:7486) ==3827508== by 0x49AAA2A: Rf_eval (/home/hornik/src/R/src/main/eval.c:1167) ==3827508== by 0x49ACB2D: R_execClosure (/home/hornik/src/R/src/main/eval.c:2393) ==3827508== by 0x49AD88C: applyClosure_core (/home/hornik/src/R/src/main/eval.c:2306) ==3827508== ==3827508== HEAP SUMMARY: ==3827508== in use at exit: 59,912,766 bytes in 12,890 blocks ==3827508== total heap usage: 35,010,407 allocs, 34,997,517 frees, 320,854,137 bytes allocated ==3827508== ==3827508== LEAK SUMMARY: ==3827508== definitely lost: 0 bytes in 0 blocks ==3827508== indirectly lost: 0 bytes in 0 blocks ==3827508== possibly lost: 14,422 bytes in 48 blocks ==3827508== still reachable: 59,898,344 bytes in 12,842 blocks ==3827508== of which reachable via heuristic: ==3827508== newarray : 110,832 bytes in 28 blocks ==3827508== suppressed: 0 bytes in 0 blocks ==3827508== Rerun with --leak-check=full to see details of leaked memory ==3827508== ==3827508== For lists of detected and suppressed errors, rerun with: -s ==3827508== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)