Mercurial > octave
diff scripts/optimization/pqpnonneg.m @ 10200:7c1b1c084af1
handle cholesky update failure in pqpnonneg
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Tue, 26 Jan 2010 09:48:07 +0100 |
parents | 36d885c4a1ac |
children | d1978e7364ad |
line wrap: on
line diff
--- a/scripts/optimization/pqpnonneg.m Tue Jan 26 08:11:53 2010 +0100 +++ b/scripts/optimization/pqpnonneg.m Tue Jan 26 09:48:07 2010 +0100 @@ -165,7 +165,11 @@ p = [p(1:jdx-1), zidx, p(jdx:end)]; if (usechol) ## insert the column into the Cholesky factorization. - r = cholinsert (r, jdx, c(p,zidx)); + [r, bad] = cholinsert (r, jdx, c(p,zidx)); + if (bad) + ## If the insertion failed, we switch off updates and go on. + usechol = false; + endif endif endwhile