bugGNU Octave - Bugs: bug #36015, unexpected sqp error


bug #36015: unexpected sqp error

Submitted by:  John W. Eaton <jwe>
Submitted on:  Tue Mar 27 15:28:12 2012  
Category: Octave FunctionSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Regression
Status: FixedAssigned to: Lachlan Andrew <lachlan>
Originator Name: Open/Closed: Closed
Release: devOperating System: GNU/Linux

Add a New Comment (Rich MarkupRich Markup):

You are not logged in

Please log in, so followups can be emailed to you.


(Jump to the original submission Jump to the original submission)

Mon Mar 27 21:57:12 2017, comment #7:

No response. I believe this now works in dev withhout patching. Closing report.

Rik <rik5>
Project Administrator
Mon Mar 13 05:58:26 2017, comment #6:

@Ben: Could you re-test your example from comment #4 on a current tip? It seems to work for me without any modification.

I think the original demonstration code from an e-mail to jwe contains an error. The qp function is invoked as

But the documentation is

I don't see a 6-input calling form which makes me think the example itself is bad rather than Octave.

Rik <rik5>
Project Administrator
Mon Feb 13 01:04:09 2017, comment #5:

I haven't studied how qp() works and don't know if this is a proper solution, but it allows my example and jwe's to work.

(file #39748)

Ben Abbott <bpabbott>
Project Member
Sun Feb 12 20:39:55 2017, comment #4:

I came across a bug introduced by Lacklan's changeset.

I'm attaching a simple script that triggers the error (something to do with the values of the upper bounds requiring an equality constraint).

I'm not familiar with glpk.m, qp.m, and sqp.m, but reversing the qp.m portion of Lacklan's changeset fixed the problem for me.

I'm re-opening and marking it as a regression.

Lacklan, any insight into this?

(file #39742)

Ben Abbott <bpabbott>
Project Member
Mon Aug 8 22:13:47 2016, comment #3:

@Lachlan: I pushed your patch here http://hg.savannah.gnu.org/hgweb/octave/rev/20e0c0b8820c. This must have been one of the first patches you wrote since I corrected syntax things like using '%' as the comment character. Thanks for all the help with these old reports.

Rik <rik5>
Project Administrator
Sat Feb 27 05:23:14 2016, comment #2:

There seem to be two problems here.

The clearest problem is that qp.m uses the wrong size matrices for C and the lower bound. From the comments in the code, Ain must have n columns (as it is multiplied by x), but a value of n-n_eq was being used.

I don't really understand the algorithm, so I can't confirm that that is the only bug, but since it is just changing the size of a vector of zeros or infinities, I assume that is the right fix.

Once that is fixed, qp returns an infeasible solution, and returns lambda=[]. This causes an error in sqp, so this patch sets lambda to its previous value if qp returns an infeasible solution. A warning is shown anyway, so the user knows not to trust the results; this just prevents an inexplicable error.

It would be great if someone who understands this code could check the changes.

(file #36487)

Lachlan Andrew <lachlan>
Project MemberIn charge of this item.
Fri Nov 8 21:38:30 2013, comment #1:

The problem is still here in Octave 3.7.7+ (3851e5fde76d)

Julien Bect <jbect>
Tue Mar 27 15:28:12 2012, original submission:

The following code

results in the error:

I found this bug report in an old set of messages that were never correctly posted to the -unavailable- mailing list.
Sorry for not posting it before now.

John W. Eaton <jwe>
Project Administrator


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):

Attached Files
file #39748:  changeset.patch added by bpabbott (2kB - application/octet-stream)
file #39742:  test_qp.m added by bpabbott (231B - application/octet-stream)
file #36487:  bug_36015_sqp.cset added by lachlan (3kB - text/x-diff)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by bpabbott (Updated the item)
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by lachlan (Updated the item)
  • -unavailable- added by jbect (Posted a comment)
  • -unavailable- added by mtmiller (Updated the item)
  • -unavailable- added by jwe (Submitted the item)
  • -unavailable- added by jwe

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follow 16 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon Mar 27 21:57:12 2017rik5StatusNeed Info=>Fixed
    Mon Feb 13 01:04:09 2017bpabbottAttached File-=>Added changeset.patch, #39748
    Sun Feb 12 20:39:55 2017bpabbottAttached File-=>Added test_qp.m, #39742
      Item GroupIncorrect Result=>Regression
      StatusFixed=>Need Info
    Mon Aug 8 22:13:47 2016rik5StatusPatch Submitted=>Fixed
    Sat Feb 27 05:23:14 2016lachlanAttached File-=>Added bug_36015_sqp.cset, #36487
      StatusConfirmed=>Patch Submitted
      Assigned toNone=>lachlan
    Mon Oct 28 02:50:04 2013mtmillerCategoryLibraries=>Octave Function
    Tue Mar 27 15:28:12 2012jweCarbon-Copy-=>Added -unavailable-

    Back to the top

    Powered by Savane 3.1-cleanup1