go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkRSGDEachParameterApartBaseOptimizer.h
Go to the documentation of this file.
1 /*======================================================================
2 
3  This file is part of the elastix software.
4 
5  Copyright (c) University Medical Center Utrecht. All rights reserved.
6  See src/CopyrightElastix.txt or http://elastix.isi.uu.nl/legal.php for
7  details.
8 
9  This software is distributed WITHOUT ANY WARRANTY; without even
10  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11  PURPOSE. See the above copyright notices for more information.
12 
13 ======================================================================*/
14 
15 #ifndef __itkRSGDEachParameterApartBaseOptimizer_h
16 #define __itkRSGDEachParameterApartBaseOptimizer_h
17 
18 #include "itkSingleValuedNonLinearOptimizer.h"
19 
20 namespace itk
21 {
22 
34  {
35  public:
39  typedef SmartPointer<Self> Pointer;
40  typedef SmartPointer<const Self> ConstPointer;
41 
43  itkNewMacro(Self);
44 
48 
50  typedef enum {
58 
60  itkSetMacro( Maximize, bool );
61  itkGetConstMacro( Maximize, bool );
62  itkBooleanMacro( Maximize );
63  bool GetMinimize( ) const
64  { return !m_Maximize; }
65  void SetMinimize(bool v)
66  { this->SetMaximize(!v); }
67  void MinimizeOn(void)
68  { SetMaximize( false ); }
69  void MinimizeOff(void)
70  { SetMaximize( true ); }
71 
73  void StartOptimization( void );
74 
77  void ResumeOptimization( void );
78 
81  void StopOptimization( void );
82 
84  itkSetMacro( MaximumStepLength, double );
85  itkSetMacro( MinimumStepLength, double );
86  itkSetMacro( NumberOfIterations, unsigned long );
87  itkSetMacro( GradientMagnitudeTolerance, double );
88  itkGetConstMacro( MaximumStepLength, double );
89  itkGetConstMacro( MinimumStepLength, double );
90  itkGetConstMacro( NumberOfIterations, unsigned long );
91  itkGetConstMacro( GradientMagnitudeTolerance, double );
92  itkGetConstMacro( CurrentIteration, unsigned long );
93  itkGetConstMacro( StopCondition, StopConditionType );
94  itkGetConstMacro( Value, MeasureType );
95  itkGetConstReferenceMacro( Gradient, DerivativeType );
96 
98  itkGetConstReferenceMacro( CurrentStepLengths, DerivativeType);
99 
101  itkGetConstMacro( CurrentStepLength, double);
102 
104  itkGetConstMacro( GradientMagnitude, double);
105 
106  protected:
107 
110  void PrintSelf(std::ostream& os, Indent indent) const;
111 
115  virtual void AdvanceOneStep( void );
116 
127  virtual void StepAlongGradient(
128  const DerivativeType &,
129  const DerivativeType&)
130  {
131  ExceptionObject ex;
132  ex.SetLocation(__FILE__);
133  ex.SetDescription("This method MUST be overloaded in derived classes");
134  throw ex;
135  }
136 
137  private:
138 
139  RSGDEachParameterApartBaseOptimizer( const Self& ); // purposely not implemented
140  void operator=( const Self& ); // purposely not implemented
141 
142  protected:
143 
144  DerivativeType m_Gradient;
145  DerivativeType m_PreviousGradient;
146 
147  bool m_Stop;
149  MeasureType m_Value;
153 
155  DerivativeType m_CurrentStepLengths;
158 
160  unsigned long m_NumberOfIterations;
161  unsigned long m_CurrentIteration;
162 
164 
165  }; // end class RSGDEachParameterApartBaseOptimizer
166 
167 } // end namespace itk
168 
169 
170 
171 #endif // end #ifndef __itkRSGDEachParameterApartBaseOptimizer_h
172 
173 
174 


Generated on 27-06-2013 for elastix by doxygen 1.8.3.1 elastix logo