liuq / QuadProgpp

A C++ library for Quadratic Programming which implements the Goldfarb-Idnani active-set dual method.
MIT License
285 stars 88 forks source link

error in cholesky decomposition #18

Open Leon-LXA opened 4 years ago

Leon-LXA commented 4 years ago

A: 317.581, -1111.92, 1335.92, -559.314, 2.60613, -0.871816, 0.158151, 15.8451, -1111.92, 186.374, -559.36, 464.094, 4.41254, -1.00695, -189.075, 94.5768, 1335.92, -559.36, 146.708, -366.74, 4.43254, 720.777, -721.521, 216.315, -559.314, 464.094, -366.74, 209.297, -839.967, 1263.82, -844.813, 211.691, 2.60613, 4.41254, 4.43254, -839.967, 3.18509, -7.06707, 5.73606, -1.61993, -0.871816, -1.00695, 720.777, 1263.82, -7.06707, 4.86313e-05, -6.33977e-05, 1.81698e-05, 0.158151, -189.075, -721.521, -844.813, 5.73606, -6.33977e-05, 1.49813e-05, -1.12109e-06, 15.8451, 94.5768, 216.315, 211.691, -1.61993, 1.81698e-05, -1.12109e-06, 100804 terminate called after throwing an instance of 'std::logic_error' what(): Error in cholesky decomposition, sum: -1.80194e-11

Process finished with exit code 134 (interrupted by signal 6: SIGABRT)

MorePanda123 commented 2 years ago

I have the similar problem. I use the same parameters in MATLAB quadprog function, but it found the minimum.

jia-xinyu commented 1 year ago

Check the "G" matrix is a symmetric matrix or not.

liuq commented 1 year ago

I have the similar problem. I use the same parameters in MATLAB quadprog function, but it found the minimum.

Since the matrix is not definite positive (the error is about that) the Goldfarb-Idnani method does not work, maybe MATLAB quadprog uses a different algorithm handling also semi-definite matrices (but recall that in that case the minimum found might be not the global one).