go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkLineSearchOptimizer.h
Go to the documentation of this file.
00001 /*======================================================================
00002 
00003   This file is part of the elastix software.
00004 
00005   Copyright (c) University Medical Center Utrecht. All rights reserved.
00006   See src/CopyrightElastix.txt or http://elastix.isi.uu.nl/legal.php for
00007   details.
00008 
00009      This software is distributed WITHOUT ANY WARRANTY; without even
00010      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00011      PURPOSE. See the above copyright notices for more information.
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     //itkNewMacro(Self); because this is an abstract base class.
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&); //purposely not implemented
00127     void operator=(const Self&); //purposely not implemented
00128 
00129     ParametersType      m_LineSearchDirection;
00130 
00131     double              m_MinimumStepLength;
00132     double              m_MaximumStepLength;
00133     double              m_InitialStepLengthEstimate;
00134 
00135   }; // end class LineSearchOptimizer;
00136 
00137 } // end namespace itk
00138 
00139 #endif // #ifndef __itkLineSearchOptimizer_h
00140 


Generated on 11-05-2011 for elastix by doxygen 1.7.4 elastix logo