Bug notification in Powell


gvong
07-13-2006, 03:41 AM
Hi all,

I have found a bug in Powell algorithm that prevents the algorithm to find the minimum in some problems.

in case one discards the direction of largest decrease by the average descent direction, one needs to reinitialise the starting point of the next iteration to the latest found point.

if (fptt < fp) // case when we discard the direction of largest decrease and replace it by the average descent direction
{
t=2.0*(fp-2.0*fret+fptt)*SQR(fp-fret-del)-del*SQR(fp-fptt);
if (t < 0.0)
{
linmin(p,xit,fret,func);
for (j=0;j<n;j++) {
xi[j][ibig]=xi[j][n-1];
xi[j][n-1]=xit[j];// replace the direction of largest descent by the new direction

// fixes bug of NR
pt[j]=p[j];//save the old starting point
}
}
}

davidrufino
08-02-2006, 05:26 AM
I've had a look at the code myself, and I agree. If pt is not updated then the average direction calculated in the next iteration will not be as expected. Can any of the developers confirm this? Or is there a special reason why this is done.