bugGNU Octave - Bugs: bug #32008, sqp: Don't set upper/lower bound...


bug #32008: sqp: Don't set upper/lower bound unless specified

Submitter:  Rik <rik5>
Submitted:  Wed 29 Dec 2010 07:34:15 PM UTC
Category:  Octave Function Severity:  2 - Minor
Priority:  5 - Normal Item Group:  Performance
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  9.1.0 (current stable) Planned Release:  9.1.0 (current stable)
* Mandatory Fields

Add a New Comment Rich Markup

Jump to the original submission

Fri 20 Jan 2023 04:05:13 AM UTC, comment #16: 

No complaints or problem reports in over a month. Closing as fixed.

Arun Giridhar <arungiridhar>
Group Member
Thu 08 Dec 2022 08:25:18 PM UTC, comment #15: 

realized never circled back to this.  still pushes clean to default and passes all tests. examples still behave as expected. I couldn't find an example problem that ran differently or broke anything, likely because previously setting bounds to +/- realmax never came into play unless there was another issue with the problem.

pushing to default as

marking as ready for test, and if all is well it should close out this old report.

Nicholas Jankowski <nrjank>
Group Member
Thu 24 Dec 2020 04:08:59 AM UTC, comment #14: 

Attached is an updated version of Julien's patch for the last remaining sqp item 2. (minor tweak to apply clean. it really only needed some line shifts). 

Looking at what the patch does: it replaces the previous upper and lower bound definitions of +/-realmax/min with +/-Inf in the main function, and cleans up the error check for any(lb>ub).

the subfun cf_ub_lb previously eval'd the constraint function and upper and lower bound for a give x. it had diff codepaths based on whether cifcn was empty or not. (the previous +/-realmax setting meant ub and lb were never empty.) Now that either of them could be empty (since Infs produce an empty globals.ub/lb), it breaks out the evaluation into three separate ifs, and returns empty when appropriate.

added a couple comments. couldn't find any examples that break it and still passes input validation and all tests.

(file #50559, file #50560)

Nicholas Jankowski <nrjank>
Group Member
Sun 03 Jul 2016 11:48:50 AM UTC, comment #13: 

Retagging from "Patch submitted" to "In progress".

Lachlan Andrew <lachlan>
Sun 03 Jul 2016 11:48:13 AM UTC, comment #12: 


Julien, would you like this patch to be considered for 4.2.0?  If so, please explain it more fully?

Lachlan Andrew <lachlan>
Sun 29 Nov 2015 05:41:20 PM UTC, comment #11: 

Extra comments might help.  I looked at the patch a long time ago and didn't feel I understood it well enough to commit.

Rik <rik5>
Group administrator
Sun 29 Nov 2015 09:35:32 AM UTC, comment #10: 


I'm going through old patches that haven't yet been committed.  Yours looks great!

I don't understand your modifications to  cf_ub_lb.  Could you please add a comment to the code explaining the meanings of the input and output variables?  (Improving the internal documentation is my other pet project...)


Lachlan Andrew <lachlan>
Sat 06 Dec 2014 07:38:54 PM UTC, comment #9: 


I have proposed a patch for item #2 (a long time ago, see below).

Have you looked at it ? Is there anything that needs to be improved before the patch can be applied ?


Julien Bect <jbect>
Thu 23 Jan 2014 05:38:46 PM UTC, comment #8: 

I re-titled the report to be specific about item #2 being the remaining issue to address.

Rik <rik5>
Group administrator
Thu 23 Jan 2014 04:40:26 PM UTC, comment #7: 

This is an old bug report, that lumps together four different issues related to sqp...

Items #1 and #4 have been dealt with.

A patch has been proposed for item #2 (see below).

Item #3 is still pending, but this is more a feature request than a bug report.

I suggest closing this old bug report, and re-opening a "feature request" ticket for issue #3 (and perhaps another ticket for item #2, if my patch is not deemed satisfactory).

Julien Bect <jbect>
Sat 11 Jan 2014 05:18:47 PM UTC, comment #6: 

I applied the patch that defines a new return code here (http://hg.savannah.gnu.org/hgweb/octave/rev/f58a6cd3f909).

Rik <rik5>
Group administrator
Fri 20 Dec 2013 07:48:53 AM UTC, comment #5: 

Hey Arun,

No need to post on the path tracker I think, your patch clearly belongs to this bug report.


Julien Bect <jbect>
Fri 20 Dec 2013 12:13:30 AM UTC, comment #4: 

Here's a patch for Item 1 (distinguish between convergence and small step size). New return value for small step size is 104. Normal convergence remains 101. I will post this to the patch tracker as well.

(file #30049)

Arun Giridhar <arungiridhar>
Group Member
Wed 13 Nov 2013 08:47:03 PM UTC, comment #3: 

Here is a patch for Item 2 (missing bounds set to +/- REALMAX).

(file #29613)

Julien Bect <jbect>
Wed 13 Nov 2013 07:50:25 PM UTC, comment #2: 

Item 4 of this bug report has been dealt with in changeset 11a9d448fdc3 ("Get rid of global variables in sqp.").


Julien Bect <jbect>
Mon 11 Nov 2013 07:41:23 AM UTC, comment #1: 

Item 3 of this bug report is redundant with bug #32717.

Julien Bect <jbect>
Wed 29 Dec 2010 07:34:15 PM UTC, original submission:  

This bug report exists to keep track of 4 improvements that need to be made to sqp.  There is not enough time before the 3.4 release to tackle these now.

1) The return success code of 101 can be reached by two paths in the code.  One path is a "true" success where all constraints are met.  The other path is where the algorithm has stopped making progress because the stepsize has become too small.  This second path should use a different return code because the result is not necessarily success.

2) When only one bound, upper or lower, is set the other defaults to -/+ REALMAX.  This is unnecessary and undesirable.  If no bound is set, no bound, even if very large, should be used.

3) If the function call to qp fails then the sqp code also fails.  There should be a method to recover if the qp step alone fails.

4) The use of global variables should be eliminated.  This prevents sqp from being called recursively and generally makes the code difficult to understand and maintain.

