bugGNU Octave - Bugs: bug #45324, optimization/qp.m: allow row...

 
 

bug #45324: optimization/qp.m: allow row vectors for argument q

Submitter:  Olaf Till <i7tiol>
Submitted:  Mon 15 Jun 2015 03:27:57 PM UTC
   
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Feature Request
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 15 Jun 2015 09:10:32 PM UTC, comment #3: 

I cleaned up the qp code signicantly on the development branch which included fixing the orientation issue for q and x0.  See changeset http://hg.savannah.gnu.org/hgweb/octave/rev/5c088348fddb.  Closing report.

Rik <rik5>
Group administrator
Mon 15 Jun 2015 08:03:57 PM UTC, comment #2: 

See attached.

A row vector x0 was accepted because _qp_ accepted it (but not a row vector q). Transformed both x0 and q in qp.m.patch anyway.

I meant that qp.m should also directly be callable with also q in both orientations, not only x0. So a vector is not guaranteed since it's direct user input.

(file #34228)

Olaf Till <i7tiol>
Group Member
Mon 15 Jun 2015 07:16:32 PM UTC, comment #1: 

Could you post a changeset, or indicate what you want changed?

The input processing for qp.m is


  if (nargs >= 3)
    q = varargin{1};
  else
    q = [];
  endif


which seems to accept either row or column.  Is 'q' guaranteed to be a vector (column or row)?  Then it is possible to change to


    q = varargin{1}(:);


which will guarantee a column vector.

I also don't see in the code that we are guaranteeing that x0 is a column vector.  Does qp really work regardless of the orientation of x0?

It doesn't appear that this multiplication would work correctly if x0 is a row vector.


    eq_infeasible = (n_eq > 0 && norm (A*x0-b) > rtol*(1+abs (b)));


Rik <rik5>
Group administrator
Mon 15 Jun 2015 03:27:57 PM UTC, original submission:  

Using quadprog of optim, which wraps qp, 'rocketsound' noticed that Matlab allows both column- and row-vectors for the coefficient of the linear term. qp should probably allow for row-vectors in this argument ('q'), since it already does allow for row-vectors in argument 'x0'. Could someone with write access make this minor change.

Olaf Till <i7tiol>
Group Member

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #34228:  qp.m.patch added by i7tiol (1KiB - 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 rik5 (Posted a comment)
  • -email is unavailable- added by i7tiol (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 group members can vote.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-06-15 rik5 StatusNone Fixed
        Open/ClosedOpen Closed
        Release4.0.0 dev
    2015-06-15 i7tiol Attached File- Added qp.m.patch, #34228

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code