Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef __itkLineSearchOptimizer_h
00016 #define __itkLineSearchOptimizer_h
00017
00018 #include "itkSingleValuedNonLinearOptimizer.h"
00019
00020 namespace itk
00021 {
00022
00031 class LineSearchOptimizer : public SingleValuedNonLinearOptimizer
00032 {
00033 public:
00034
00035 typedef LineSearchOptimizer Self;
00036 typedef SingleValuedNonLinearOptimizer Superclass;
00037 typedef SmartPointer<Self> Pointer;
00038 typedef SmartPointer<const Self> ConstPointer;
00039
00040
00041 itkTypeMacro(LineSearchOptimizer, SingleValuedNonLinearOptimizer);
00042
00043 typedef Superclass::MeasureType MeasureType;
00044 typedef Superclass::ParametersType ParametersType;
00045 typedef Superclass::DerivativeType DerivativeType;
00046 typedef Superclass::CostFunctionType CostFunctionType;
00047
00049 virtual void SetLineSearchDirection(const ParametersType & arg)
00050 {
00051 m_LineSearchDirection = arg;
00052 this->Modified();
00053 }
00054 itkGetConstReferenceMacro(LineSearchDirection, ParametersType);
00055
00066 virtual void SetInitialDerivative(const DerivativeType & derivative){};
00067 virtual void SetInitialValue(MeasureType value){};
00068
00079 virtual void GetCurrentValueAndDerivative(
00080 MeasureType & value, DerivativeType & derivative) const = 0;
00081 virtual void GetCurrentDerivative(DerivativeType & derivative) const = 0;
00082 virtual MeasureType GetCurrentValue(void) const = 0;
00083
00089 itkGetConstMacro(CurrentStepLength, double);
00090
00100 itkSetMacro(MinimumStepLength, double);
00101 itkGetConstMacro(MinimumStepLength, double);
00102 itkSetMacro(MaximumStepLength, double);
00103 itkGetConstMacro(MaximumStepLength, double);
00104 itkSetMacro(InitialStepLengthEstimate, double);
00105 itkGetConstMacro(InitialStepLengthEstimate, double);
00106
00107 protected:
00108
00109 LineSearchOptimizer();
00110 virtual ~LineSearchOptimizer() {};
00111 void PrintSelf(std::ostream& os, Indent indent) const {};
00112
00113 double m_CurrentStepLength;
00114
00120 virtual void SetCurrentStepLength(double step);
00121
00123 double DirectionalDerivative(const DerivativeType & derivative) const;
00124
00125 private:
00126 LineSearchOptimizer(const Self&);
00127 void operator=(const Self&);
00128
00129 ParametersType m_LineSearchDirection;
00130
00131 double m_MinimumStepLength;
00132 double m_MaximumStepLength;
00133 double m_InitialStepLengthEstimate;
00134
00135 };
00136
00137 }
00138
00139 #endif // #ifndef __itkLineSearchOptimizer_h
00140