| Version: | 1.0-2 | 
| Title: | 'osqp' Plugin for the 'R' Optimization Infrastructure | 
| Description: | Enhances the 'R' Optimization Infrastructure ('ROI') package with the quadratic solver 'OSQP'. More information about 'OSQP' can be found at https://osqp.org. | 
| Imports: | methods, slam, ROI (≥ 1.0-1), osqp, Matrix | 
| License: | GPL-3 | 
| URL: | https://roigrp.gitlab.io, https://gitlab.com/roigrp/solver/ROI.plugin.osqp | 
| NeedsCompilation: | no | 
| Packaged: | 2024-07-18 18:52:17 UTC; f | 
| Author: | Florian Schwendinger | 
| Maintainer: | Florian Schwendinger <FlorianSchwendinger@gmx.at> | 
| Repository: | CRAN | 
| Date/Publication: | 2024-07-18 19:10:06 UTC | 
osqp
Description
This package provides an interface to OSQP.
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.
Control Arguments
The following description of the control parameters is mostly copied from the osqp manual.
- [] - rhoADMM step rho
- [] - sigmaADMM step sigma
- [] - max_itermaximum iterations
- [] - abs_tolabsolute convergence tolerance
- [] - rel_tolrelative convergence tolerance
- [] - eps_prim_infprimal infeasibility tolerance
- [] - eps_dual_infdual infeasibility tolerance
- [] - alpharelaxation parameter
- [] - linsys_solverwhich linear systems solver to use, 0=QDLDL, 1=MKL Pardiso
- [] - deltaregularization parameter for polish
- [] - polishboolean, polish ADMM solution
- [] - polish_refine_iteriterative refinement steps in polish
- [] - verboseboolean, write out progress
- [] - scaled_terminationboolean, use scaled termination criteria
- [] - check_terminationinteger, check termination interval. If 0, termination checking is disabled
- [] - warm_startboolean, warm start
- [] - scalingheuristic data scaling iterations. If 0, scaling disabled
- [] - adaptive_rhocboolean, is rho step size adaptive?
- [] - adaptive_rho_intervalNumber of iterations between rho adaptations rho. If 0, it is automatic
- [] - adaptive_rho_toleranceTolerance X for adapting rho. The new rho has to be X times larger or 1/X times smaller than the current one to trigger a new factorization
- [] - adaptive_rho_fractionInterval for adapting rho (fraction of the setup time)
References
Bartolomeo Stellato and Goran Banjac and Paul Goulart and Alberto Bemporad and Stephen Boyd.
OSQP: An Operator Splitting Solver for Quadratic Programs
https://arxiv.org/abs/1711.08013, 2017
Bartolomeo Stellato and Goran Banjac. OSQP “webpage”
https://osqp.org/, 2019
Quadratic Problem 1
Description
maximize \ \ x_1^2 + x_2^2 + x_3^2 - 5 x_2
subject \ to:
-4 x_1 - 3 x_2 +     \geq -8
 2 x_1 +   x_2 +     \geq 2
       - 2 x_2 + x_3 \geq 0
x_1, x_2, x_3 \geq 0
Examples
require("ROI")
require("ROI.plugin.osqp")
A <- cbind(c(-4, -3, 0), 
           c( 2,  1, 0), 
           c( 0, -2, 1))
x <- OP(Q_objective(diag(3), L =  c(0, -5, 0)),
        L_constraint(L = t(A),
                     dir = rep(">=", 3),
                     rhs = c(-8, 2, 0)))
opt <- ROI_solve(x, solver = "osqp", abs_tol = 1e-8, rel_tol = 1e-8)
opt
## Optimal solution found.
## The objective value is: -2.380952e+00
solution(opt)
## [1] 0.4761905 1.0476191 2.0952381