Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solver Produces Incorrect Solutions #4

Closed
user2552 opened this issue Apr 30, 2018 · 3 comments
Closed

Solver Produces Incorrect Solutions #4

user2552 opened this issue Apr 30, 2018 · 3 comments

Comments

@user2552
Copy link

I have attached a minimal example that demonstrates issues with quadprog.

The solution to this QP should be equal to the value of c, but quadprog sets x to nan.

#include "eigen-qp.hpp"
#include <Eigen/Core>
#include <iostream>
using namespace std;

int main(int argc, char **argv){
   Eigen::Matrix<double, 2,1> x;
   Eigen::Matrix<double, 2,2> Q = 2*Eigen::Matrix<double, 2,2>::Identity();
   Eigen::Matrix<double, 2,1> c = 2*Eigen::Matrix<double, 2,1>::Random();
   Eigen::Matrix<double, 2,2> A; A << 0,0,0,0; 
   
   Eigen::Matrix<double, 2,1> b; b << 1.0,1.0;
   
   EigenQP::quadprog(Q,c,A,b,x);
   cout << x << endl;

}

@costashatz
Copy link

Hello @jarredbarber! Thanks for the awesome library.

Any news on this? Did someone find a solution?

I traced the issue and it comes from here.

@jarredbarber
Copy link
Owner

No news; I haven't had time to work on this, but if you have any ideas feel free to submit a PR.

@jarredbarber
Copy link
Owner

This is fixed now. There were some math mistakes that (IIRC) were fixed in a version that never got pushed to Github.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants