itkExhaustiveOptimizer.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 __itkExhaustiveOptimizer_h
00018 #define __itkExhaustiveOptimizer_h
00019
00020 #include "itkSingleValuedNonLinearOptimizer.h"
00021
00022 namespace itk
00023 {
00024
00080 class ITK_EXPORT ExhaustiveOptimizer :
00081 public SingleValuedNonLinearOptimizer
00082 {
00083 public:
00085 typedef ExhaustiveOptimizer Self;
00086 typedef SingleValuedNonLinearOptimizer Superclass;
00087 typedef SmartPointer<Self> Pointer;
00088 typedef SmartPointer<const Self> ConstPointer;
00089
00090 typedef Array< unsigned long > StepsType;
00092 itkNewMacro(Self);
00093
00095 itkTypeMacro( ExhaustiveOptimizer, SingleValuedNonLinearOptimizer );
00096
00097 virtual void StartOptimization( void );
00098
00099 void StartWalking( void );
00100 void ResumeWalking( void );
00101 void StopWalking(void);
00102
00103 itkSetMacro( StepLength, double );
00104 itkSetMacro( NumberOfSteps, StepsType );
00105 itkGetConstReferenceMacro( StepLength, double );
00106 itkGetConstReferenceMacro( NumberOfSteps, StepsType );
00107 itkGetConstReferenceMacro( CurrentValue, MeasureType );
00108 itkGetConstReferenceMacro( MaximumMetricValue, MeasureType );
00109 itkGetConstReferenceMacro( MinimumMetricValue, MeasureType );
00110 itkGetConstReferenceMacro( MinimumMetricValuePosition, ParametersType );
00111 itkGetConstReferenceMacro( MaximumMetricValuePosition, ParametersType );
00112 itkGetConstReferenceMacro( CurrentIndex, ParametersType );
00113 itkGetConstReferenceMacro( MaximumNumberOfIterations, unsigned long );
00114
00116 const std::string GetStopConditionDescription() const;
00117
00118 protected:
00119 ExhaustiveOptimizer();
00120 virtual ~ExhaustiveOptimizer() {};
00121 void PrintSelf(std::ostream& os, Indent indent) const;
00122
00124 void AdvanceOneStep( void );
00125 void IncrementIndex( ParametersType & param );
00127
00128
00129 protected:
00130 MeasureType m_CurrentValue;
00131 StepsType m_NumberOfSteps;
00132 unsigned long m_CurrentIteration;
00133 bool m_Stop;
00134 unsigned int m_CurrentParameter;
00135 double m_StepLength;
00136 ParametersType m_CurrentIndex;
00137 unsigned long m_MaximumNumberOfIterations;
00138 MeasureType m_MaximumMetricValue;
00139 MeasureType m_MinimumMetricValue;
00140 ParametersType m_MinimumMetricValuePosition;
00141 ParametersType m_MaximumMetricValuePosition;
00142
00143 private:
00144 ExhaustiveOptimizer(const Self&);
00145 void operator=(const Self&);
00146
00147 OStringStream m_StopConditionDescription;
00148 };
00149
00150 }
00151
00152 #endif
00153