Mercurial > hg > octave-lyh
diff scripts/optimization/fsolve.m @ 8550:1cb63ac13934
allow fsolve work without qrupdate
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Wed, 21 Jan 2009 07:07:12 +0100 |
parents | ec2715c76039 |
children | a6edd5c23cb5 |
line wrap: on
line diff
--- a/scripts/optimization/fsolve.m +++ b/scripts/optimization/fsolve.m @@ -67,6 +67,8 @@ function [x, fvec, info, output, fjac] = fsolve (fcn, x0, options) + persistent have_qrupdate = exist ('qrupdate') == 5; + if (nargin < 3) options = struct (); endif @@ -266,7 +268,11 @@ endif ## Update the QR factorization. - [q, r] = qrupdate (q, r, u, v); + if (have_qrupdate) + [q, r] = qrupdate (q, r, u, v); + else + [q, r] = qr (q*r + u*v'); + endif endwhile endwhile