ITK  6.0.0
Insight Toolkit
itkFRPROptimizer.h
Go to the documentation of this file.
1/*=========================================================================
2 *
3 * Copyright NumFOCUS
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 * https://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 itkFRPROptimizer_h
19#define itkFRPROptimizer_h
20
21#include "itkPowellOptimizer.h"
22#include "ITKOptimizersExport.h"
23
24namespace itk
25{
31{
32public:
36 enum class Optimization : uint8_t
37 {
38 FletchReeves,
39 PolakRibiere
40 };
41};
42// Define how to print enumeration
43extern ITKOptimizers_EXPORT std::ostream &
44 operator<<(std::ostream & out, const FRPROptimizerEnums::Optimization value);
45
70class ITKOptimizers_EXPORT FRPROptimizer : public PowellOptimizer
71{
72public:
73 ITK_DISALLOW_COPY_AND_MOVE(FRPROptimizer);
79
81
83 itkNewMacro(Self);
84
86 itkOverrideGetNameOfClassMacro(FRPROptimizer);
87
91
93 itkSetMacro(UseUnitLengthGradient, bool);
94 itkGetConstMacro(UseUnitLengthGradient, bool);
95 itkBooleanMacro(UseUnitLengthGradient);
99 void
101
103 void
105
107 void
109
110protected:
112 ~FRPROptimizer() override;
113
114 void
115 PrintSelf(std::ostream & os, Indent indent) const override;
116
120 virtual void
122
123 virtual void
125
126 virtual void
127 LineOptimize(ParametersType * p, ParametersType & xi, double * val, ParametersType & tempCoord);
128
129private:
131#if !defined(ITK_LEGACY_REMOVE)
133 static constexpr OptimizationEnum FletchReeves = OptimizationEnum::FletchReeves;
134 static constexpr OptimizationEnum PolakRibiere = OptimizationEnum::PolakRibiere;
135#endif
136
137 OptimizationEnum m_OptimizationType{};
138
139 bool m_UseUnitLengthGradient{};
140}; // end of class
141} // end of namespace itk
142
143#endif
Contains enum classes used by FRPROptimizer class.
Implements Fletch-Reeves & Polak-Ribiere optimization using dBrent line search.
virtual void GetValueAndDerivative(ParametersType &p, double *val, ParametersType *xi)
~FRPROptimizer() override
void StartOptimization() override
virtual void LineOptimize(ParametersType *p, ParametersType &xi, double *val)
virtual void LineOptimize(ParametersType *p, ParametersType &xi, double *val, ParametersType &tempCoord)
void PrintSelf(std::ostream &os, Indent indent) const override
Control indentation during Print() invocation.
Definition: itkIndent.h:50
Light weight base class for most itk classes.
Implements Powell optimization using Brent line search.
This class is a base for the CostFunctions returning a single value.
SmartPointer< Self > Pointer
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
ITKCommon_EXPORT std::ostream & operator<<(std::ostream &out, typename AnatomicalOrientation::CoordinateEnum value)