From: Paul K. <pki...@us...> - 2004-05-20 00:29:46
|
Update of /cvsroot/octave/octave-forge/main/optim/mintoolkit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9076/mintoolkit Modified Files: bisectionstep.cc newtonstep.cc Log Message: Use lo_ieee_isnan rather than isnan. Index: newtonstep.cc =================================================================== RCS file: /cvsroot/octave/octave-forge/main/optim/mintoolkit/newtonstep.cc,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- newtonstep.cc 30 Mar 2004 14:37:23 -0000 1.2 +++ newtonstep.cc 20 May 2004 00:29:31 -0000 1.3 @@ -25,6 +25,7 @@ #include <oct.h> #include <octave/parse.h> #include <octave/Cell.h> +#include <octave/lo-ieee.h> #include <float.h> DEFUN_DLD(newtonstep, args, , "newtonstep.cc") @@ -107,7 +108,7 @@ obj = f_return(0).double_value(); // if not, fall back to bisection - if ((obj > obj_0) || isnan(obj)) + if ((obj > obj_0) || lo_ieee_isnan(obj)) { f_return = feval("bisectionstep", args); a = f_return(0).double_value(); Index: bisectionstep.cc =================================================================== RCS file: /cvsroot/octave/octave-forge/main/optim/mintoolkit/bisectionstep.cc,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- bisectionstep.cc 30 Mar 2004 14:37:23 -0000 1.2 +++ bisectionstep.cc 20 May 2004 00:29:31 -0000 1.3 @@ -30,6 +30,7 @@ #include <oct.h> #include <octave/parse.h> #include <octave/Cell.h> +#include <octave/lo-ieee.h> #include <float.h> DEFUN_DLD(bisectionstep, args, , "bisectionstep.cc") @@ -76,7 +77,7 @@ obj = f_return(0).double_value(); // reduce stepsize if worse, or if function can't be evaluated - if ((obj >= obj_0) || isnan(obj)) + if ((obj >= obj_0) || lo_ieee_isnan(obj)) { a = 0.5 * a; } @@ -106,7 +107,7 @@ obj = f_return(0).double_value(); // if improved, record new best and try another step - if ((obj < obj_0) & !isnan(obj)) + if ((obj < obj_0) & !lo_ieee_isnan(obj)) { obj_0 = obj; } |