-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #35 from osqp/release_0.6.3
Release 0.6.3
- Loading branch information
Showing
18 changed files
with
195 additions
and
130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
Package: osqp | ||
Title: Quadratic Programming Solver using the 'OSQP' Library | ||
Version: 0.6.0.8 | ||
Date: 2023-01-30 | ||
Version: 0.6.3 | ||
Date: 2023-10-02 | ||
Authors@R: c( | ||
person("Bartolomeo", "Stellato", role = c("aut", "ctb", "cph"), | ||
email = "[email protected]"), | ||
|
@@ -16,11 +16,13 @@ Copyright: file COPYRIGHT | |
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 <arXiv:1711.08013> for details. | ||
License: Apache License 2.0 | file LICENSE | ||
SystemRequirements: C++17 | ||
Imports: Rcpp (>= 0.12.14), methods, Matrix, R6 | ||
Imports: Rcpp (>= 0.12.14), methods, Matrix (>= 1.6.1), R6 | ||
LinkingTo: Rcpp | ||
RoxygenNote: 7.2.1 | ||
Collate: 'RcppExports.R' 'osqp-package.R' 'solve.R' 'osqp.R' 'params.R' | ||
Roxygen: list(markdown = TRUE) | ||
RoxygenNote: 7.2.3 | ||
Collate: 'RcppExports.R' 'osqp-package.R' 'sparse.R' 'solve.R' 'osqp.R' 'params.R' | ||
NeedsCompilation: yes | ||
Suggests: testthat | ||
Encoding: UTF-8 | ||
BugReports: https://github.com/osqp/osqp-r/issues | ||
URL: https://osqp.org |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
## Created by @naras to address coercion considerations with Matrix package | ||
## | ||
## Inspired by Rsymphony package from | ||
## Kurt Hornik and Stefan Theussl and Reinhard Harter | ||
## | ||
|
||
#' Ensure that a matrix is column-sparse format (class `dgCMatrix`) | ||
#' @param m a C sparse matrix or coercible object such as a matrix or simple triplet matrix | ||
#' @return a sparse matrix of class `dgCMatrix` | ||
#' @importFrom Matrix sparseMatrix | ||
#' @importFrom methods as | ||
#' @noRd | ||
ensure_dgc_matrix <- function(m) { | ||
if (inherits(m, "dgCMatrix")) { | ||
m | ||
} else if (inherits(m, "matrix")) { | ||
Matrix::.m2sparse(m, "dgCMatrix") | ||
} else if(inherits(m, "simple_triplet_matrix")) { ## e.g. from package slam | ||
## The matrix method assumes that indices for non-zero entries are | ||
## in row-major order, but the simple_triplet_matrix() constructor | ||
## currently does not canonicalize accordingly ... | ||
ind <- order(m$j, m$i) | ||
Matrix::sparseMatrix(p = c(0L, cumsum(tabulate(m$j[ind], m$ncol))), | ||
i = m$i[ind] - 1L, | ||
values = m$v[ind], dims = dim(m), index1 = FALSE) | ||
} else { | ||
## Resort to brute force | ||
as(as(as(m, "CsparseMatrix"), "generalMatrix"), "dMatrix") | ||
} | ||
} | ||
|
||
#' Ensure that a matrix is column-sparse format upper triangular (class `dtCMatrix`) | ||
#' @param m a C sparse upper triangular matrix or coercible object such as a matrix or simple triplet matrix | ||
#' @return a sparse matrix of class `dgCMatrix` | ||
#' @importFrom Matrix sparseMatrix triu | ||
#' @importFrom methods as | ||
#' @noRd | ||
ensure_dtc_matrix <- function(m) { | ||
if (inherits(m, "dgCMatrix")) { | ||
m | ||
} else if (inherits(m, "matrix")) { | ||
Matrix::.m2sparse(m, "dtCMatrix") | ||
} else if(inherits(m, "simple_triplet_matrix")) { ## e.g. from package slam | ||
ind <- which(m$i <= m$j) | ||
x <- list(i = m$i[ind] + 1L, j = m$j[ind] + 1L) ##make it 1-based | ||
values <- m$v[ind] | ||
ind <- order(x$j, x$i) ## may not be needed | ||
Matrix::sparseMatrix(p = c(0L, cumsum(tabulate(x$j[ind], m$ncol))), | ||
i = x$i[ind] - 1L, | ||
values = values, | ||
dims = dim(x), index1 = FALSE, | ||
triangular = TRUE) | ||
} else { | ||
## Resort to brute force | ||
Matrix::triu(as(as(as(m, "CsparseMatrix"), "generalMatrix"), "dMatrix")) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.