| Title: | Semi-Symmetric Sparse Projection |
|---|---|
| Description: | Computes the exact joint sparsity and group sparsity projection using the Semi-symmetric Sparse Projection algorithm of J. Shen and S. Damadi, "Sparse projection onto semi-symmetric sets with applications to sparse optimization", Journal of Global Optimization (2026), <doi:10.1007/s10898-026-01592-y>. |
| Authors: | Saeed Damadi [aut, cre] |
| Maintainer: | Saeed Damadi <sparsification@gmail.com> |
| License: | MIT + file LICENSE |
| Version: | 0.1.0 |
| Built: | 2026-10-06 11:16:21 UTC |
| Source: | https://github.com/cran/sssp |
Returns the citation line for the SSSP algorithm and the Journal of Global Optimization paper.
sssp_citation()sssp_citation()
A character scalar.
sssp_citation()sssp_citation()
Computes an exact element of . The argument
groups must form a disjoint union of all indices of v; R index
vectors are 1-based. A numeric vector groups is interpreted as
for contiguous groups.
sssp_project(v, groups, r, s, verbose = FALSE)sssp_project(v, groups, r, s, verbose = FALSE)
v |
Numeric vector |
groups |
Group sizes or a list of 1-based index vectors encoding
|
r |
Group sparsity level |
s |
Sparsity level |
verbose |
If |
A list with x, the projection, and info, including
objective, tuple, selected_groups, n_tuples, and
wall_time.
v <- c(10, -1, 2, 3, 9, 0, -4, -8, 7, 6) res <- sssp_project(v, c(3, 4, 3), r = 3, s = 6) res$x res$info$tuple ## non-uniform groups given as index lists v2 <- c(4, -3, 5, 2, -6, 1, 7, -8, 0.5, 9, -2, 3) groups2 <- list(c(1, 4), c(2, 3, 5, 8, 9, 10), c(6, 7, 11, 12)) sssp_project(v2, groups2, r = 2, s = 5)$info$tuplev <- c(10, -1, 2, 3, 9, 0, -4, -8, 7, 6) res <- sssp_project(v, c(3, 4, 3), r = 3, s = 6) res$x res$info$tuple ## non-uniform groups given as index lists v2 <- c(4, -3, 5, 2, -6, 1, 7, -8, 0.5, 9, -2, 3) groups2 <- list(c(1, 4), c(2, 3, 5, 8, 9, 10), c(6, 7, 11, 12)) sssp_project(v2, groups2, r = 2, s = 5)$info$tuple
Applies
to .
sssp_solve(A, b, groups, r, s, gamma = NULL, max_iter = 200L, tol = 1e-06, x0 = NULL, verbose = FALSE)sssp_solve(A, b, groups, r, s, gamma = NULL, max_iter = 200L, tol = 1e-06, x0 = NULL, verbose = FALSE)
A |
Numeric matrix. |
b |
Numeric response vector. |
groups |
Group sizes or a list of 1-based index vectors encoding
|
r |
Group sparsity level |
s |
Sparsity level |
gamma |
Step length |
max_iter |
Maximum iterations. |
tol |
Relative step stopping tolerance. |
x0 |
Optional initial vector. |
verbose |
If |
A list with x and info.
set.seed(1) A <- matrix(rnorm(40 * 12), 40, 12) x_true <- c(1, 2, 0, 0, 0, 0, 3, 4, 0, 0, 0, 0) b <- as.vector(A %*% x_true) res <- sssp_solve(A, b, groups = c(4, 4, 4), r = 2, s = 4) res$xset.seed(1) A <- matrix(rnorm(40 * 12), 40, 12) x_true <- c(1, 2, 0, 0, 0, 0, 3, 4, 0, 0, 0, 0) b <- as.vector(A %*% x_true) res <- sssp_solve(A, b, groups = c(4, 4, 4), r = 2, s = 4) res$x