itkOnePlusOneEvolutionaryOptimizer.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
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 itkSetMacro( Maximize, bool );
00093 itkBooleanMacro( Maximize );
00095
00097 itkSetMacro( MaximumIteration, unsigned int );
00098 itkGetConstReferenceMacro( MaximumIteration, unsigned int );
00100
00102 itkSetMacro( GrowthFactor, double );
00103 itkGetConstReferenceMacro( GrowthFactor, double );
00105
00107 itkSetMacro( ShrinkFactor, double );
00108 itkGetConstReferenceMacro( ShrinkFactor, double );
00110
00112 itkSetMacro( InitialRadius, double );
00113 itkGetConstReferenceMacro( InitialRadius, double );
00115
00116
00119 itkSetMacro( Epsilon, double );
00120 itkGetConstReferenceMacro( Epsilon, double );
00122
00124 itkGetConstReferenceMacro( FrobeniusNorm, double );
00125
00126 void SetNormalVariateGenerator(NormalVariateGeneratorType* generator);
00127
00134 void Initialize(double initialRadius, double grow = -1, double shrink = -1);
00135
00137 itkGetConstReferenceMacro( CurrentCost, MeasureType );
00138 MeasureType GetValue() const { return this->GetCurrentCost(); }
00140
00142 itkGetConstReferenceMacro( CurrentIteration, unsigned int);
00143
00147 void StartOptimization();
00148
00152 void StopOptimization()
00153 { m_Stop = true; }
00154
00155 itkGetMacro(CatchGetValueException, bool);
00156 itkSetMacro(CatchGetValueException, bool);
00157
00158 itkGetMacro(MetricWorstPossibleValue, double);
00159 itkSetMacro(MetricWorstPossibleValue, double);
00160
00161 protected:
00162 OnePlusOneEvolutionaryOptimizer();
00163 OnePlusOneEvolutionaryOptimizer(const OnePlusOneEvolutionaryOptimizer&);
00164 virtual ~OnePlusOneEvolutionaryOptimizer();
00165 void PrintSelf(std::ostream& os, Indent indent) const;
00166
00167 private:
00168
00170 NormalVariateGeneratorType::Pointer m_RandomGenerator;
00171
00173 unsigned int m_MaximumIteration;
00174
00176 unsigned int m_CurrentIteration;
00177
00178 bool m_CatchGetValueException;
00179 double m_MetricWorstPossibleValue;
00180
00182 bool m_Maximize;
00183
00186 double m_Epsilon;
00187
00189 double m_InitialRadius;
00190
00192 double m_GrowthFactor;
00193
00195 double m_ShrinkFactor;
00196
00198 bool m_Initialized;
00199
00201 MeasureType m_CurrentCost;
00202
00207 bool m_Stop;
00208
00211 double m_FrobeniusNorm;
00212
00213 };
00214
00215 }
00216
00217 #endif
00218