go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itk::LineSearchOptimizer Class Referenceabstract

#include <itkLineSearchOptimizer.h>

Detailed Description

A base class for LineSearch optimizers.

Scales are expected to be handled by the main optimizer.

Definition at line 37 of file itkLineSearchOptimizer.h.

Inheritance diagram for itk::LineSearchOptimizer:

Public Types

using ConstPointer = SmartPointer<const Self>
 
using Pointer = SmartPointer<Self>
 
using Self = LineSearchOptimizer
 
using Superclass = SingleValuedNonLinearOptimizer
 

Public Member Functions

virtual const char * GetClassName () const
 
virtual void GetCurrentDerivative (DerivativeType &derivative) const =0
 
virtual double GetCurrentStepLength () const
 
virtual MeasureType GetCurrentValue () const =0
 
virtual void GetCurrentValueAndDerivative (MeasureType &value, DerivativeType &derivative) const =0
 
virtual double GetInitialStepLengthEstimate () const
 
virtual const ParametersType & GetLineSearchDirection ()
 
virtual double GetMaximumStepLength () const
 
virtual double GetMinimumStepLength () const
 
 ITK_DISALLOW_COPY_AND_MOVE (LineSearchOptimizer)
 
virtual void SetInitialDerivative (const DerivativeType &)
 
virtual void SetInitialStepLengthEstimate (double _arg)
 
virtual void SetInitialValue (MeasureType)
 
virtual void SetLineSearchDirection (const ParametersType &arg)
 
virtual void SetMaximumStepLength (double _arg)
 
virtual void SetMinimumStepLength (double _arg)
 

Protected Member Functions

double DirectionalDerivative (const DerivativeType &derivative) const
 
 LineSearchOptimizer ()
 
void PrintSelf (std::ostream &os, Indent indent) const override
 
virtual void SetCurrentStepLength (double step)
 
 ~LineSearchOptimizer () override=default
 

Protected Attributes

double m_CurrentStepLength {}
 

Private Attributes

double m_InitialStepLengthEstimate {}
 
ParametersType m_LineSearchDirection {}
 
double m_MaximumStepLength {}
 
double m_MinimumStepLength {}
 

Member Typedef Documentation

◆ ConstPointer

using itk::LineSearchOptimizer::ConstPointer = SmartPointer<const Self>

Definition at line 45 of file itkLineSearchOptimizer.h.

◆ Pointer

using itk::LineSearchOptimizer::Pointer = SmartPointer<Self>

Definition at line 44 of file itkLineSearchOptimizer.h.

◆ Self

◆ Superclass

Constructor & Destructor Documentation

◆ LineSearchOptimizer()

itk::LineSearchOptimizer::LineSearchOptimizer ( )
protected

◆ ~LineSearchOptimizer()

itk::LineSearchOptimizer::~LineSearchOptimizer ( )
overrideprotecteddefault

Member Function Documentation

◆ DirectionalDerivative()

double itk::LineSearchOptimizer::DirectionalDerivative ( const DerivativeType & derivative) const
protected

Computes the inner product of the argument and the line search direction.

◆ GetClassName()

virtual const char * itk::LineSearchOptimizer::GetClassName ( ) const
virtual

◆ GetCurrentDerivative()

virtual void itk::LineSearchOptimizer::GetCurrentDerivative ( DerivativeType & derivative) const
pure virtual

◆ GetCurrentStepLength()

virtual double itk::LineSearchOptimizer::GetCurrentStepLength ( ) const
virtual

StepLength is a a scalar, defined as: m_InitialPosition + StepLength * m_LineSearchDirection = m_CurrentPosition

◆ GetCurrentValue()

virtual MeasureType itk::LineSearchOptimizer::GetCurrentValue ( ) const
pure virtual

◆ GetCurrentValueAndDerivative()

virtual void itk::LineSearchOptimizer::GetCurrentValueAndDerivative ( MeasureType & value,
DerivativeType & derivative ) const
pure virtual

These methods must be implemented by inheriting classes. It depends on the specific line search algorithm if it already computed the value/derivative at the current position (in this case it can just copy the cached data). If it did not compute the value/derivative, it should call the cost function and evaluate the value/derivative at the current position.

