Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itkOnePlusOneEvolutionaryOptimizer.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkOnePlusOneEvolutionaryOptimizer.h,v $
00005   Language:  C++
00006   Date:      $Date: 2003/01/31 05:04:56 $
00007   Version:   $Revision: 1.14 $
00008 
00009   Copyright (c) 2002 Insight Consortium. All rights reserved.
00010   See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
00011 
00012      This software is distributed WITHOUT ANY WARRANTY; without even 
00013      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00014      PURPOSE.  See the above copyright notices for more information.
00015 
00016 =========================================================================*/
00017 #ifndef __itkOnePlusOneEvolutionaryOptimizer_h
00018 #define __itkOnePlusOneEvolutionaryOptimizer_h
00019 
00020 #include <itkSingleValuedNonLinearOptimizer.h>
00021 #include <itkRandomVariateGeneratorBase.h>
00022 
00023 namespace itk
00024 {
00025 
00068 class ITK_EXPORT OnePlusOneEvolutionaryOptimizer: 
00069     public SingleValuedNonLinearOptimizer
00070 {
00071 public:
00073   typedef OnePlusOneEvolutionaryOptimizer     Self ;
00074   typedef SingleValuedNonLinearOptimizer      Superclass;
00075   typedef SmartPointer<Self>                  Pointer;
00076   typedef SmartPointer<const Self>            ConstPointer;
00077   
00079   itkNewMacro(Self);
00080  
00082   itkTypeMacro(OnePlusOneEvolutionaryOptimizer, SingleValuedNonLinearOptimizer );
00083  
00085   typedef  SingleValuedCostFunction         CostFunctionType;
00086   typedef  CostFunctionType::Pointer        CostFunctionPointer;
00087 
00089   typedef Statistics::RandomVariateGeneratorBase NormalVariateGeneratorType ;
00090   
00092   void MaximizeOn() {m_Maximize=true;}
00093 
00095   itkSetMacro( MaximumIteration, unsigned int );
00096   itkGetConstMacro( MaximumIteration, unsigned int );
00097 
00099   itkGetConstMacro( GrowthFactor, double );
00100 
00102   itkGetConstMacro( ShrinkFactor, double );
00103 
00105   itkGetConstMacro( InitialRadius, double );
00106 
00107 
00110   itkSetMacro( Epsilon, double );   
00111   itkGetConstMacro( Epsilon, double );   
00112 
00113   void SetNormalVariateGenerator(NormalVariateGeneratorType* generator) ;
00114 
00121   void Initialize(double initialRadius, double grow = -1, double shrink = -1) ;
00122 
00123   MeasureType GetValue()
00124   { return m_CurrentCost ; }
00125 
00126   itkGetConstMacro( CurrentIteration, unsigned int) ;
00130   void StartOptimization() ;
00131 
00135   void StopOptimization() 
00136   { m_Stop = true ; }
00137 
00138 protected:
00139   OnePlusOneEvolutionaryOptimizer() ;
00140   virtual ~OnePlusOneEvolutionaryOptimizer() ;
00141   void PrintSelf(std::ostream& os, Indent indent) const;
00142 
00143 private:
00144   
00146   NormalVariateGeneratorType* m_RandomGenerator ;
00147 
00149   unsigned int m_MaximumIteration ;
00150 
00152   unsigned int m_CurrentIteration ;
00153 
00155   bool m_Maximize;
00156 
00159   double m_Epsilon ;
00160 
00162   double m_InitialRadius ;
00163 
00165   double m_GrowthFactor ;
00166 
00168   double m_ShrinkFactor ;
00169 
00171   bool m_Initialized ;
00172 
00174   MeasureType       m_CurrentCost;
00175 
00180   bool m_Stop ;
00181 } ; // end of class
00182 
00183 } // end of namespace itk
00184 
00185 #endif

Generated at Fri May 21 01:15:09 2004 for ITK by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2000