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-06-24 12:02:53 $
00007   Version:   $Revision: 1.25 $
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 );
00096 
00098   itkSetMacro( MaximumIteration, unsigned int );
00099   itkGetConstReferenceMacro( MaximumIteration, unsigned int );
00101 
00103   itkSetMacro( GrowthFactor, double );
00104   itkGetConstReferenceMacro( GrowthFactor, double );
00106 
00108   itkSetMacro( ShrinkFactor, double );
00109   itkGetConstReferenceMacro( ShrinkFactor, double );
00111 
00113   itkSetMacro( InitialRadius, double );
00114   itkGetConstReferenceMacro( InitialRadius, double );
00116 
00117 
00120   itkSetMacro( Epsilon, double );   
00121   itkGetConstReferenceMacro( Epsilon, double );   
00123 
00125   itkGetConstReferenceMacro( FrobeniusNorm, double );   
00126 
00127   void SetNormalVariateGenerator(NormalVariateGeneratorType* generator);
00128 
00135   void Initialize(double initialRadius, double grow = -1, double shrink = -1);
00136 
00138   itkGetConstReferenceMacro( CurrentCost, MeasureType );
00139   MeasureType GetValue() const { return this->GetCurrentCost(); }
00141 
00143   itkGetConstReferenceMacro( CurrentIteration, unsigned int);
00144 
00148   void StartOptimization();
00149 
00153   void StopOptimization() 
00154     { m_Stop = true; }
00155 
00156   itkGetMacro(CatchGetValueException, bool);
00157   itkSetMacro(CatchGetValueException, bool);
00158 
00159   itkGetMacro(MetricWorstPossibleValue, double);
00160   itkSetMacro(MetricWorstPossibleValue, double);
00161 
00162   const std::string GetStopConditionDescription() const;
00163 
00164 protected:
00165   OnePlusOneEvolutionaryOptimizer();
00166   OnePlusOneEvolutionaryOptimizer(const OnePlusOneEvolutionaryOptimizer&);
00167   virtual ~OnePlusOneEvolutionaryOptimizer();
00168   void PrintSelf(std::ostream& os, Indent indent) const;
00169 
00170 private:
00171   
00173   NormalVariateGeneratorType::Pointer m_RandomGenerator;
00174 
00176   unsigned int m_MaximumIteration;
00177 
00179   unsigned int m_CurrentIteration;
00180 
00181   bool               m_CatchGetValueException;
00182   double             m_MetricWorstPossibleValue;
00183 
00185   bool m_Maximize;
00186 
00189   double m_Epsilon;
00190 
00192   double m_InitialRadius;
00193 
00195   double m_GrowthFactor;
00196 
00198   double m_ShrinkFactor;
00199 
00201   bool m_Initialized;
00202 
00204   MeasureType       m_CurrentCost;
00205 
00210   bool m_Stop;
00211 
00213   OStringStream m_StopConditionDescription;
00214 
00217   double m_FrobeniusNorm;
00218 
00219 }; // end of class
00220 
00221 } // end of namespace itk
00222 
00223 #endif
00224 

Generated at Tue Sep 15 04:13:06 2009 for ITK by doxygen 1.5.8 written by Dimitri van Heesch, © 1997-2000