diff --git a/.Rbuildignore b/.Rbuildignore index 97c305f..b5f21ca 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -1,7 +1,8 @@ .git* .gitignore .Rhistory -README.html +^README.html +^Makefile src/build_makevars.R src/Makevars_unix src/Makevars.win_win @@ -21,7 +22,9 @@ src/scs/.travis.yml src/scs/linsys/gpu src/scs/linsys/indirect inst/tools/* -Work + +tests/testthat/test_sparse_utils.R +tests/testthat/test_problems.R # Remove the citation file to pass checks. It is also in inst/CITATION src/scs/CITATION.cff diff --git a/DESCRIPTION b/DESCRIPTION index a6f841e..417c32a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,5 +1,5 @@ Package: scs -Version: 3.0-0 +Version: 3.0-1 Title: Splitting Conic Solver Authors@R: c( person("Florian", "Schwendinger", role = c("aut", "cre"), email = "FlorianSchwendinger@gmx.at"), person("Brendan", "O'Donoghue", role = c("aut", "cph")), @@ -14,10 +14,9 @@ Description: Solves convex cone programs via operator splitting. Can solve: Depends: R (>= 3.5.0) SystemRequirements: GNU Make Suggests: - Matrix, slam, testthat Encoding: UTF-8 License: GPL-3 URL: https://github.com/FlorianSchwendinger/scs -RoxygenNote: 7.1.2 +RoxygenNote: 7.2.0 diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..5802936 --- /dev/null +++ b/Makefile @@ -0,0 +1,35 @@ + +docs: + R -e 'library("roxygen2"); roxygenize(".", c("rd", "namespace"), load_source)' + +build: + R CMD build . + +inst: build + R CMD INSTALL scs*.tar.gz + +check: build + R CMD check scs*.tar.gz + +cran_check: build + R CMD check --as-cran scs*.tar.gz + +manual: clean + R CMD Rd2pdf --output=Manual.pdf . + +clean: + rm -f Manual.pdf README.knit.md README.html + rm -rf .Rd2pdf* + +check_mac_m1: build + R -e "rhub::check(dir(pattern = 'scs_.*.tar.gz'), platform = 'macos-m1-bigsur-release')" + +check_mac_old: build + R -e "rhub::check(dir(pattern = 'scs_.*.tar.gz'), platform = 'macos-highsierra-release-cran')" + +check_gcc_san: build + R -e "rhub::check(dir(pattern = 'scs_.*.tar.gz'), platform = 'linux-x86_64-rocker-gcc-san')" + +check_debian_clang: build + R -e "rhub::check(dir(pattern = 'scs_.*.tar.gz'), platform = 'debian-clang-devel')" + diff --git a/inst/check.R~ b/inst/check.R~ deleted file mode 100644 index 550dd2f..0000000 --- a/inst/check.R~ +++ /dev/null @@ -1,52 +0,0 @@ -context("Saved Problems") - -rds_files <- c( - "degenerate1.RDS", - "degenerate2.RDS", - "degenerate3.RDS", - "degenerate4.RDS", - "small_lp.RDS", - "rob_gauss_cov_est1.RDS", - "rob_gauss_cov_est2.RDS", - "hs21_tiny_qp1.RDS", - "hs21_tiny_qp2.RDS", - "qafiro_tiny_qp1.RDS", - "qafiro_tiny_qp2.RDS", - "qafiro_tiny_qp3.RDS", - "infeasible_tiny_qp.RDS", - "unbounded_tiny_qp.RDS", - "random_prob.RDS" -) - -info_vars_to_check <- c( - "iter", - "status", - "statusVal", - "scaleUpdates", - "pobj", - "dobj", - ## "resPri", - ## "resDual", - ## "gap", - "resInfeas", - "resUnbddA", - "resUnbddP", - ## "setupTime", - ## "solveTime", - "scale", - ## "compSlack", - "rejectedAccelSteps", - "acceptedAccelSteps" - ## "linsysTime", - ## "coneTime", - ## "accelTime" -) - -sol_vars_to_check <- c("x", "y", "s") - -fname <- rds_files[8] -d <- readRDS(file.path("../tests/testthat/problem_results", fname)) -sol <- scs(A = d$data$A, P = d$data$P, b = d$data$b, obj = d$data$obj, initial = d$sol, cone = d$cone, control = d$settings) - -expect_equal(sol$info[info_vars_to_check], d$sol$info[info_vars_to_check], tolerance = d$settings$eps_abs) -expect_equal(sol[sol_vars_to_check], d$sol[sol_vars_to_check], tolerance = d$settings$eps_abs) diff --git a/tests/testthat.R b/tests/testthat.R index aaff9ce..c06af05 100644 --- a/tests/testthat.R +++ b/tests/testthat.R @@ -1,5 +1,4 @@ library(testthat) library(scs) library(slam) -library(Matrix) test_check("scs") diff --git a/tests/testthat/test_problems.R b/tests/testthat/test_problems.R index 7367f5f..c8b60e8 100644 --- a/tests/testthat/test_problems.R +++ b/tests/testthat/test_problems.R @@ -45,7 +45,7 @@ info_vars_to_check <- c( sol_vars_to_check <- c("x", "y", "s") for (fname in rds_files) { - d <- readRDS(file.path("problem_results", fname)) + d <- readRDS(file.path("problem_results", fname)) test_that(sprintf("Checking results for %s", fname), { sol <- scs(A = d$data$A, P = d$data$P, b = d$data$b, obj = d$data$obj, cone = d$cone, control = d$settings) if (fname == "random_prob.RDS") { ## Need lenient tolerance diff --git a/tests/testthat/test_sparse_utils.R b/tests/testthat/test_sparse_utils.R index 7f1504c..8408c1d 100644 --- a/tests/testthat/test_sparse_utils.R +++ b/tests/testthat/test_sparse_utils.R @@ -1,4 +1,5 @@ ## Some tests for utils +# Removed this test from the build via .Rbuildignore since Matrix pkg will change. s <- Matrix::sparseMatrix(i = c(2,4,3:5), j= c(4,7:5,5), x = 1:5, dims = c(7,7), symmetric = TRUE)