changeset 8857:20589a8f1a33

fix fsolve bug
author Jaroslav Hajek <highegg@gmail.com>
date Tue, 24 Feb 2009 13:53:14 +0100
parents ab4db66e286f
children 082c052cdd11
files scripts/ChangeLog scripts/optimization/fsolve.m
diffstat 2 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/ChangeLog	Tue Feb 24 11:15:05 2009 +0100
+++ b/scripts/ChangeLog	Tue Feb 24 13:53:14 2009 +0100
@@ -1,3 +1,8 @@
+2009-02-24  Jaroslav Hajek  <highegg@gmail.com>
+
+	* optimization/fsolve.m: Update niter after each iteration, not just
+	a succesful one.
+
 2009-02-08  Thorsten Meyer  <thorsten.meyier@gmx.de>
 
 	* configure.in: AC_SUBST ac_config_files
--- a/scripts/optimization/fsolve.m	Tue Feb 24 11:15:05 2009 +0100
+++ b/scripts/optimization/fsolve.m	Tue Feb 24 13:53:14 2009 +0100
@@ -274,9 +274,10 @@
         xn = norm (dg .* x);
         fvec = fvec1;
         fn = fn1;
-        niter ++;
       endif
 
+      niter ++;
+
       ## FIXME: should outputfcn be only called after a successful iteration?
       if (! isempty (outfcn))
         optimvalues.iter = niter;