-
Notifications
You must be signed in to change notification settings - Fork 85
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
clp.exe may crash. #274
Comments
Quadratic has not been kept up to date and "initialSolve" got confused. You will not get any advantages from -solve and I would suggest that you use -primals (or -barrier). |
Using -primalS, -dualS, -either to test.mps crashed clp.exe as did using -solve. However, when -barrier is used for test2.mps below, "Stopped on iterations or time" is output and the optimal solution cannot be obtained. Using anything other than -barrier gives the optimal solution. test2.mpsNAME TestConvexQP2 |
I managed to get first problem to error as described with some builds. Can't get it to error with master - that says - As it looks like a scaling/accuracy problem - how are you solving the problems? If you are creating an mps file then it would be better to create it with more accuracy writing values as exact representations of doubles (like formatType==2 in writeMps |
I am generating test cases in C#. I changed ToString() to ToString("R") as you advised. First, I generated test_R.mps with improved accuracy of test.mps. I then generated test2_R.mps, which is an improved version of test2.mps, and a new test case, test3.mps. test_R.mpsNAME TestConvexQPRoundTrip test3_R.mpsNAME TestConvexQPRoundTripInfeasible |
Looking at comments in barrier code, quadratic barrier seems a work in progress (or a mess to put it another way). As I said the initial solve part of Clp does not seem to have been updated for quadratic. Possibly the best solution is to keep it simple. There is an example testQP.cpp in Clp/examples which seems to work on all of your problems. |
I understand that the contents of testQP.cpp need to be included in clp.exe to solve quadratic, is my understanding correct? (I'm using a translation system, so I'm worried if I understand correctly. ) It's difficult for me, so I'd like to wait for it to be implemented someday. |
I have found a bug and will fix it. Clp primal minimises the true objective plus a large weight times the sum of infeasibilities. The user can set this weight but if the code finds that there is no objective it sets it to 1.0. With quadratic the code first solves the problem just with the linear objective and then starts using the quadratic objective. The bug was that it thought there was no objective (in linear part) and then leaves weight at 1.0. This can lead to problems. |
Just noticed that bug had already been fixed in master. |
Thanks for the additional information. I would like to experiment with my test case. |
clp.exe crashes with the following mps file when primalTolerance is small.
> clp.exe test.mps -primalTolerance 1e-6 -minimize -solve -solution result.txt
-> crashed.
> clp.exe test.mps -primalTolerance 1e-5 -minimize -solve -solution result.txt
-> didn't crash.
I tested with Clp-releases.1.17.8-w64-msvc16-md and Clp-releases.1.17.8-w64-msvc17-md.
test.mps
NAME TestConvexQP
ROWS
N OBJECT
G R1
G R2
G R3
G R4
G R5
G R6
G R7
G R8
G R9
G R10
G R11
G R12
G R13
G R14
COLUMNS
X1 OBJECT -6.33174068731535E-16
X1 R1 -1.38237231824552
X1 R2 2.57705493348984
X1 R3 0.893710887963403
X1 R4 -1.40467816181794
X1 R5 -0.74909952135441
X1 R6 -0.0750949408363687
X1 R7 -0.731082739214938
X1 R8 -1.38209298467333
X1 R9 2.57905334394858
X1 R10 1.05764436210498
X1 R11 -1.40458079066066
X1 R12 -0.746246377481727
X1 R13 -0.0780573394061342
X1 R14 -0.726226183869852
X2 OBJECT -5.69390793737391E-16
X2 R1 -0.0163560436138557
X2 R2 1.99468668353512
X2 R3 -2.08061722789719
X2 R4 -1.7452198444874
X2 R5 0.00576562468973074
X2 R6 1.72289997073075
X2 R7 0.00317872161630151
X2 R8 -0.0162427791511776
X2 R9 1.99549700105277
X2 R10 -2.01414531505974
X2 R11 -1.74518036233091
X2 R12 0.00692252038666297
X2 R13 1.72169877432745
X2 R14 0.00514796264702411
X3 OBJECT -6.14525791364784E-16
X3 R1 -0.128877715086185
X3 R2 1.37055762721054
X3 R3 -0.0716728882465328
X3 R4 -1.97720981439181
X3 R5 -0.319475756546151
X3 R6 0.00441989753315607
X3 R7 -0.315769691514621
X3 R8 -0.128659639793125
X3 R9 1.3721177832026
X3 R10 0.0563097245659944
X3 R11 -1.97713379687808
X3 R12 -0.317248311483645
X3 R13 0.00210715749555091
X3 R14 -0.311978186176328
X4 OBJECT -1.15098902631061E-15
X4 R1 -0.0432908552288926
X4 R2 1.07806573967557
X4 R3 0.327339448908376
X4 R4 -0.678501456388584
X4 R5 -1.35945672835786
X4 R6 0.106541328004554
X4 R7 -0.483422818595674
X4 R8 -0.0435646187786731
X4 R9 1.07610717831539
X4 R10 0.16667487337562
X4 R11 -0.678596885926302
X4 R12 -1.3622529794081
X4 R13 0.109444655169813
X4 R14 -0.488182532297562
X5 OBJECT -2.09684700158697E-16
X5 R1 -0.0993212094007268
X5 R2 0.0618017282483161
X5 R3 1.30352157601599
X5 R4 0.0265692044750114
X5 R5 -0.295791120941798
X5 R6 -1.93279732830741
X5 R7 -0.289370365468515
X5 R8 -0.0992885550823477
X5 R9 0.0620353440319846
X5 R10 1.32268553047975
X5 R11 0.0265805872413084
X5 R12 -0.295457586137262
X5 R13 -1.93314363507356
X5 R14 -0.288802630257806
X6 OBJECT 2.92300905702092E-16
X6 R1 -0.160617952702279
X6 R2 1.20755881297912
X6 R3 0.0441285699135943
X6 R4 -0.711979517569525
X6 R5 -0.552017697819496
X6 R6 0.0946476743325082
X6 R7 -1.40296588288707
X6 R8 -0.160254311772758
X6 R9 1.21016037580263
X6 R10 0.257539798818364
X6 R11 -0.711852758233496
X6 R12 -0.548303429313324
X6 R13 0.0907911763073798
X6 R14 -1.3966435411575
RHS
RHS1 R1 -37.6429498997557
RHS1 R2 97.2260867768474
RHS1 R3 92.1174211328235
RHS1 R4 -76.1564401334131
RHS1 R5 -78.9968183755308
RHS1 R6 -78.6017251879198
RHS1 R7 -78.9197383853335
RHS1 R8 -37.6327822133182
RHS1 R9 97.2988733287527
RHS1 R10 98.0872492496583
RHS1 R11 -76.1528955227783
RHS1 R12 -78.8929569832673
RHS1 R13 -78.7095974542488
RHS1 R14 -78.7429479316258
BOUNDS
FR BOUND X1
FR BOUND X2
FR BOUND X3
FR BOUND X4
FR BOUND X5
FR BOUND X6
QUADOBJ
X1 X1 0.14280365295569
X2 X1 0.112326679560112
X3 X1 -0.0123426882592386
X4 X1 0.0130221420022721
X5 X1 -0.00303279324360872
X6 X1 0.0214287229889673
X2 X2 0.287384690609157
X3 X2 -0.0105760572630717
X4 X2 0.0659032217822261
X5 X2 0.0136386481909511
X6 X2 0.0684447360576953
X3 X3 0.0186310316323555
X4 X3 -0.00534137201121943
X5 X3 0.00551850579515465
X6 X3 -0.00717579847817494
X4 X4 0.074974826336554
X5 X4 0.000161393296927416
X6 X4 -0.0160052249623282
X5 X5 0.0191971633222669
X6 X5 -0.0012507650563196
X6 X6 0.0684963196238557
ENDATA
The text was updated successfully, but these errors were encountered: