Comments (1)
The issue appears to be that OSQP is not properly receiving the P
matrix. When I run your example code above, OSQP reports that nnz(A) + nnz(P) = 6
, which is obviously not correct since A
itself has 6 nonzeros. I think it has simply ignored P
for some reason.
If I replace your P
with
P <- Matrix(c(1, 0,0, 1e-10, 1,0, 0,0,1), 3, 3, sparse = TRUE)
and rerun, then I get nnz(P) + nnz(A) = 10
, which is correct (counting only the upper triangle of P
). I also get the solution [0.5 0.35 0.35]
, which also appears to be correct and matches the solution obtained from OSQP through our other language interfaces.
The underlying issue appears to be a failure to properly process P
because it is of type ddiMatrix
in your example, and OSQP only seems to understand it if it is of type dsCMatrix
. For example, this seems to work:
model <- osqp(forceSymmetric(P), q, A, l, u, settings)
res <- model$Solve()
As does this:
P <- as(as(P,"symmetricMatrix"),"dsCMatrix")
The user should not have to do that though. I'm not very familiar with R, so I will leave this open for now and come back to it as time permits, unless someone else can propose a fix.
from osqp-r.
Related Issues (18)
- Argument Inversion for Update-method HOT 1
- osqp package installation failed on CRAN HOT 3
- Inconsistency between version of python and R OSQP HOT 2
- osqpSettings Bug HOT 6
- osqp does not always return the same result eventhough parameters are unchanged HOT 4
- Problem installing package on Mac Catalina/R 4.0.1 HOT 10
- Time_limit in osqpSettings HOT 5
- Creating `private$.work` using compiled code prevents the ability to parallelize `osqp` in R HOT 1
- R-package is going to be archived HOT 8
- Move R-specific interface code from main library to R interface repo HOT 2
- Infeasible problems cause R to crash HOT 4
- Dual infeasible problem when using Inf as upper limit HOT 1
- please upgrade to new osqp HOT 3
- Add functions to update matrices P and A HOT 1
- Using OSQP in C with R package as dependency HOT 3
- what is the format of problem using OSQP-R HOT 4
- why I get negative result for non-negative variables? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from osqp-r.