Mercurial > hg > octave-terminal
changeset 8592:dacfd030633a
handle sparse jacobians in fsolve
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Mon, 26 Jan 2009 15:46:33 +0100 |
parents | ffc9e9737507 |
children | 4e39b00218d3 |
files | scripts/ChangeLog scripts/optimization/fsolve.m |
diffstat | 2 files changed, 8 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,7 @@ +2009-01-17 Jaroslav Hajek <highegg@gmail.com> + + * optimization/fsolve.m: Disable Broyden updates for sparse jacobians. + 2009-01-17 Jaroslav Hajek <highegg@gmail.com> * optimization/__fsolve_defopts__.m: Remove.
--- a/scripts/optimization/fsolve.m +++ b/scripts/optimization/fsolve.m @@ -119,6 +119,10 @@ ## Handle arbitrary shapes of x and f and remember them. if (has_jac) [fvec, fjac] = fcn (reshape (x, xsiz)); + ## If the jacobian is sparse, disable Broyden updating. + if (issparse (fjac)) + updating = false; + endif nfev ++; else [fvec, fjac] = __fdjac__ (fcn, reshape (x, xsiz));