# A bit of help with the Quadratic Programming solver

5 messages
Open this post in threaded view
|

## A bit of help with the Quadratic Programming solver

 Hi everyone,This is the first time I'm using CGAL's QP solver and I ran into an issue where I don't get the expected result in a very simple scenario.I put everything on a document so it's easier for you to check it out (including minimal source code). The document is here: https://www.docdroid.net/jEFGEEt/cgal-qp.pdf (I didn't want to attach it, as I don't know if that's allowed)If someone could take a quick look at it and help me out I will greatly appreciate it. It may be something very trivial that I missed.Thank you all and best regards,Alex.
Open this post in threaded view
|

## Re: A bit of help with the Quadratic Programming solver

 Hello, 'D' must be a symmetric matrix (https://doc.cgal.org/latest/QP_solver/classCGAL_1_1Quadratic__program__from__iterators.html). Thus you matrix D should be ( 2 0.5 ( 0.5 1) and not (2 0) (1 1) That means:    double  D1[] = { 4.0, 1.0 };    double  D2[] = { 1.0, 2.0 }; and then you get    double  D1[] = { 4.0, 1.0 };    double  D2[] = { 1.0, 2.0 }; Best, Mael On 12/06/2019 01:25, Al Mo wrote: > Hi everyone, > > This is the first time I'm using CGAL's QP solver and I ran into an > issue where I don't get the expected result in a very simple scenario. > > I put everything on a document so it's easier for you to check it out > (including minimal source code). The document is here: > https://www.docdroid.net/jEFGEEt/cgal-qp.pdf (I didn't want to attach > it, as I don't know if that's allowed) > > If someone could take a quick look at it and help me out I will > greatly appreciate it. It may be something very trivial that I missed. > > Thank you all and best regards, > Alex. > -- You are currently subscribed to cgal-discuss. To unsubscribe or access the archives, go to https://sympa.inria.fr/sympa/info/cgal-discuss
Open this post in threaded view
|

## Re: A bit of help with the Quadratic Programming solver

 Bad copy paste, I meant : status:          OPTIMAL objective value: 60/32 variable values:    0: 1/4    1: 3/4 On 17/06/2019 09:16, Mael wrote: > Hello, > > 'D' must be a symmetric matrix > (https://doc.cgal.org/latest/QP_solver/classCGAL_1_1Quadratic__program__from__iterators.html). > Thus you matrix D should be > > ( 2 0.5 > ( 0.5 1) > > and not > > (2 0) > (1 1) > > That means: > >   double  D1[] = { 4.0, 1.0 }; >   double  D2[] = { 1.0, 2.0 }; > > and then you get > >   double  D1[] = { 4.0, 1.0 }; >   double  D2[] = { 1.0, 2.0 }; > > Best, > Mael > > On 12/06/2019 01:25, Al Mo wrote: >> Hi everyone, >> >> This is the first time I'm using CGAL's QP solver and I ran into an >> issue where I don't get the expected result in a very simple scenario. >> >> I put everything on a document so it's easier for you to check it out >> (including minimal source code). The document is here: >> https://www.docdroid.net/jEFGEEt/cgal-qp.pdf (I didn't want to attach >> it, as I don't know if that's allowed) >> >> If someone could take a quick look at it and help me out I will >> greatly appreciate it. It may be something very trivial that I missed. >> >> Thank you all and best regards, >> Alex. >> > -- You are currently subscribed to cgal-discuss. To unsubscribe or access the archives, go to https://sympa.inria.fr/sympa/info/cgal-discuss