Mercurial > hg > octave-nkf
changeset 6860:8057825b748f
[project @ 2007-09-04 16:54:19 by jwe]
author | jwe |
---|---|
date | Tue, 04 Sep 2007 16:54:19 +0000 |
parents | 5fddcbbe880e |
children | 32558239ed9e |
files | src/ChangeLog src/DLD-FUNCTIONS/__qp__.cc |
diffstat | 2 files changed, 8 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2007-09-04 Gabriele Pannocchia <g.pannocchia@ing.unipi.it> + + * DLD-FUNCTIONS/__qp__.cc (qp): Use Wact(j) == i - n_eq when + checking for blocking constraint. Don't resize lambda_tmp. Only + compute Y = Aact.pseudo_inverse () if it is needed. + 2007-08-31 Michael Goffioul <michael.goffioul@gmail.com> * ls-mat-ascii.cc (get_lines_and_columns): Check beg variable for
--- a/src/DLD-FUNCTIONS/__qp__.cc +++ b/src/DLD-FUNCTIONS/__qp__.cc @@ -227,9 +227,6 @@ // FIXME -- still remain to handle the case of // non-full rank active set matrix. - // Computing the Y matrix (orthogonal to Z) - Y = Aact.pseudo_inverse (); - // Reduced Hessian Matrix Zt = Z.transpose (); Matrix rH = Zt * H * Z; @@ -317,16 +314,10 @@ // Computing the multipliers only for the inequality // constraints that are active. We do NOT compute // multipliers for the equality constraints. + Y = Aact.pseudo_inverse (); Matrix Yt = Y.transpose (); Yt = Yt.extract_n (n_eq, 0, n_act-n_eq, n); lambda_tmp = Yt * (g + H * p); - if (n_act - n_eq < n_in) - { - lambda_tmp.resize (n_in, 0.0); - - for (octave_idx_type i = n_act-n_eq; i < n_in; i++) - lambda_tmp(i) = 0; - } // Checking the multipliers. We remove the most // negative from the set (if any). @@ -389,7 +380,7 @@ for (octave_idx_type j = 0; j < n_act-n_eq; j++) { - if (Wact(j) == i) + if (Wact(j) == i - n_eq) { found = true; break;