ITK  4.2.0
Insight Segmentation and Registration Toolkit
itkQuasiNewtonOptimizerv4.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
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 #ifndef __itkQuasiNewtonOptimizerv4_h
19 #define __itkQuasiNewtonOptimizerv4_h
20 
21 #include "itkArray2D.h"
23 
24 #include "vnl/algo/vnl_matrix_inverse.h"
25 #include "vnl/algo/vnl_determinant.h"
26 
28 
29 namespace itk
30 {
60 class ITK_EXPORT QuasiNewtonOptimizerv4:
62 {
63 public:
69 
71  itkNewMacro(Self);
72 
74  itkTypeMacro(QuasiNewtonOptimizerv4, GradientDescentObjectOptimizer);
75 
76  typedef Superclass::InternalComputationValueType InternalComputationValueType;
77 
80 
82  typedef std::vector<HessianType> HessianArrayType;
83 
85  virtual void StartOptimization();
86 
88  itkSetMacro(MaximumIterationsWithoutProgress, SizeValueType);
89 
104  itkSetMacro(MaximumNewtonStepSizeInPhysicalUnits, InternalComputationValueType);
105 
107  itkGetConstReferenceMacro( NewtonStep, DerivativeType );
108 
109 protected:
110 
113 
117 
122 
127 
130 
132  std::string m_NewtonStepWarning;
133 
136 
139 
141  std::vector<bool> m_NewtonStepValidFlags;
142 
144  virtual void EstimateNewtonStep();
145 
149  virtual void EstimateNewtonStepOverSubRange( const IndexRangeType& subrange );
150 
155  virtual bool ComputeHessianAndStepWithBFGS(IndexValueType location);
156 
158  virtual void ResetNewtonStep(IndexValueType location);
159 
164  void CombineGradientNewtonStep(void);
165 
174  void ModifyCombinedNewtonStep();
175 
180  virtual void AdvanceOneStep(void);
181 
183  virtual ~QuasiNewtonOptimizerv4();
184 
185  virtual void PrintSelf(std::ostream & os, Indent indent) const;
186 
188 
189 private:
190  QuasiNewtonOptimizerv4(const Self &); //purposely not implemented
191  void operator=(const Self &); //purposely not implemented
192 
195 };
196 } // end namespace itk
197 
198 #endif
199