bug-gsl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-gsl] gsl BFGS multimin bug


From: Carl Glen Henshaw
Subject: [Bug-gsl] gsl BFGS multimin bug
Date: Thu, 27 Jan 2005 16:13:11 -0500

All:

I believe I have located a bug in the bfgs multivariate minimization routine. Specifically, in some circumstances it is possible for the vector returned by the bfgs minimization routine to contain NaN elements. This is because in the file vector_bfgs.c, in the routine vector_bfgs_iterate, starting on or near line 289, it is possible for dxdg to be uniformly equal to zero. When the BFGS update is calculated, dxg/dxdg and dgg/dxdg are then undefined.

In tracing the bug back further, I *think* this is because in line 263, which reads:

 if (stepb == 0.0)
    {
      return GSL_ENOPROG;
    }

it is possible for stepb to be very very small (on my machine around 1e-18) but nonzero, which leaves the intermediate point unchanged from the initial point. Changing the line to read something like:

if (fabs(stepb) <5e-18)
    {
      return GSL_ENOPROG;
    }

appears to fix the problem. I'm not as up on my machine computation definitions as I should be, but shouldn't the line really be something like

if (gsl_fcmp(stepb, 0.0, DBL_EPS))
  {
    return GSL_ENOPROG;
  }

Thanks,
Glen

--------------------------------------------------------

Dr. Glen Henshaw
Attitude Control Systems Branch
Naval Center for Space Technology
U.S. Naval Research Laboratory





reply via email to

[Prev in Thread] Current Thread [Next in Thread]