These methods allow the main optimization algorithm to reuse data that the LineSearch algorithm already computed.

Implemented in itk::MoreThuenteLineSearchOptimizer.

◆ GetInitialStepLengthEstimate()

virtual double itk::LineSearchOptimizer::GetInitialStepLengthEstimate ( ) const
virtual

◆ GetLineSearchDirection()

virtual const ParametersType & itk::LineSearchOptimizer::GetLineSearchDirection ( )
virtual

◆ GetMaximumStepLength()

virtual double itk::LineSearchOptimizer::GetMaximumStepLength ( ) const
virtual

◆ GetMinimumStepLength()

virtual double itk::LineSearchOptimizer::GetMinimumStepLength ( ) const
virtual

◆ ITK_DISALLOW_COPY_AND_MOVE()

itk::LineSearchOptimizer::ITK_DISALLOW_COPY_AND_MOVE ( LineSearchOptimizer )

◆ PrintSelf()

void itk::LineSearchOptimizer::PrintSelf ( std::ostream & os,
Indent indent ) const
overrideprotected

◆ SetCurrentStepLength()

virtual void itk::LineSearchOptimizer::SetCurrentStepLength ( double step)
protectedvirtual

Set the current step length AND the current position, where the current position is computed as: m_CurrentPosition = m_InitialPosition + StepLength * m_LineSearchDirection

◆ SetInitialDerivative()

virtual void itk::LineSearchOptimizer::SetInitialDerivative ( const DerivativeType & )
inlinevirtual

Inheriting classes may override these methods if they need value/derivative information of the cost function at the initial position.

NB: It is not guaranteed that these methods are called. If a main optimizer by chance has this information, it should call these methods, to avoid possible unnecessary computations.

Reimplemented in itk::MoreThuenteLineSearchOptimizer.

Definition at line 76 of file itkLineSearchOptimizer.h.

◆ SetInitialStepLengthEstimate()

virtual void itk::LineSearchOptimizer::SetInitialStepLengthEstimate ( double _arg)
virtual

◆ SetInitialValue()

virtual void itk::LineSearchOptimizer::SetInitialValue ( MeasureType )
inlinevirtual

Reimplemented in itk::MoreThuenteLineSearchOptimizer.

Definition at line 79 of file itkLineSearchOptimizer.h.

◆ SetLineSearchDirection()

virtual void itk::LineSearchOptimizer::SetLineSearchDirection ( const ParametersType & arg)
inlinevirtual

Set/Get the LineSearchDirection

Definition at line 57 of file itkLineSearchOptimizer.h.

◆ SetMaximumStepLength()

virtual void itk::LineSearchOptimizer::SetMaximumStepLength ( double _arg)
virtual

◆ SetMinimumStepLength()

virtual void itk::LineSearchOptimizer::SetMinimumStepLength ( double _arg)
virtual

Settings: the maximum/minimum step length and the initial estimate. NOTE: Not all line search methods are guaranteed to do something with this information. However, if a certain optimizer (using a line search optimizer) has any idea about the steplength it can call these methods, 'in the hope' that the line search optimizer does something sensible with it.

Field Documentation

◆ m_CurrentStepLength

double itk::LineSearchOptimizer::m_CurrentStepLength {}
protected

Definition at line 130 of file itkLineSearchOptimizer.h.

◆ m_InitialStepLengthEstimate

double itk::LineSearchOptimizer::m_InitialStepLengthEstimate {}
private

Definition at line 149 of file itkLineSearchOptimizer.h.

◆ m_LineSearchDirection

ParametersType itk::LineSearchOptimizer::m_LineSearchDirection {}
private

Definition at line 145 of file itkLineSearchOptimizer.h.

◆ m_MaximumStepLength

double itk::LineSearchOptimizer::m_MaximumStepLength {}
private

Definition at line 148 of file itkLineSearchOptimizer.h.

◆ m_MinimumStepLength

double itk::LineSearchOptimizer::m_MinimumStepLength {}
private

Definition at line 147 of file itkLineSearchOptimizer.h.



Generated on 2024-07-17 for elastix by doxygen 1.11.0 (9b424b03c9833626cd435af22a444888fbbb192d) elastix logo