# HG changeset patch # User John W. Eaton # Date 1208983180 14400 # Node ID 6f2b2cc4b957669d4f7b80622cc600b5cd10a361 # Parent 13820b9f5fd9c15cea7639bf9b71ffb34c2fa61d __qp__.cc: avoid bounds error when removing constraint from active set diff --git a/src/ChangeLog b/src/ChangeLog --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,8 @@ 2008-04-23 John W. Eaton + * DLD-FUNCTIONS/__qp__.cc (qp): Avoid bounds error when removing + constraint from active set. + * lex.l (text_yyinput): New function. Use it in place of yyinput. (next_token_is_sep_op, scan_for_comments, eat_whitespace, have_continuation): No need to check for CR or CRLF. diff --git a/src/DLD-FUNCTIONS/__qp__.cc b/src/DLD-FUNCTIONS/__qp__.cc --- a/src/DLD-FUNCTIONS/__qp__.cc +++ b/src/DLD-FUNCTIONS/__qp__.cc @@ -357,6 +357,7 @@ // At least one multiplier is negative, we // remove it from the set. + n_act--; for (octave_idx_type i = which_eig; i < n_act - n_eq; i++) { Wact(i) = Wact(i+1); @@ -364,7 +365,6 @@ Aact(n_eq+i,j) = Aact(n_eq+i+1,j); bact(n_eq+i) = bact(n_eq+i+1); } - n_act--; // Resizing the active set. Wact.resize (n_act-n_eq);