bugGNU Octave - Bugs: bug #29989, sqp treats empty lb & ub...

 
 

bug #29989: sqp treats empty lb & ub incorrectly

Submitted by:  Leo Butler <l_butler>
Submitted on:  Sat 29 May 2010 10:34:42 AM UTC  
 
Category: LibrariesSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: FixedAssigned to: None
Originator Name: Open/Closed: Closed
Release: devOperating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Wed 02 Jun 2010 11:39:13 PM UTC, comment #4:

Thanks for doing this. The overhaul has improved the documentation quite a bit, in addition to fixing my original report.

(ps. the output in the documentation example lists incorrect values for iter and nf.)

Leo Butler <l_butler>
Wed 02 Jun 2010 06:57:56 PM UTC, comment #3:

I overhauled the code in addition to adding your patch. The changeset is 10678:35338deff753.

Rik <rik5>
Project Administrator
Tue 01 Jun 2010 09:01:05 AM UTC, comment #2:

The documentation says the code treats empty and unspecified bounds in the same way. It does not. How to treat the inconsistency? I think that it is generally preferable not to add noise. In this case, adding +-REALMAX bounds in either case seems to me to be adding noise. If a user wants +-REALMAX bounds, this can be specified. I think the correct behaviour is embodied in the patch. The documentation can be patched to reflect this.

Leo

Leo Butler <l_butler>
Mon 31 May 2010 10:55:23 PM UTC, comment #1:

According to the documentation:

The fifth and sixth arguments are vectors containing lower and upper bounds on X. These must be consistent with equality and inequality constraints G and H. If the bounds are not specified, or are empty, they are set to -REALMAX and REALMAX by default.

So the code properly reflects the documentation. I can see that this does lead to a difference between calling sqp with 4 arguments and sqp with 6 or more arguments. However, wouldn't the proper fix be to initialize the lb and ub vectors to -/+ REALMAX for the 4 argument case since they are, in effect, empty?

Rik <rik5>
Project Administrator
Sat 29 May 2010 10:34:42 AM UTC, original submission:

sqp(x0,@f,@g,[])
and
sqp(x0,@f,@g,[],[],[])
solve the same optimisation problem, but the latter produces different output and runs differently. This is because the code sets lb (ub) to a vector of length(x0) with entries -Inf (Inf). This is unnecessary and undocumented behaviour.

I have attached a patch to correct this.

Leo Butler <l_butler>

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #20650:  sqp.m.diff added by l_butler (429B - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by l_butler (Submitted the item)
  •  

    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 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 02 Jun 2010 06:57:56 PM UTCrik5StatusNeed Info=>Fixed
      Open/ClosedOpen=>Closed
    Mon 31 May 2010 10:55:23 PM UTCrik5StatusNone=>Need Info
    Sat 29 May 2010 10:34:42 AM UTCl_butlerAttached File-=>Added sqp.m.diff, #20650

    Back to the top


    Powered by Savane 3.1-cleanup1