R Under development (unstable) (2025-04-21 r88165) -- "Unsuffered Consequences" Copyright (C) 2025 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu 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 <- "ADSIHT" > source(file.path(R.home("share"), "R", "examples-header.R")) > options(warn = 1) > library('ADSIHT') > > base::assign(".oldSearch", base::search(), pos = 'CheckExEnv') > base::assign(".old_wd", base::getwd(), pos = 'CheckExEnv') > cleanEx() > nameEx("ADSIHT.ML") > ### * ADSIHT.ML > > flush(stderr()); flush(stdout()) > > ### Name: ADSIHT.ML > ### Title: ADSIHT in multi-task learning framework > ### Aliases: ADSIHT.ML > > ### ** Examples > > set.seed(1) > n <- 200 > p <- 100 > K <- 4 > s <- 5 > s0 <- 2 > x_list <- lapply(1:K, function(x) matrix(rnorm(n*p, 0, 1), nrow = n)) > vec <- rep(0, K * p) > non_sparse_groups <- sample(1:p, size = s, replace = FALSE) > for (group in non_sparse_groups) { + group_indices <- seq(group, K * p, by = p) + non_zero_indices <- sample(group_indices, size = s0, replace = FALSE) + vec[non_zero_indices] <- rep(2, s0) + } > y_list <- lapply(1:K, function(i) return( + y = x_list[[i]] %*% vec[((i-1)*p+1):(i*p)]+rnorm(n, 0, 0.5)) + ) > fit <- ADSIHT.ML(x_list, y_list) > fit$A_out[, which.min(fit$ic)] [1] 54 59 64 88 164 183 254 283 288 359 > > > > cleanEx() > nameEx("ADSIHT") > ### * ADSIHT > > flush(stderr()); flush(stdout()) > > ### Name: ADSIHT > ### Title: Adaptive Double Sparse Iterative Hard Thresholding Algorithm > ### (ADSIHT) > ### Aliases: ADSIHT > > ### ** Examples > > > n <- 200 > m <- 100 > d <- 10 > s <- 5 > s0 <- 5 > data <- gen.data(n, m, d, s, s0) > fit <- ADSIHT(data$x, data$y, data$group) > fit$A_out[which.min(fit$ic)] [[1]] [1] 481 484 485 486 490 652 654 655 656 660 732 734 735 737 738 803 806 807 808 [20] 809 813 814 817 819 820 > > > > cleanEx() > nameEx("MIGHT") > ### * MIGHT > > flush(stderr()); flush(stdout()) > > ### Name: MIGHT > ### Title: MIGHT: Milti-task iterative graphical hard thresholding > ### Aliases: MIGHT > > ### ** Examples > > library(mvnfast) > set.seed(1) > n = 50; p = 10; K = 4 > x_list <- lapply(1:K, function(x) rmvn(n, mu=rep(1, p), + sigma = toeplitz( (x/2/K)^(1:p-1) ) ) ) > fit = MIGHT(X=x_list, scale = 10) Data.h:13:7: runtime error: load of value 16, which is not a valid value for type 'bool' #0 0x7f3be4f9f590 in Data::operator=(Data const&) /data/gannet/ripley/R/packages/tests-gcc-SAN/ADSIHT/src/Data.h:13 #1 0x7f3be4f9f590 in Algorithm::Algorithm(Data&) /data/gannet/ripley/R/packages/tests-gcc-SAN/ADSIHT/src/Algorithm.h:30 #2 0x7f3be4fe57ed in DSIHTLm::DSIHTLm(Data&) /data/gannet/ripley/R/packages/tests-gcc-SAN/ADSIHT/src/Algorithm.h:181 #3 0x7f3be4fe57ed in DSIHT_ML_Cpp(Eigen::Matrix&, Eigen::Matrix&, Eigen::Matrix&, int, double, Eigen::Matrix&, double, Eigen::Matrix&, double, bool, double, double, double, int, bool) /data/gannet/ripley/R/packages/tests-gcc-SAN/ADSIHT/src/DSIHT.cpp:43 #4 0x7f3be501b727 in _ADSIHT_DSIHT_ML_Cpp /data/gannet/ripley/R/packages/tests-gcc-SAN/ADSIHT/src/RcppExports.cpp:60 #5 0x75a574 in R_doDotCall /data/gannet/ripley/R/svn/R-devel/src/main/dotcode.c:819 #6 0x8efc2a in bcEval_loop /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:8668 #7 0x8c646b in bcEval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:7501 #8 0x866db2 in Rf_eval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:1167 #9 0x87e7ca in R_execClosure /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:2393 #10 0x8829da in applyClosure_core /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:2306 #11 0x8842f7 in Rf_applyClosure /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:2328 #12 0x8842f7 in R_forceAndCall /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:2460 #13 0x4b2d66 in do_lapply /data/gannet/ripley/R/svn/R-devel/src/main/apply.c:75 #14 0xa9d566 in do_internal /data/gannet/ripley/R/svn/R-devel/src/main/names.c:1411 #15 0x8e6431 in bcEval_loop /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:8138 #16 0x8c646b in bcEval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:7501 #17 0x866db2 in Rf_eval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:1167 #18 0x87e7ca in R_execClosure /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:2393 #19 0x8829da in applyClosure_core /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:2306 #20 0x867453 in Rf_applyClosure /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:2328 #21 0x867453 in Rf_eval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:1280 #22 0x8976ee in do_set /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:3567 #23 0x867876 in Rf_eval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:1232 #24 0xa0bc63 in Rf_ReplIteration /data/gannet/ripley/R/svn/R-devel/src/main/main.c:265 #25 0xa0bc63 in R_ReplConsole /data/gannet/ripley/R/svn/R-devel/src/main/main.c:317 #26 0xa10f7a in run_Rmainloop /data/gannet/ripley/R/svn/R-devel/src/main/main.c:1234 #27 0xa1b192 in Rf_mainloop /data/gannet/ripley/R/svn/R-devel/src/main/main.c:1241 #28 0x42bd5f in main /data/gannet/ripley/R/svn/R-devel/src/main/Rmain.c:29 #29 0x7f3bf7038087 in __libc_start_call_main (/lib64/libc.so.6+0x2a087) (BuildId: c8c3fa52aaee3f5d73b6fd862e39e9d4c010b6ba) #30 0x7f3bf703814a in __libc_start_main_impl (/lib64/libc.so.6+0x2a14a) (BuildId: c8c3fa52aaee3f5d73b6fd862e39e9d4c010b6ba) #31 0x42c6e4 in _start (/data/gannet/ripley/R/gcc-SAN3/bin/exec/R+0x42c6e4) (BuildId: 81ac5d208640ad2c0ea4b82c75c2cb3222da06bb) > solve( toeplitz( 0.5^(0:9) ) ) [,1] [,2] [,3] [,4] [,5] [1,] 1.3333333 -0.6666667 -5.551115e-17 -2.775558e-17 -1.387779e-17 [2,] -0.6666667 1.6666667 -6.666667e-01 0.000000e+00 0.000000e+00 [3,] 0.0000000 -0.6666667 1.666667e+00 -6.666667e-01 0.000000e+00 [4,] 0.0000000 0.0000000 -6.666667e-01 1.666667e+00 -6.666667e-01 [5,] 0.0000000 0.0000000 0.000000e+00 -6.666667e-01 1.666667e+00 [6,] 0.0000000 0.0000000 0.000000e+00 0.000000e+00 -6.666667e-01 [7,] 0.0000000 0.0000000 0.000000e+00 0.000000e+00 0.000000e+00 [8,] 0.0000000 0.0000000 0.000000e+00 0.000000e+00 0.000000e+00 [9,] 0.0000000 0.0000000 0.000000e+00 0.000000e+00 0.000000e+00 [10,] 0.0000000 0.0000000 0.000000e+00 0.000000e+00 0.000000e+00 [,6] [,7] [,8] [,9] [,10] [1,] -6.938894e-18 -3.469447e-18 -1.734723e-18 -8.673617e-19 0.0000000 [2,] 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.0000000 [3,] 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.0000000 [4,] 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.0000000 [5,] -6.666667e-01 0.000000e+00 0.000000e+00 0.000000e+00 0.0000000 [6,] 1.666667e+00 -6.666667e-01 0.000000e+00 0.000000e+00 0.0000000 [7,] -6.666667e-01 1.666667e+00 -6.666667e-01 0.000000e+00 0.0000000 [8,] 0.000000e+00 -6.666667e-01 1.666667e+00 -6.666667e-01 0.0000000 [9,] 0.000000e+00 0.000000e+00 -6.666667e-01 1.666667e+00 -0.6666667 [10,] 0.000000e+00 0.000000e+00 0.000000e+00 -6.666667e-01 1.3333333 > fit[[4]] [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 1.08982 0.0000000 0.0000000 0.000000 0.000000 0.0000000 0.000000 [2,] 0.00000 1.4916729 -0.5933892 0.000000 0.000000 0.0000000 0.000000 [3,] 0.00000 -0.5933892 2.1937416 -1.466138 0.000000 0.0000000 0.000000 [4,] 0.00000 0.0000000 -1.4661376 2.719730 0.000000 0.0000000 0.000000 [5,] 0.00000 0.0000000 0.0000000 0.000000 1.513656 -1.0171985 0.000000 [6,] 0.00000 0.0000000 0.0000000 0.000000 -1.017199 3.4335595 -1.046745 [7,] 0.00000 0.0000000 0.0000000 0.000000 0.000000 -1.0467454 1.612670 [8,] 0.00000 0.0000000 0.0000000 0.000000 0.000000 -0.6509167 0.000000 [9,] 0.00000 0.0000000 0.0000000 0.000000 0.000000 0.0000000 0.000000 [10,] 0.00000 0.0000000 0.0000000 0.000000 0.000000 0.0000000 0.000000 [,8] [,9] [,10] [1,] 0.0000000 0.0000000 0.0000000 [2,] 0.0000000 0.0000000 0.0000000 [3,] 0.0000000 0.0000000 0.0000000 [4,] 0.0000000 0.0000000 0.0000000 [5,] 0.0000000 0.0000000 0.0000000 [6,] -0.6509167 0.0000000 0.0000000 [7,] 0.0000000 0.0000000 0.0000000 [8,] 1.6219177 -0.5982645 0.0000000 [9,] -0.5982645 1.2129056 -0.4597035 [10,] 0.0000000 -0.4597035 1.2414355 > > > > > cleanEx() detaching ‘package:mvnfast’ > nameEx("gen.data") > ### * gen.data > > flush(stderr()); flush(stdout()) > > ### Name: gen.data > ### Title: Generate simulated data > ### Aliases: gen.data > > ### ** Examples > > > # Generate simulated data > n <- 200 > m <- 100 > d <- 10 > s <- 5 > s0 <- 5 > data <- gen.data(n, m, d, s, s0) > str(data) List of 6 $ x : num [1:200, 1:1000] -0.626 0.184 -0.836 1.595 0.33 ... ..- attr(*, "dimnames")=List of 2 .. ..$ : NULL .. ..$ : chr [1:1000] "x1" "x2" "x3" "x4" ... $ y : num [1:200, 1] -4.595 4.2 0.941 6.43 -10.688 ... $ beta : num [1:1000] 0 0 0 0 0 0 0 0 0 0 ... $ group : int [1:1000] 1 1 1 1 1 1 1 1 1 1 ... $ true.group : int [1:5] 49 66 74 81 82 $ true.variable: int [1:25] 481 484 485 486 490 652 654 655 656 660 ... > > > > ### *