octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: RFC: quadprog/lsqlin with __qp__ (Re: GSoC 2015, optim)


From: Olaf Till
Subject: Re: RFC: quadprog/lsqlin with __qp__ (Re: GSoC 2015, optim)
Date: Mon, 13 Jul 2015 21:32:27 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

Hi Asma,

On Sun, Jul 12, 2015 at 05:11:00PM -0700, AsmaA wrote:
> Hi Olaf,
> 
> 
> Olaf Till-2 wrote
> > Since there was no comment by others, we better don't rely on changes
> > in qp.m. And although they are principally possible and harmful to our
> > purpous, interface changes of __qp__.m seem unlikely. So let's wrap
> > __qp__.m.
> 
> I have wrapped quadprog on __qp__. Could you please review the code in [1]
> and suggest changes.
> 
> The variable mapping in the code may be confusing so I am stating it here:
> 
> qp     |  quadprog
> 
> A       |  Aeq (Equality constraint matrix input)
> A_in  |  A_in (Inequality constraint matrix input)
> Ain    |  A  (Inequality constraint matrix including bounds)
> A_ub  | b_in (Vector of constants corresponding the input inequality
> constraints)
> bin     | b (Vector of constants including the bounds)
> 
> Changes that require your attention:
> 
> 1- Copyright notice- I have retained the original notice. Should I include
> the authors of qp.m as well?

Given the current code the authors of qp.m must be included, by my
name must not be included into the copyright.

> 2- Check for empty A_in and/or A_ub in qp.m- Currently not present in qp (it
> throws an error-its probably ok for qp as these are the last input arguments
> so apparently no need to pass empty arguments.)

Not sure if I understand the problem -- if A and b are not the last
arguments, of course it should be checked whether they are empty ...

But currently it is accepted if one of A and b is empty and the other
not. What's the sense in this?

> 3- Ordering of lambda:
>     - The order of lambda vector output (qp_lambda) from __qp__(in my code)
> is [equality constraints; inequality constraints; lower bounds; upper
> bounds]. The multipliers are present if the constraints are given as inputs
> so the size of qp_lambda depends on the size of constraints. Variables
> idx_ineq, idx_lb and idx_ub make sure I pick the right values.
> 
> I have added several examples in runquadprog.m [2].

Running the example which is not commented out, I get

...
lb = -0.1*ones(4,1);
...
[x,obj,flag,op,lambda]=quadprog(C'*C,-C'*d,A,b,Aeq,beq,lb,ub)
x =

  -0.10000
  -0.10000
   0.15991
   0.40896
...
lambda =

  scalar structure containing the fields:

    lower =

       0.06743
       0.00000
       0.24993
       0.00000
...

which indicates an error in the ordering of lambda for lower bounds.

Regards,

Olaf

-- 
public key id EAFE0591, e.g. on x-hkp://pool.sks-keyservers.net

Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]