ITK  4.6.0
Insight Segmentation and Registration Toolkit
itkOnePlusOneEvolutionaryOptimizerv4.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 __itkOnePlusOneEvolutionaryOptimizerv4_h
19 #define __itkOnePlusOneEvolutionaryOptimizerv4_h
20 
23 #include <string>
24 
25 namespace itk
26 {
68 template<typename TInternalComputationValueType>
70  public ObjectToObjectOptimizerBaseTemplate<TInternalComputationValueType>
71 {
72 public:
78 
80  itkNewMacro(Self);
81 
84 
88 
91 
94 
97 
100 
102  itkSetMacro(MaximumIteration, unsigned int);
103  itkGetConstReferenceMacro(MaximumIteration, unsigned int);
105 
107  itkSetMacro(GrowthFactor, double);
108  itkGetConstReferenceMacro(GrowthFactor, double);
110 
112  itkSetMacro(ShrinkFactor, double);
113  itkGetConstReferenceMacro(ShrinkFactor, double);
115 
117  itkSetMacro(InitialRadius, double);
118  itkGetConstReferenceMacro(InitialRadius, double);
120 
123  itkSetMacro(Epsilon, double);
124  itkGetConstReferenceMacro(Epsilon, double);
126 
128  itkGetConstReferenceMacro(FrobeniusNorm, double);
129 
131 
138  void Initialize(double initialRadius, double grow = -1, double shrink = -1);
139 
141  itkGetConstReferenceMacro(CurrentCost, MeasureType);
142  virtual const MeasureType & GetValue() const ITK_OVERRIDE;
144 
146  itkGetConstReferenceMacro(Initialized, bool);
147 
151  virtual void StartOptimization(bool doOnlyInitialization = false) ITK_OVERRIDE;
152 
157  { m_Stop = true; }
158 
159  itkGetConstReferenceMacro(CatchGetValueException, bool);
160  itkSetMacro(CatchGetValueException, bool);
161 
162  itkGetConstReferenceMacro(MetricWorstPossibleValue, double);
163  itkSetMacro(MetricWorstPossibleValue, double);
164 
165  virtual const std::string GetStopConditionDescription() const ITK_OVERRIDE;
166 
167 protected:
169  OnePlusOneEvolutionaryOptimizerv4(const OnePlusOneEvolutionaryOptimizerv4 &);
170  virtual ~OnePlusOneEvolutionaryOptimizerv4();
171  virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
172 
173 private:
174 
177 
179  unsigned int m_MaximumIteration;
180 
183 
186  double m_Epsilon;
187 
190 
193 
196 
199 
202 
207  bool m_Stop;
208 
210  std::ostringstream m_StopConditionDescription;
211 
215 }; // end of class
216 } // end of namespace itk
217 
218 #ifndef ITK_MANUAL_INSTANTIATION
219 #include "itkOnePlusOneEvolutionaryOptimizerv4.hxx"
220 #endif
221 
222 #endif
Statistics::RandomVariateGeneratorBase NormalVariateGeneratorType
OptimizerParameters< TInternalComputationValueType > ScalesType
Light weight base class for most itk classes.
void Initialize(double initialRadius, double grow=-1, double shrink=-1)
OptimizerParameters< TInternalComputationValueType > ParametersType
virtual void PrintSelf(std::ostream &os, Indent indent) const ITK_OVERRIDE
virtual const MeasureType & GetValue() const ITK_OVERRIDE
virtual const std::string GetStopConditionDescription() const ITK_OVERRIDE
virtual void StartOptimization(bool doOnlyInitialization=false) ITK_OVERRIDE
ObjectToObjectOptimizerBaseTemplate< TInternalComputationValueType > Superclass
Defines common interfaces for random variate generators.
This class is a base for a CostFunction that returns a single value.
void SetNormalVariateGenerator(NormalVariateGeneratorType *generator)
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Abstract base for object-to-object optimizers.