Skip to content

Commit 0e3a046

Browse files
authored
Merge pull request #46 from osqp/v1.0.0
Upgrade to OSQP 1.0 with S7 classes and full R package modernization
2 parents 2079d24 + a381381 commit 0e3a046

52 files changed

Lines changed: 2794 additions & 561 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.Rbuildignore

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,18 @@ libosqp.a
2525
^\.github$
2626
.github
2727
src/osqp_sources/CITATION.cff
28+
src/osqp_sources/\.pre-commit-config\.yaml
2829
src/osqp_sources/docs
2930
src/osqp_sources/site
3031
src/osqp_sources/tests
3132
src/osqp_sources/lin_sys/direct/qdldl/qdldl_sources/tests
32-
^configure$
33+
^PLAN\.md$
34+
^2026-.*\.txt$
35+
src/qdldl_sources/examples
36+
src/qdldl_sources/tests
37+
^\.claude$
38+
^doc$
39+
^Meta$
40+
^_pkgdown\.yml$
41+
^docs$
42+
^pkgdown$

.github/workflows/R-CMD-check.yaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ on:
44
push:
55
branches: [main, master]
66
pull_request:
7-
branches: [main, master]
87

9-
name: R-CMD-check
8+
name: R-CMD-check.yaml
9+
10+
permissions: read-all
1011

1112
jobs:
1213
R-CMD-check:
@@ -29,9 +30,9 @@ jobs:
2930
R_KEEP_PKG_SOURCE: yes
3031

3132
steps:
32-
- uses: actions/checkout@v3
33+
- uses: actions/checkout@v4
3334
with:
34-
submodules: recursive
35+
submodules: true
3536

3637
- uses: r-lib/actions/setup-pandoc@v2
3738

@@ -49,3 +50,4 @@ jobs:
4950
- uses: r-lib/actions/check-r-package@v2
5051
with:
5152
upload-snapshots: true
53+
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'

