ITK  4.6.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 
27 namespace itk
28 {
58 template<typename TInternalComputationValueType>
60  public GradientDescentOptimizerv4Template<TInternalComputationValueType>
61 {
62 public:
68 
70  itkNewMacro(Self);
71 
74 
76  typedef TInternalComputationValueType InternalComputationValueType;
77 
83 
86 
88  typedef std::vector<HessianType> HessianArrayType;
89 
91  virtual void StartOptimization( bool doOnlyInitialization = false );
92 
94  itkSetMacro(MaximumIterationsWithoutProgress, SizeValueType);
95 
110  itkSetMacro(MaximumNewtonStepSizeInPhysicalUnits, TInternalComputationValueType);
111 
113  itkGetConstReferenceMacro( NewtonStep, DerivativeType );
114 
119  virtual void EstimateNewtonStepOverSubRange( const IndexRangeType& subrange );
120 
121 protected:
122 
125 
129 
133 
138 
141 
143  std::string m_NewtonStepWarning;
144 
146  TInternalComputationValueType m_MaximumNewtonStepSizeInPhysicalUnits;
147 
150 
152  std::vector<bool> m_NewtonStepValidFlags;
153 
155  virtual void EstimateNewtonStep();
156 
161  virtual bool ComputeHessianAndStepWithBFGS(IndexValueType location);
162 
164  virtual void ResetNewtonStep(IndexValueType location);
165 
170  void CombineGradientNewtonStep(void);
171 
181 
186  virtual void AdvanceOneStep(void);
187 
190 
191  virtual void PrintSelf(std::ostream & os, Indent indent) const;
192 
193 private:
194  QuasiNewtonOptimizerv4Template(const Self &); //purposely not implemented
195  void operator=(const Self &); //purposely not implemented
196 
199 };
200 
203 
204 } // end namespace itk
205 
206 #ifndef ITK_MANUAL_INSTANTIATION
207 #include "itkQuasiNewtonOptimizerv4.hxx"
208 #endif
209 
210 #endif
itk::Array2D< TInternalComputationValueType > HessianType
Light weight base class for most itk classes.
virtual void StartOptimization(bool doOnlyInitialization=false)
virtual void ResetNewtonStep(IndexValueType location)
DomainThreader< ThreadedIndexedContainerPartitioner, Self >::Pointer m_EstimateNewtonStepThreader
signed long IndexValueType
Definition: itkIntTypes.h:150
Superclass::StopConditionType StopConditionType
unsigned long SizeValueType
Definition: itkIntTypes.h:143
GradientDescentOptimizerv4Template< TInternalComputationValueType > Superclass
virtual void EstimateNewtonStepOverSubRange(const IndexRangeType &subrange)
QuasiNewtonOptimizerv4Template< double > QuasiNewtonOptimizerv4
Array2D class representing a 2D array with size defined at construction time.
Definition: itkArray2D.h:44
TInternalComputationValueType m_MaximumNewtonStepSizeInPhysicalUnits
virtual void PrintSelf(std::ostream &os, Indent indent) const
virtual bool ComputeHessianAndStepWithBFGS(IndexValueType location)
TInternalComputationValueType InternalComputationValueType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
ThreadedIndexedContainerPartitioner::IndexRangeType IndexRangeType
Implement a Quasi-Newton optimizer with BFGS Hessian estimation.