ITK  6.0.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 * 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 itkSingleValuedNonLinearVnlOptimizer_h
19#define itkSingleValuedNonLinearVnlOptimizer_h
20
23#include "itkCommand.h"
24#include "ITKOptimizersExport.h"
25
26namespace itk
27{
38{
39public:
40 ITK_DISALLOW_COPY_AND_MOVE(SingleValuedNonLinearVnlOptimizer);
41
47
49 itkOverrideGetNameOfClassMacro(SingleValuedNonLinearVnlOptimizer);
50
56
63 void
64 SetCostFunction(SingleValuedCostFunction * costFunction) override = 0;
65
71 itkGetConstReferenceMacro(Maximize, bool);
72 itkSetMacro(Maximize, bool);
73 itkBooleanMacro(Maximize);
74 bool
76 {
77 return !m_Maximize;
78 }
79 void
81 {
82 this->SetMaximize(!v);
83 }
84 void
86 {
87 this->MaximizeOff();
88 }
89 void
91 {
92 this->MaximizeOn();
93 }
101 itkGetConstReferenceMacro(CachedValue, MeasureType);
102 itkGetConstReferenceMacro(CachedDerivative, DerivativeType);
103 itkGetConstReferenceMacro(CachedCurrentPosition, ParametersType);
109 virtual bool
111 {
112 return true;
113 }
114
115protected:
118
120
121 void
123
126
129
134
136 void
137 PrintSelf(std::ostream & os, Indent indent) const override;
138
139private:
141 void
143
144 CostFunctionAdaptorType * m_CostFunctionAdaptor{};
145
146 bool m_Maximize{};
147
149
150 mutable ParametersType m_CachedCurrentPosition{};
151 mutable MeasureType m_CachedValue{};
152 mutable DerivativeType m_CachedDerivative{};
153};
154} // end namespace itk
155
156#endif
Array class with size defined at construction time.
Definition: itkArray.h:48
Abstraction of the Events used to communicating among filters and with GUIs.
Control indentation during Print() invocation.
Definition: itkIndent.h:50
Light weight base class for most itk classes.
A Command subclass that calls a pointer to a member function.
Definition: itkCommand.h:165
This class is a base for the CostFunctions returning a single value.
This class is a base for the Optimization methods that optimize a single valued function.
This class is a base for the Optimization methods that optimize a single valued function.
void PrintSelf(std::ostream &os, Indent indent) const override
const CostFunctionAdaptorType * GetCostFunctionAdaptor() const
void IterationReport(const EventObject &event)
void SetCostFunction(SingleValuedCostFunction *costFunction) override=0
CostFunctionAdaptorType * GetNonConstCostFunctionAdaptor() const
CostFunctionAdaptorType * GetCostFunctionAdaptor()
void SetCostFunctionAdaptor(CostFunctionAdaptorType *adaptor)
This class is an Adaptor that allows to pass itk::SingleValuedCostFunctions to vnl_optimizers expecti...
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....