ITK  5.3.0
Insight Toolkit
itkSingleValuedNonLinearVnlOptimizer.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  * 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 itkSingleValuedNonLinearVnlOptimizer_h
19 #define itkSingleValuedNonLinearVnlOptimizer_h
20 
23 #include "itkCommand.h"
24 #include "ITKOptimizersExport.h"
25 
26 namespace itk
27 {
38 {
39 public:
40  ITK_DISALLOW_COPY_AND_MOVE(SingleValuedNonLinearVnlOptimizer);
41 
47 
49  itkTypeMacro(SingleValuedNonLinearVnlOptimizer, SingleValueNonLinearOptimizer);
50 
56 
63  void
64  SetCostFunction(SingleValuedCostFunction * costFunction) override = 0;
65 
71  itkGetConstReferenceMacro(Maximize, bool);
72  itkSetMacro(Maximize, bool);
73  itkBooleanMacro(Maximize);
74  bool
75  GetMinimize() const
76  {
77  return !m_Maximize;
78  }
79  void
80  SetMinimize(bool v)
81  {
82  this->SetMaximize(!v);
83  }
84  void
86  {
87  this->MaximizeOff();
88  }
89  void
91  {
92  this->MaximizeOn();
93  }
95 
101  itkGetConstReferenceMacro(CachedValue, MeasureType);
102  itkGetConstReferenceMacro(CachedDerivative, DerivativeType);
103  itkGetConstReferenceMacro(CachedCurrentPosition, ParametersType);
105 
106 protected:
109 
111 
112  void
113  SetCostFunctionAdaptor(CostFunctionAdaptorType * adaptor);
114 
116  GetCostFunctionAdaptor() const;
117 
119  GetCostFunctionAdaptor();
120 
124  GetNonConstCostFunctionAdaptor() const;
125 
127  void
128  PrintSelf(std::ostream & os, Indent indent) const override;
129 
130 private:
132  void
133  IterationReport(const EventObject & event);
134 
136 
138 
140 
144 };
145 } // end namespace itk
146 
147 #endif
itk::OptimizerParameters< double >
itk::SingleValuedNonLinearVnlOptimizer::m_CachedCurrentPosition
ParametersType m_CachedCurrentPosition
Definition: itkSingleValuedNonLinearVnlOptimizer.h:141
itk::SingleValuedNonLinearOptimizer
This class is a base for the Optimization methods that optimize a single valued function.
Definition: itkSingleValuedNonLinearOptimizer.h:35
itk::ReceptorMemberCommand
A Command subclass that calls a pointer to a member function.
Definition: itkCommand.h:168
itk::SingleValuedNonLinearVnlOptimizer::SetMinimize
void SetMinimize(bool v)
Definition: itkSingleValuedNonLinearVnlOptimizer.h:80
itk::SingleValuedNonLinearVnlOptimizer::m_CostFunctionAdaptor
CostFunctionAdaptorType * m_CostFunctionAdaptor
Definition: itkSingleValuedNonLinearVnlOptimizer.h:135
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::SingleValuedVnlCostFunctionAdaptor
This class is an Adaptor that allows to pass itk::SingleValuedCostFunctions to vnl_optimizers expecti...
Definition: itkSingleValuedVnlCostFunctionAdaptor.h:37
itk::SingleValuedNonLinearVnlOptimizer::m_Command
CommandType::Pointer m_Command
Definition: itkSingleValuedNonLinearVnlOptimizer.h:139
itk::SingleValuedNonLinearVnlOptimizer::GetMinimize
bool GetMinimize() const
Definition: itkSingleValuedNonLinearVnlOptimizer.h:75
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:59
itk::SingleValuedNonLinearVnlOptimizer::m_CachedDerivative
DerivativeType m_CachedDerivative
Definition: itkSingleValuedNonLinearVnlOptimizer.h:143
itk::SingleValuedNonLinearVnlOptimizer::m_CachedValue
MeasureType m_CachedValue
Definition: itkSingleValuedNonLinearVnlOptimizer.h:142
itk::SingleValuedCostFunction
This class is a base for the CostFunctions returning a single value.
Definition: itkSingleValuedCostFunction.h:34
itk::SingleValuedNonLinearVnlOptimizer::m_Maximize
bool m_Maximize
Definition: itkSingleValuedNonLinearVnlOptimizer.h:137
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::SingleValuedNonLinearOptimizer::MeasureType
CostFunctionType::MeasureType MeasureType
Definition: itkSingleValuedNonLinearOptimizer.h:62
itk::Array
Array class with size defined at construction time.
Definition: itkArray.h:47
itk::EventObject
Abstraction of the Events used to communicating among filters and with GUIs.
Definition: itkEventObject.h:57
itk::SingleValuedNonLinearVnlOptimizer::MinimizeOn
void MinimizeOn()
Definition: itkSingleValuedNonLinearVnlOptimizer.h:85
itk::SingleValuedNonLinearVnlOptimizer
This class is a base for the Optimization methods that optimize a single valued function.
Definition: itkSingleValuedNonLinearVnlOptimizer.h:37
itkSingleValuedNonLinearOptimizer.h
itkSingleValuedVnlCostFunctionAdaptor.h
itkCommand.h
itk::SingleValuedNonLinearVnlOptimizer::MinimizeOff
void MinimizeOff()
Definition: itkSingleValuedNonLinearVnlOptimizer.h:90