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:
36 
40  typedef SmartPointer< Self > Pointer;
41  typedef SmartPointer< const Self > ConstPointer;
42 
44  itkNewMacro( Self );
45 
49 
51  typedef enum {
59 
61  itkSetMacro( Maximize, bool );
62  itkGetConstMacro( Maximize, bool );
63  itkBooleanMacro( Maximize );
64  bool GetMinimize() const
65  { return !m_Maximize; }
66  void SetMinimize( bool v )
67  { this->SetMaximize( !v ); }
68  void MinimizeOn( void )
69  { SetMaximize( false ); }
70  void MinimizeOff( void )
71  { SetMaximize( true ); }
72 
74  void StartOptimization( void );
75 
78  void ResumeOptimization( void );
79 
82  void StopOptimization( void );
83 
85  itkSetMacro( MaximumStepLength, double );
86  itkSetMacro( MinimumStepLength, double );
87  itkSetMacro( NumberOfIterations, unsigned long );
88  itkSetMacro( GradientMagnitudeTolerance, double );
89  itkGetConstMacro( MaximumStepLength, double );
90  itkGetConstMacro( MinimumStepLength, double );
91  itkGetConstMacro( NumberOfIterations, unsigned long );
92  itkGetConstMacro( GradientMagnitudeTolerance, double );
93  itkGetConstMacro( CurrentIteration, unsigned long );
94  itkGetConstMacro( StopCondition, StopConditionType );
95  itkGetConstMacro( Value, MeasureType );
96  itkGetConstReferenceMacro( Gradient, DerivativeType );
97 
99  itkGetConstReferenceMacro( CurrentStepLengths, DerivativeType );
100 
102  itkGetConstMacro( CurrentStepLength, double );
103 
105  itkGetConstMacro( GradientMagnitude, double );
106 
107 protected:
108 
111  void PrintSelf( std::ostream & os, Indent indent ) const;
112 
116  virtual void AdvanceOneStep( void );
117 
128  virtual void StepAlongGradient(
129  const DerivativeType &,
130  const DerivativeType & )
131  {
132  ExceptionObject ex;
133  ex.SetLocation( __FILE__ );
134  ex.SetDescription( "This method MUST be overloaded in derived classes" );
135  throw ex;
136  }
137 
138 
139 private:
140 
141  RSGDEachParameterApartBaseOptimizer( const Self & ); // purposely not implemented
142  void operator=( const Self & ); // purposely not implemented
143 
144 protected:
145 
146  DerivativeType m_Gradient;
147  DerivativeType m_PreviousGradient;
148 
149  bool m_Stop;
151  MeasureType m_Value;
155 
157  DerivativeType m_CurrentStepLengths;
160 
162  unsigned long m_NumberOfIterations;
163  unsigned long m_CurrentIteration;
164 
166 
167 };
168 
169 } // end namespace itk
170 
171 #endif // end #ifndef __itkRSGDEachParameterApartBaseOptimizer_h
virtual void StepAlongGradient(const DerivativeType &, const DerivativeType &)
void PrintSelf(std::ostream &os, Indent indent) const


Generated on 27-04-2014 for elastix by doxygen 1.8.6 elastix logo