ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkSingleValuedNonLinearVnlOptimizer.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
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 {
37 class ITKOptimizers_EXPORT SingleValuedNonLinearVnlOptimizer:
39 {
40 public:
41  ITK_DISALLOW_COPY_AND_ASSIGN(SingleValuedNonLinearVnlOptimizer);
42 
48 
51  SingleValueNonLinearOptimizer);
52 
58 
65  void SetCostFunction(SingleValuedCostFunction *costFunction) override = 0;
66 
72  itkGetConstReferenceMacro(Maximize, bool);
73  itkSetMacro(Maximize, bool);
74  itkBooleanMacro(Maximize);
75  bool GetMinimize() const
76  { return !m_Maximize; }
77  void SetMinimize(bool v)
78  { this->SetMaximize(!v); }
79  void MinimizeOn()
80  { this->MaximizeOff(); }
81  void MinimizeOff()
82  { this->MaximizeOn(); }
84 
90  itkGetConstReferenceMacro(CachedValue, MeasureType);
91  itkGetConstReferenceMacro(CachedDerivative, DerivativeType);
92  itkGetConstReferenceMacro(CachedCurrentPosition, ParametersType);
94 
95 protected:
98 
100 
101  void SetCostFunctionAdaptor(CostFunctionAdaptorType *adaptor);
102 
103  const CostFunctionAdaptorType * GetCostFunctionAdaptor() const;
104 
105  CostFunctionAdaptorType * GetCostFunctionAdaptor();
106 
109  CostFunctionAdaptorType * GetNonConstCostFunctionAdaptor() const;
110 
112  void PrintSelf(std::ostream & os, Indent indent) const override;
113 
114 private:
116  void IterationReport(const EventObject & event);
117 
119 
121 
123 
127 };
128 } // end namespace itk
129 
130 #endif
Array class with size defined at construction time.
Definition: itkArray.h:46
This class is a base for the CostFunctions returning a single value.
Light weight base class for most itk classes.
This class is a base for the Optimization methods that optimize a single valued function.
This class is an Adaptor that allows to pass itk::SingleValuedCostFunctions to vnl_optimizers expecti...
This class is a base for the Optimization methods that optimize a single valued function.
A Command subclass that calls a pointer to a member function.
Definition: itkCommand.h:163
Abstraction of the Events used to communicating among filters and with GUIs.
Control indentation during Print() invocation.
Definition: itkIndent.h:49