[Insight-developers] Re: Bug in itk::LBFGSBOptimizer

Luis Ibanez luis.ibanez at kitware.com
Thu Sep 20 19:09:12 EDT 2007


Hi Vladlena,

The "virtual" modifier is provided by the base class:

                itkOptimizer

in the file:

     Insight/Code/Numerics/itkOptimizer.h

in line 80:

$ grep -n StartOptimization itkOpti*.h
80:  virtual void StartOptimization() {};


The "virtual" nature of the method should propagate to all
derived classes without the need of repeating "virtual"
in the declarations of their methods.

I wonder if something else is going on in your build...

Did you added the 'virtual' modifier to any other method
in addition to the StartOptimization() ?


   Please let us know,


     Thanks


        Luis


--------------------------
Gorbunova Vladlena wrote:
> Hi ITK Community!
> I'm not really a ITK developer but I want to extend ITK functionality
> for my problem, so when I tried to inherit itk::LBFGSBOptimizer class
> I found out that StartOptimization public member function declare
> without 'virtual'
> Line 78 file  LBFGSBOptimizer .h
>   /** Start optimization with an initial value. */
>   void StartOptimization( void );
> So I can't add my own functionality to this function, on my local copy
> of ITK I just put virtual and it starts to work. Probably it could be
> useful for itk others.
> 
> --
> Best regards.
> 
> Vladlena Gorbunova, PhD Student             vladlena at diku.dk
> Department of Computer Science (DIKU)
> University of Copenhagen
> Universitetsparken 1, Office S226               ph +45 50247673
> 


More information about the Insight-developers mailing list