go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkLineSearchOptimizer.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 itkLineSearchOptimizer_h
20#define itkLineSearchOptimizer_h
21
22#include "itkSingleValuedNonLinearOptimizer.h"
23
24#include "itkIntTypes.h" //tmp
25
26namespace itk
27{
28
38{
39public:
41
44 using Pointer = SmartPointer<Self>;
45 using ConstPointer = SmartPointer<const Self>;
46
47 // itkNewMacro(Self); because this is an abstract base class.
49
50 using Superclass::MeasureType;
51 using Superclass::ParametersType;
52 using Superclass::DerivativeType;
53 using Superclass::CostFunctionType;
54
56 virtual void
57 SetLineSearchDirection(const ParametersType & arg)
58 {
59 this->m_LineSearchDirection = arg;
60 this->Modified();
61 }
62
63
64 itkGetConstReferenceMacro(LineSearchDirection, ParametersType);
65
75 virtual void
76 SetInitialDerivative(const DerivativeType & itkNotUsed(derivative))
77 {}
78 virtual void
79 SetInitialValue(MeasureType itkNotUsed(value))
80 {}
81
92 virtual void
93 GetCurrentValueAndDerivative(MeasureType & value, DerivativeType & derivative) const = 0;
94
95 virtual void
96 GetCurrentDerivative(DerivativeType & derivative) const = 0;
97
98 virtual MeasureType
99 GetCurrentValue() const = 0;
100
106 itkGetConstMacro(CurrentStepLength, double);
107
117 itkSetMacro(MinimumStepLength, double);
118 itkGetConstMacro(MinimumStepLength, double);
119 itkSetMacro(MaximumStepLength, double);
120 itkGetConstMacro(MaximumStepLength, double);
121 itkSetMacro(InitialStepLengthEstimate, double);
122 itkGetConstMacro(InitialStepLengthEstimate, double);
123
124protected:
126 ~LineSearchOptimizer() override = default;
127 void
128 PrintSelf(std::ostream & os, Indent indent) const override;
129
131
137 virtual void
139
141 double
142 DirectionalDerivative(const DerivativeType & derivative) const;
143
144private:
145 ParametersType m_LineSearchDirection;
146
150};
151
152} // end namespace itk
153
154#endif // #ifndef itkLineSearchOptimizer_h
A base class for LineSearch optimizers.
virtual void GetCurrentDerivative(DerivativeType &derivative) const =0
void PrintSelf(std::ostream &os, Indent indent) const override
virtual void SetCurrentStepLength(double step)
virtual MeasureType GetCurrentValue() const =0
double DirectionalDerivative(const DerivativeType &derivative) const
virtual void SetLineSearchDirection(const ParametersType &arg)
virtual void SetInitialDerivative(const DerivativeType &)
virtual void SetInitialValue(MeasureType)
~LineSearchOptimizer() override=default
ITK_DISALLOW_COPY_AND_MOVE(LineSearchOptimizer)
SmartPointer< const Self > ConstPointer
virtual void GetCurrentValueAndDerivative(MeasureType &value, DerivativeType &derivative) const =0


Generated on 2023-01-13 for elastix by doxygen 1.9.6 elastix logo