Rik <rik5>
Group administrator


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

Attach Files:

Attached Files
file #50559:  sqp_ublb_update.patch added by nrjank (4KiB - application/octet-stream - sqp patch and patched function to treat unspecified upper/lower bounds as bounds out at infinity)
file #50560:  sqp.m added by nrjank (20KiB - text/plain - sqp patch and patched function to treat unspecified upper/lower bounds as bounds out at infinity)
file #30049:  sqp.diff added by arungiridhar (2KiB - text/x-patch)
file #29613:  jbPatchSQP1.patch added by jbect (4KiB - text/x-patch)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by nrjank (Updated the item)
  • -email is unavailable- added by lachlan (Posted a comment)
  • -email is unavailable- added by mtmiller (Updated the item)
  • -email is unavailable- added by arungiridhar (Updated the item)
  • -email is unavailable- added by jbect (Posted a comment)
  • -email is unavailable- added by rik5 (Submitted the item)

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only project members can vote.


    Follow 15 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2023-01-20 arungiridhar StatusReady For Test Fixed
        Open/ClosedOpen Closed
        Fixed ReleaseNone 9.1.0 (current stable)
    2022-12-08 nrjank StatusPatch Submitted Ready For Test
        Operating SystemGNU/Linux Any
        Planned ReleaseNone 9.1.0 (current stable)
    2021-11-15 nrjank StatusIn Progress Patch Submitted
    2020-12-24 nrjank Attached File- Added sqp.m, #50560
    2020-12-24 nrjank Attached File- Added sqp_ublb_update.patch, #50559
    2016-07-03 lachlan StatusPatch Submitted In Progress
    2014-01-23 rik5 Summarysqp improvements needed sqp: Don't set upper/lower bound unless specified
    2014-01-11 mtmiller CategoryLibraries Octave Function
        StatusNone Patch Submitted
    2013-12-20 arungiridhar Attached File- Added sqp.diff, #30049
    2013-11-13 jbect Attached File- Added jbPatchSQP1.patch, #29613

    Back to the top

    Powered by Savane 3.12.
    Corresponding source code