OTB  9.0.0
Orfeo Toolbox
otbExhaustiveExponentialOptimizer.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2022 Centre National d'Etudes Spatiales (CNES)
3  *
4  * This file is part of Orfeo Toolbox
5  *
6  * https://www.orfeo-toolbox.org/
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  */
20 
21 #ifndef otbExhaustiveExponentialOptimizer_h
22 #define otbExhaustiveExponentialOptimizer_h
23 
24 #include "itkSingleValuedNonLinearOptimizer.h"
25 
26 namespace otb
27 {
28 
47 class ITK_ABI_EXPORT ExhaustiveExponentialOptimizer : public itk::SingleValuedNonLinearOptimizer
48 {
49 public:
52  typedef itk::SingleValuedNonLinearOptimizer Superclass;
53  typedef itk::SmartPointer<Self> Pointer;
54  typedef itk::SmartPointer<const Self> ConstPointer;
55 
56  typedef itk::Array<unsigned long> StepsType;
58  itkNewMacro(Self);
59 
61  itkTypeMacro(ExhaustiveExponentialOptimizer, itk::SingleValuedNonLinearOptimizer);
62 
63  void StartOptimization(void) override;
64 
65  void StartWalking(void);
66  void ResumeWalking(void);
67  void StopWalking(void);
68 
69  itkSetMacro(GeometricProgression, double);
70  itkSetMacro(NumberOfSteps, StepsType);
71  itkSetMacro(StepLength, double);
72  itkGetConstReferenceMacro(GeometricProgression, double);
73  itkGetConstReferenceMacro(NumberOfSteps, StepsType);
74  itkGetConstReferenceMacro(StepLength, double);
75  itkGetConstReferenceMacro(CurrentValue, MeasureType);
76  itkGetConstReferenceMacro(MaximumMetricValue, MeasureType);
77  itkGetConstReferenceMacro(MinimumMetricValue, MeasureType);
78  itkGetConstReferenceMacro(MinimumMetricValuePosition, ParametersType);
79  itkGetConstReferenceMacro(MaximumMetricValuePosition, ParametersType);
80  itkGetConstReferenceMacro(CurrentIndex, ParametersType);
81  itkGetConstReferenceMacro(MaximumNumberOfIterations, unsigned long);
82 
83 protected:
86  {
87  }
88  void PrintSelf(std::ostream& os, itk::Indent indent) const override;
89 
91  void AdvanceOneStep(void);
92  void IncrementIndex(ParametersType& param);
94 
95 protected:
96  MeasureType m_CurrentValue;
98  double m_StepLength;
99  unsigned long m_CurrentIteration;
100  bool m_Stop;
101  unsigned int m_CurrentParameter;
103  ParametersType m_CurrentIndex;
105  MeasureType m_MaximumMetricValue;
106  MeasureType m_MinimumMetricValue;
109 
110 private:
111  ExhaustiveExponentialOptimizer(const Self&) = delete;
112  void operator=(const Self&) = delete;
113 };
114 
115 } // end namespace otb
116 
117 #endif
otb::ExhaustiveExponentialOptimizer::m_NumberOfSteps
StepsType m_NumberOfSteps
Definition: otbExhaustiveExponentialOptimizer.h:97
otb::ExhaustiveExponentialOptimizer::m_CurrentParameter
unsigned int m_CurrentParameter
Definition: otbExhaustiveExponentialOptimizer.h:101
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::ExhaustiveExponentialOptimizer::~ExhaustiveExponentialOptimizer
~ExhaustiveExponentialOptimizer() override
Definition: otbExhaustiveExponentialOptimizer.h:85
otb::ExhaustiveExponentialOptimizer::m_MinimumMetricValuePosition
ParametersType m_MinimumMetricValuePosition
Definition: otbExhaustiveExponentialOptimizer.h:107
otb::ExhaustiveExponentialOptimizer::m_CurrentValue
MeasureType m_CurrentValue
Definition: otbExhaustiveExponentialOptimizer.h:96
otb::ExhaustiveExponentialOptimizer::Superclass
itk::SingleValuedNonLinearOptimizer Superclass
Definition: otbExhaustiveExponentialOptimizer.h:52
otb::ExhaustiveExponentialOptimizer::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbExhaustiveExponentialOptimizer.h:53
otb::ExhaustiveExponentialOptimizer::m_GeometricProgression
double m_GeometricProgression
Definition: otbExhaustiveExponentialOptimizer.h:102
otb::ExhaustiveExponentialOptimizer::m_MinimumMetricValue
MeasureType m_MinimumMetricValue
Definition: otbExhaustiveExponentialOptimizer.h:106
otb::ExhaustiveExponentialOptimizer::m_StepLength
double m_StepLength
Definition: otbExhaustiveExponentialOptimizer.h:98
otb::ExhaustiveExponentialOptimizer::m_Stop
bool m_Stop
Definition: otbExhaustiveExponentialOptimizer.h:100
otb::ExhaustiveExponentialOptimizer::StepsType
itk::Array< unsigned long > StepsType
Definition: otbExhaustiveExponentialOptimizer.h:56
otb::ExhaustiveExponentialOptimizer::m_MaximumMetricValuePosition
ParametersType m_MaximumMetricValuePosition
Definition: otbExhaustiveExponentialOptimizer.h:108
otb::ExhaustiveExponentialOptimizer
This optimizer performs an exhaustive search on an exponential scale.
Definition: otbExhaustiveExponentialOptimizer.h:47
otb::ExhaustiveExponentialOptimizer::m_CurrentIndex
ParametersType m_CurrentIndex
Definition: otbExhaustiveExponentialOptimizer.h:103
otb::ExhaustiveExponentialOptimizer::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbExhaustiveExponentialOptimizer.h:54
otb::ExhaustiveExponentialOptimizer::m_CurrentIteration
unsigned long m_CurrentIteration
Definition: otbExhaustiveExponentialOptimizer.h:99
otb::ExhaustiveExponentialOptimizer::m_MaximumMetricValue
MeasureType m_MaximumMetricValue
Definition: otbExhaustiveExponentialOptimizer.h:105
otb::ExhaustiveExponentialOptimizer::Self
ExhaustiveExponentialOptimizer Self
Definition: otbExhaustiveExponentialOptimizer.h:51
otb::ExhaustiveExponentialOptimizer::m_MaximumNumberOfIterations
unsigned long m_MaximumNumberOfIterations
Definition: otbExhaustiveExponentialOptimizer.h:104