[Insight-developers] Bug in vnl_powell.cxx

Hans Johnson hans-johnson at uiowa.edu
Thu Oct 30 20:50:18 EDT 2008


ITK Developers,

I just wanted to follow up on my previous e-mail a bit.

I just found a nasty bug in the vxl_powell.cxx optimizer.  I¹ve done
extensive testing on it, and figured out how fix it.  This has given my
application great speed increase, and no longer segmentation faults
randomly.  The problem was that a variable was not explicitly being set, and
from time to time it would have a non-zero initial value.  If you are really
lucky then the default initialization is zero, and all is well; if you are
somewhat lucky, the random value does not affect the outcome too much, and
the method converges after a bunch of iterations, and occasionally you are
unlucky and the the initialization is too crazy big/small and the function
being minmized evaluates to nan or inf and all heck breaks loose.

The least invasive way to avoid this bug is to initialize the variable
³bx=0² on lines 87 and 124 of vnl_powell.cxx.  As stated in my previous
message, this does work, but a little more work also removes two façade
functions adapt the deprecated vnl_brent class member functions into the
vnl_brent_minimizer class.

Since this is so close to a release, I wanted to recommend the minimally
invasisve fix prior to version 3.10, and the 15 line patch after the
release.

Let me know what you think.
Hans
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/mailman/private/insight-developers/attachments/20081030/aa1d2c00/attachment.htm>


More information about the Insight-developers mailing list