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  * Copyright UMC Utrecht and contributors
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 
19 #ifndef __itkRSGDEachParameterApartBaseOptimizer_h
20 #define __itkRSGDEachParameterApartBaseOptimizer_h
21 
22 #include "itkSingleValuedNonLinearOptimizer.h"
23 
24 namespace itk
25 {
26 
38 {
39 public:
40 
45  typedef SmartPointer< const Self > ConstPointer;
46 
48  itkNewMacro( Self );
49 
53 
55  typedef enum {
63 
65  itkSetMacro( Maximize, bool );
66  itkGetConstMacro( Maximize, bool );
67  itkBooleanMacro( Maximize );
68  bool GetMinimize() const
69  { return !m_Maximize; }
70  void SetMinimize( bool v )
71  { this->SetMaximize( !v ); }
72  void MinimizeOn( void )
73  { SetMaximize( false ); }
74  void MinimizeOff( void )
75  { SetMaximize( true ); }
76 
78  void StartOptimization( void );
79 
82  void ResumeOptimization( void );
83 
86  void StopOptimization( void );
87 
89  itkSetMacro( MaximumStepLength, double );
90  itkSetMacro( MinimumStepLength, double );
91  itkSetMacro( NumberOfIterations, unsigned long );
92  itkSetMacro( GradientMagnitudeTolerance, double );
93  itkGetConstMacro( MaximumStepLength, double );
94  itkGetConstMacro( MinimumStepLength, double );
95  itkGetConstMacro( NumberOfIterations, unsigned long );
96  itkGetConstMacro( GradientMagnitudeTolerance, double );
97  itkGetConstMacro( CurrentIteration, unsigned long );
98  itkGetConstMacro( StopCondition, StopConditionType );
99  itkGetConstMacro( Value, MeasureType );
100  itkGetConstReferenceMacro( Gradient, DerivativeType );
101 
103  itkGetConstReferenceMacro( CurrentStepLengths, DerivativeType );
104 
106  itkGetConstMacro( CurrentStepLength, double );
107 
109  itkGetConstMacro( GradientMagnitude, double );
110 
111 protected:
112 
115  void PrintSelf( std::ostream & os, Indent indent ) const;
116 
120  virtual void AdvanceOneStep( void );
121 
132  virtual void StepAlongGradient(
133  const DerivativeType &,
134  const DerivativeType & )
135  {
136  ExceptionObject ex;
137  ex.SetLocation( __FILE__ );
138  ex.SetDescription( "This method MUST be overloaded in derived classes" );
139  throw ex;
140  }
141 
142 
143 private:
144 
145  RSGDEachParameterApartBaseOptimizer( const Self & ); // purposely not implemented
146  void operator=( const Self & ); // purposely not implemented
147 
148 protected:
149 
150  DerivativeType m_Gradient;
151  DerivativeType m_PreviousGradient;
152 
153  bool m_Stop;
155  MeasureType m_Value;
159 
161  DerivativeType m_CurrentStepLengths;
164 
166  unsigned long m_NumberOfIterations;
167  unsigned long m_CurrentIteration;
168 
170 
171 };
172 
173 } // end namespace itk
174 
175 #endif // end #ifndef __itkRSGDEachParameterApartBaseOptimizer_h
virtual void StepAlongGradient(const DerivativeType &, const DerivativeType &)
void PrintSelf(std::ostream &os, Indent indent) const


Generated on 04-09-2015 for elastix by doxygen 1.8.9.1 elastix logo