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: 2009-09-23 16:07:39 $
00007   Version:   $Revision: 1.27 $
00008 
00009   Copyright (c) Insight Software 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 #include <string>
00023 
00024 namespace itk
00025 {
00026 
00069 class ITK_EXPORT OnePlusOneEvolutionaryOptimizer: 
00070     public SingleValuedNonLinearOptimizer
00071 {
00072 public:
00074   typedef OnePlusOneEvolutionaryOptimizer     Self;
00075   typedef SingleValuedNonLinearOptimizer      Superclass;
00076   typedef SmartPointer<Self>                  Pointer;
00077   typedef SmartPointer<const Self>            ConstPointer;
00078 
00080   itkNewMacro(Self);
00081 
00083   itkTypeMacro(OnePlusOneEvolutionaryOptimizer, SingleValuedNonLinearOptimizer );
00084 
00086   typedef  SingleValuedCostFunction         CostFunctionType;
00087   typedef  CostFunctionType::Pointer        CostFunctionPointer;
00088 
00090   typedef Statistics::RandomVariateGeneratorBase NormalVariateGeneratorType;
00091 
00093   itkSetMacro( Maximize, bool );
00094   itkBooleanMacro( Maximize );
00095   itkGetConstReferenceMacro( Maximize, bool );
00097 
00098   bool GetMinimize( ) const
00099     { return !m_Maximize; }
00100   void SetMinimize(bool v)
00101     { this->SetMaximize(!v); }
00102   void    MinimizeOn(void) 
00103     { SetMaximize( false ); }
00104   void    MinimizeOff(void) 
00105     { SetMaximize( true ); }
00106 
00108   itkSetMacro( MaximumIteration, unsigned int );
00109   itkGetConstReferenceMacro( MaximumIteration, unsigned int );
00111 
00113   itkSetMacro( GrowthFactor, double );
00114   itkGetConstReferenceMacro( GrowthFactor, double );
00116 
00118   itkSetMacro( ShrinkFactor, double );
00119   itkGetConstReferenceMacro( ShrinkFactor, double );
00121 
00123   itkSetMacro( InitialRadius, double );
00124   itkGetConstReferenceMacro( InitialRadius, double );
00126 
00127 
00130   itkSetMacro( Epsilon, double );   
00131   itkGetConstReferenceMacro( Epsilon, double );   
00133 
00135   itkGetConstReferenceMacro( FrobeniusNorm, double );   
00136 
00137   void SetNormalVariateGenerator(NormalVariateGeneratorType* generator);
00138 
00145   void Initialize(double initialRadius, double grow = -1, double shrink = -1);
00146 
00148   itkGetConstReferenceMacro( CurrentCost, MeasureType );
00149   MeasureType GetValue() const { return this->GetCurrentCost(); }
00151 
00153   itkGetConstReferenceMacro( CurrentIteration, unsigned int);
00154 
00156   itkGetConstReferenceMacro( Initialized, bool);
00157 
00161   void StartOptimization();
00162 
00166   void StopOptimization() 
00167     { m_Stop = true; }
00168 
00169   itkGetConstReferenceMacro(CatchGetValueException, bool);
00170   itkSetMacro(CatchGetValueException, bool);
00171 
00172   itkGetConstReferenceMacro(MetricWorstPossibleValue, double);
00173   itkSetMacro(MetricWorstPossibleValue, double);
00174 
00175   const std::string GetStopConditionDescription() const;
00176 
00177 protected:
00178   OnePlusOneEvolutionaryOptimizer();
00179   OnePlusOneEvolutionaryOptimizer(const OnePlusOneEvolutionaryOptimizer&);
00180   virtual ~OnePlusOneEvolutionaryOptimizer();
00181   void PrintSelf(std::ostream& os, Indent indent) const;
00182 
00183 private:
00184   
00186   NormalVariateGeneratorType::Pointer m_RandomGenerator;
00187 
00189   unsigned int m_MaximumIteration;
00190 
00192   unsigned int m_CurrentIteration;
00193 
00194   bool               m_CatchGetValueException;
00195   double             m_MetricWorstPossibleValue;
00196 
00198   bool m_Maximize;
00199 
00202   double m_Epsilon;
00203 
00205   double m_InitialRadius;
00206 
00208   double m_GrowthFactor;
00209 
00211   double m_ShrinkFactor;
00212 
00214   bool m_Initialized;
00215 
00217   MeasureType       m_CurrentCost;
00218 
00223   bool m_Stop;
00224 
00226   OStringStream m_StopConditionDescription;
00227 
00230   double m_FrobeniusNorm;
00231 
00232 }; // end of class
00233 
00234 } // end of namespace itk
00235 
00236 #endif
00237 

Generated at Fri Apr 16 19:12:29 2010 for ITK by doxygen 1.6.1 written by Dimitri van Heesch, © 1997-2000