.github/workflows/pkgdown.yaml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
2+
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
3+
on:
4+
push:
5+
branches: [main, master]
6+
pull_request:
7+
release:
8+
types: [published]
9+
workflow_dispatch:
10+
11+
name: pkgdown.yaml
12+
13+
permissions: read-all
14+
15+
jobs:
16+
pkgdown:
17+
runs-on: ubuntu-latest
18+
# Only restrict concurrency for non-PR jobs
19+
concurrency:
20+
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
21+
env:
22+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
23+
permissions:
24+
contents: write
25+
steps:
26+
- uses: actions/checkout@v4
27+
with:
28+
submodules: true
29+
30+
- uses: r-lib/actions/setup-pandoc@v2
31+
32+
- uses: r-lib/actions/setup-r@v2
33+
with:
34+
use-public-rspm: true
35+
36+
- uses: r-lib/actions/setup-r-dependencies@v2
37+
with:
38+
extra-packages: any::pkgdown, local::.
39+
needs: website
40+
41+
- name: Build site
42+
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
43+
shell: Rscript {0}
44+
45+
- name: Deploy to GitHub pages 🚀
46+
if: github.event_name != 'pull_request'
47+
uses: JamesIves/github-pages-deploy-action@v4.5.0
48+
with:
49+
clean: false
50+
branch: gh-pages
51+
folder: docs

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,15 @@ vignettes/*.pdf
3737
*.so
3838
*.a
3939

40+
# Generated by configure
41+
src/include/
42+
src/lib/
43+
44+
# Claude Code
45+
.claude/
46+
4047
# OSX
4148
.DS_Store
49+
/doc/
50+
/docs/
51+
/Meta/

DESCRIPTION

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: osqp
22
Title: Quadratic Programming Solver using the 'OSQP' Library
3-
Version: 0.6.3.3
4-
Date: 2024-06-07
3+
Version: 1.0.0
4+
Date: 2026-02-16
55
Authors@R: c(
66
person("Bartolomeo", "Stellato", role = c("aut", "ctb", "cph"),
77
email = "bartolomeo.stellato@gmail.com"),
@@ -11,18 +11,21 @@ Authors@R: c(
1111
person("Stephen", "Boyd", role = c("aut", "ctb", "cph")),
1212
person("Eric", "Anderson", role = c("ctb")),
1313
person("Vineet", "Bansal", role = c("aut", "ctb"), email = "vineetb@princeton.edu"),
14-
person("Balasubramanian", "Narasimhan", role = c("cre", "ctb"), email = "naras@stanford.edu"))
14+
person("Balasubramanian", "Narasimhan", role = c("cre", "aut"), email = "naras@stanford.edu"))
1515
Copyright: file COPYRIGHT
16-
Description: Provides bindings to the 'OSQP' solver. The 'OSQP' solver is a numerical optimization package or solving convex quadratic programs written in 'C' and based on the alternating direction method of multipliers. See <doi:10.48550/arXiv.1711.08013> for details.
16+
Description: Provides bindings to the 'OSQP' solver. The 'OSQP' solver is a numerical optimization package for solving convex quadratic programs written in 'C' and based on the alternating direction method of multipliers. See <doi:10.48550/arXiv.1711.08013> for details.
1717
License: Apache License 2.0 | file LICENSE
18-
SystemRequirements: C++17
19-
Imports: Rcpp (>= 0.12.14), methods, Matrix (>= 1.6.1), R6
18+
SystemRequirements: C++17, GNU make
19+
Imports: Rcpp (>= 0.12.14), methods, Matrix (>= 1.6.1), S7, cli
2020
LinkingTo: Rcpp
2121
Roxygen: list(markdown = TRUE)
22-
RoxygenNote: 7.2.3
22+
RoxygenNote: 7.3.3
2323
Collate: 'RcppExports.R' 'osqp-package.R' 'sparse.R' 'solve.R' 'osqp.R' 'params.R'
2424
NeedsCompilation: yes
25-
Suggests:
25+
VignetteBuilder: knitr
26+
Suggests:
27+
knitr,
28+
rmarkdown,
2629
slam,
2730
testthat
2831
Encoding: UTF-8

NAMESPACE

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
# Generated by roxygen2: do not edit by hand
22

3-
S3method(format,osqp_model)
4-
S3method(print,osqp_model)
3+
S3method("$",OSQP_Model)
4+
S3method(format,OSQP_Model)
5+
S3method(print,OSQP_Model)
56
export(osqp)
67
export(osqpSettings)
78
export(solve_osqp)
9+
import(S7)
810
importFrom(Matrix,sparseMatrix)
911
importFrom(Matrix,triu)
10-
importFrom(R6,R6Class)
1112
importFrom(Rcpp,sourceCpp)
1213
importFrom(methods,as)
1314
useDynLib(osqp, .registration=TRUE)

NEWS.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,29 @@
1+
# Version 1.0.0
2+
3+
## Breaking changes
4+
* Replaced R6 with S7 classes. Model methods are now accessed via `@`
5+
(e.g., `model@Solve()`) instead of `$`.
6+
* Renamed settings to match OSQP 1.0: `warm_start` -> `warm_starting`,
7+
`polish` -> `polishing`. The old names are accepted with deprecation
8+
warnings.
9+
10+
## New features
11+
* Upgraded OSQP C library from 0.6.3 to 1.0.0.
12+
* Added `WarmStart()` and `ColdStart()` methods for primal/dual warm
13+
starting.
14+
* New OSQP 1.0 settings: `rho_is_vec`, `check_dualgap`, `cg_max_iter`,
15+
`cg_tol_reduction`, `cg_tol_fraction`, `cg_precond`, `profiler_level`.
16+
* New solver info fields: `dual_obj_val`, `duality_gap`.
17+
18+
## Other changes
19+
* Added vignette with examples for lasso regression, portfolio
20+
optimization, and warm starting.
21+
* User-facing messages now use the `cli` package.
22+
* Vendored QDLDL v0.1.8 for CRAN compatibility.
23+
* OSQP C library printing now uses `Rprintf` instead of `printf`.
24+
* Declared GNU make in `SystemRequirements`.
25+
* `R CMD check` passes with `Status: OK`.
26+
127
# Version 0.6.3.2
228

329
* CMAKE file fixes per R-exts

R/RcppExports.R

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,7 @@ osqpWarmStart <- function(workPtr, x, y) {
3333
invisible(.Call(`_osqp_osqpWarmStart`, workPtr, x, y))
3434
}
3535

36+
osqpColdStart <- function(workPtr) {
37+
invisible(.Call(`_osqp_osqpColdStart`, workPtr))
38+
}
39+

R/osqp-package.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
#' @useDynLib osqp, .registration=TRUE
22
#' @importFrom Rcpp sourceCpp
3+
#' @import S7
34
NULL

0 commit comments

Comments
 (0)