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 ORCID iD [aut, cre]
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.

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

mirror server hosted at Truenetwork, Russian Federation.