# HG changeset patch # User jwe # Date 1176404804 0 # Node ID 589c8dbba9162fb0346fb5d960f1ffa2fc1ce0dd # Parent 475c83367a0e64598a8bad57e418ab8e6412854e [project @ 2007-04-12 19:06:44 by jwe] diff -r 475c83367a0e -r 589c8dbba916 scripts/ChangeLog --- a/scripts/ChangeLog Thu Apr 12 15:42:02 2007 +0000 +++ b/scripts/ChangeLog Thu Apr 12 19:06:44 2007 +0000 @@ -1,3 +1,7 @@ +2007-04-12 John W. Eaton + + * optimization/qp.m: Avoid Octave indexing bug. + 2007-04-12 Carlo de Falco * miscellaneous/menu.m, control/base/bddemo.m, diff -r 475c83367a0e -r 589c8dbba916 scripts/optimization/qp.m --- a/scripts/optimization/qp.m Thu Apr 12 15:42:02 2007 +0000 +++ b/scripts/optimization/qp.m Thu Apr 12 19:06:44 2007 +0000 @@ -176,8 +176,14 @@ ## Discard inequality constraints that have -Inf bounds since those ## will never be active. idx = isinf (bin) & bin < 0; - bin(idx) = []; - Ain(idx,:) = []; + + ## FIXME -- this check should not be necessary, but Octave is + ## incorrectly returning [](0x0) for bin(idx) when bin = [](0x1) and + ## idx = [](0x1). + if (! isempty (idx)) + bin(idx) = []; + Ain(idx,:) = []; + endif n_in = length (bin);