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
}
}
}
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
}
}
}