Mercurial > hg > octave-nkf
diff scripts/optimization/qp.m @ 9872:72d6e0de76c7
fix qp, condest and krylov
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Thu, 26 Nov 2009 08:28:07 +0100 |
parents | f0c3d3fc4903 |
children | 665ad34efeed |
line wrap: on
line diff
--- a/scripts/optimization/qp.m +++ b/scripts/optimization/qp.m @@ -85,16 +85,13 @@ if (nargin == 5 || nargin == 7 || nargin == 10) ## Checking the quadratic penalty - n = issquare (H); - if (n == 0) + if (! issquare (H)) error ("qp: quadratic penalty matrix not square"); - endif - - n1 = issymmetric (H); - if (n1 == 0) - ## warning ("qp: quadratic penalty matrix not symmetric"); + elseif (! ishermitian (H)) + ## warning ("qp: quadratic penalty matrix not hermitian"); H = (H + H')/2; endif + n = rows (H); ## Checking the initial guess (if empty it is resized to the ## right dimension and filled with 0)