ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkGradientDescentLineSearchOptimizerv4.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 itkGradientDescentLineSearchOptimizerv4_h
19 #define itkGradientDescentLineSearchOptimizerv4_h
20 
24 
25 namespace itk
26 {
58 template<typename TInternalComputationValueType>
60 : public GradientDescentOptimizerv4Template<TInternalComputationValueType>
61 {
62 public:
63  ITK_DISALLOW_COPY_AND_ASSIGN(GradientDescentLineSearchOptimizerv4Template);
64 
70 
73 
75  itkNewMacro(Self);
76 
78  using InternalComputationValueType = TInternalComputationValueType;
79 
81  using DerivativeType = typename Superclass::DerivativeType;
82 
84  using MeasureType = typename Superclass::MeasureType;
85  using ParametersType = typename Superclass::ParametersType;
86 
89 
93  itkSetMacro( Epsilon , TInternalComputationValueType );
94  itkGetMacro( Epsilon , TInternalComputationValueType );
96 
106  itkSetMacro( LowerLimit , TInternalComputationValueType );
107  itkGetMacro( LowerLimit , TInternalComputationValueType );
108  itkSetMacro( UpperLimit , TInternalComputationValueType );
109  itkGetMacro( UpperLimit , TInternalComputationValueType );
110  itkSetMacro( MaximumLineSearchIterations , unsigned int );
111  itkGetMacro( MaximumLineSearchIterations , unsigned int );
113 
114 protected:
117  void AdvanceOneStep() override;
118 
121 
123  ~GradientDescentLineSearchOptimizerv4Template() override = default;
124 
125  void PrintSelf( std::ostream & os, Indent indent ) const override;
126 
127  TInternalComputationValueType GoldenSectionSearch( TInternalComputationValueType a,
128  TInternalComputationValueType b,
129  TInternalComputationValueType c,
130  TInternalComputationValueType metricb = NumericTraits<TInternalComputationValueType>::max());
131 
132  TInternalComputationValueType m_LowerLimit;
133  TInternalComputationValueType m_UpperLimit;
134  TInternalComputationValueType m_Phi;
135  TInternalComputationValueType m_Resphi;
136  TInternalComputationValueType m_Epsilon;
137 
140 
143 };
144 
147 
148 } // end namespace itk
149 
150 #ifndef ITK_MANUAL_INSTANTIATION
151 #include "itkGradientDescentLineSearchOptimizerv4.hxx"
152 #endif
153 
154 #endif
Light weight base class for most itk classes.
Define numeric traits for std::vector.
Class which monitors convergence during the course of optimization.
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Gradient descent optimizer with a golden section line search.