ITK  6.0.0
Insight Toolkit
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Types | Private Attributes | List of all members

#include <itkFRPROptimizer.h>

Detailed Description

Implements Fletch-Reeves & Polak-Ribiere optimization using dBrent line search.

This optimizer needs a cost function. This optimizer needs to be able to compute partial derivatives of the cost function with respect to each parameter.

The SetStepLength determines the initial distance to step in a line direction when bounding the minimum (using bracketing triple spaced using a derivative-based search strategy).

The StepTolerance terminates optimization when the parameter values are known to be within this (scaled) distance of the local extreme.

The ValueTolerance terminates optimization when the cost function values at the current parameters and at the local extreme are likely (within a second order approximation) to be within this is tolerance.

Definition at line 70 of file itkFRPROptimizer.h.

+ Inheritance diagram for itk::FRPROptimizer:
+ Collaboration diagram for itk::FRPROptimizer:

Public Types

using ConstPointer = SmartPointer< const Self >
 
using CostFunctionPointer = CostFunctionType::Pointer
 
using CostFunctionType = SingleValuedCostFunction
 
using ParametersType = SingleValuedNonLinearOptimizer::ParametersType
 
using Pointer = SmartPointer< Self >
 
using Self = FRPROptimizer
 
using Superclass = PowellOptimizer
 
- Public Types inherited from itk::PowellOptimizer
using ConstPointer = SmartPointer< const Self >
 
using CostFunctionPointer = CostFunctionType::Pointer
 
using CostFunctionType = SingleValuedCostFunction
 
using ParametersType = SingleValuedNonLinearOptimizer::ParametersType
 
using Pointer = SmartPointer< Self >
 
using Self = PowellOptimizer
 
using Superclass = SingleValuedNonLinearOptimizer
 
- Public Types inherited from itk::SingleValuedNonLinearOptimizer
using ConstPointer = SmartPointer< const Self >
 
using CostFunctionPointer = CostFunctionType::Pointer
 
using CostFunctionType = SingleValuedCostFunction
 
using DerivativeType = CostFunctionType::DerivativeType
 
using MeasureType = CostFunctionType::MeasureType
 
using ParametersType = Superclass::ParametersType
 
using Pointer = SmartPointer< Self >
 
using Self = SingleValuedNonLinearOptimizer
 
using Superclass = NonLinearOptimizer
 
- Public Types inherited from itk::NonLinearOptimizer
using ConstPointer = SmartPointer< const Self >
 
using ParametersType = Superclass::ParametersType
 
using Pointer = SmartPointer< Self >
 
using ScalesType = Superclass::ScalesType
 
using Self = NonLinearOptimizer
 
using Superclass = Optimizer
 
- Public Types inherited from itk::Optimizer
using ConstPointer = SmartPointer< const Self >
 
using ParametersType = OptimizerParameters< double >
 
using Pointer = SmartPointer< Self >
 
using ScalesType = Array< double >
 
using Self = Optimizer
 
using Superclass = Object
 
- Public Types inherited from itk::Object
using ConstPointer = SmartPointer< const Self >
 
using Pointer = SmartPointer< Self >
 
using Self = Object
 
using Superclass = LightObject
 
- Public Types inherited from itk::LightObject
using ConstPointer = SmartPointer< const Self >
 
using Pointer = SmartPointer< Self >
 
using Self = LightObject
 

Public Member Functions

const char * GetNameOfClass () const override
 
void SetToFletchReeves ()
 
void SetToPolakRibiere ()
 
void StartOptimization () override
 
virtual void SetUseUnitLengthGradient (bool _arg)
 
virtual bool GetUseUnitLengthGradient () const
 
virtual void UseUnitLengthGradientOn ()
 
- Public Member Functions inherited from itk::PowellOptimizer
virtual const bool & GetCatchGetValueException () const
 
virtual const unsigned int & GetCurrentIteration () const
 
virtual const unsigned int & GetCurrentLineIteration () const
 
virtual const double & GetMetricWorstPossibleValue () const
 
const char * GetNameOfClass () const override
 
std::string GetStopConditionDescription () const override
 
virtual void SetCatchGetValueException (bool _arg)
 
virtual void SetMetricWorstPossibleValue (double _arg)
 
void StartOptimization () override
 
void StopOptimization ()
 
virtual void SetMaximize (bool _arg)
 
virtual void MaximizeOn ()
 
virtual const bool & GetMaximize () const
 
virtual void SetMaximumIteration (unsigned int _arg)
 
virtual const unsigned int & GetMaximumIteration () const
 
virtual void SetMaximumLineIteration (unsigned int _arg)
 
virtual unsigned int GetMaximumLineIteration () const
 
virtual void SetStepLength (double _arg)
 
virtual const double & GetStepLength () const
 
virtual void SetStepTolerance (double _arg)
 
virtual const double & GetStepTolerance () const
 
virtual void SetValueTolerance (double _arg)
 
virtual const double & GetValueTolerance () const
 
virtual const MeasureTypeGetCurrentCost () const
 
MeasureType GetValue () const
 
- Public Member Functions inherited from itk::SingleValuedNonLinearOptimizer
virtual CostFunctionTypeGetModifiableCostFunction ()
 
const char * GetNameOfClass () const override
 
MeasureType GetValue (const ParametersType &parameters) const
 
virtual void SetCostFunction (CostFunctionType *costFunction)
 
const char * GetNameOfClass () const override
 
- Public Member Functions inherited from itk::Optimizer
virtual const ParametersTypeGetCurrentPosition () const
 
virtual const ParametersTypeGetInitialPosition () const
 
const char * GetNameOfClass () const override
 
virtual std::string GetStopConditionDescription () const
 
virtual void SetInitialPosition (const ParametersType &param)
 
void SetScales (const ScalesType &scales)
 
virtual void StartOptimization ()
 
virtual const ScalesTypeGetScales () const
 
virtual const ScalesTypeGetInverseScales () const
 
- Public Member Functions inherited from itk::Object
unsigned long AddObserver (const EventObject &event, Command *cmd) const
 
unsigned long AddObserver (const EventObject &event, std::function< void(const EventObject &)> function) const
 
LightObject::Pointer CreateAnother () const override
 
virtual void DebugOff () const
 
virtual void DebugOn () const
 
CommandGetCommand (unsigned long tag)
 
bool GetDebug () const
 
MetaDataDictionaryGetMetaDataDictionary ()
 
const MetaDataDictionaryGetMetaDataDictionary () const
 
virtual ModifiedTimeType GetMTime () const
 
const char * GetNameOfClass () const override
 
virtual const TimeStampGetTimeStamp () const
 
bool HasObserver (const EventObject &event) const
 
void InvokeEvent (const EventObject &)
 
void InvokeEvent (const EventObject &) const
 
virtual void Modified () const
 
void Register () const override
 
void RemoveAllObservers ()
 
void RemoveObserver (unsigned long tag) const
 
void SetDebug (bool debugFlag) const
 
void SetReferenceCount (int) override
 
void UnRegister () const noexcept override
 
void SetMetaDataDictionary (const MetaDataDictionary &rhs)
 
void SetMetaDataDictionary (MetaDataDictionary &&rrhs)
 
virtual void SetObjectName (std::string _arg)
 
virtual const std::string & GetObjectName () const
 
- Public Member Functions inherited from itk::LightObject
Pointer Clone () const
 
virtual Pointer CreateAnother () const
 
virtual void Delete ()
 
virtual const char * GetNameOfClass () const
 
virtual int GetReferenceCount () const
 
void Print (std::ostream &os, Indent indent=0) const
 
virtual void Register () const
 
virtual void SetReferenceCount (int)
 
virtual void UnRegister () const noexcept
 

Static Public Member Functions

static Pointer New ()
 
- Static Public Member Functions inherited from itk::PowellOptimizer
static Pointer New ()
 
- Static Public Member Functions inherited from itk::SingleValuedNonLinearOptimizer
static Pointer New ()
 
- Static Public Member Functions inherited from itk::NonLinearOptimizer
static Pointer New ()
 
- Static Public Member Functions inherited from itk::Optimizer
static Pointer New ()
 
- Static Public Member Functions inherited from itk::Object
static bool GetGlobalWarningDisplay ()
 
static void GlobalWarningDisplayOff ()
 
static void GlobalWarningDisplayOn ()
 
static Pointer New ()
 
static void SetGlobalWarningDisplay (bool val)
 
- Static Public Member Functions inherited from itk::LightObject
static void BreakOnError ()
 
static Pointer New ()
 

Protected Member Functions

 FRPROptimizer ()
 
virtual void GetValueAndDerivative (ParametersType &p, double *val, ParametersType *xi)
 
virtual void LineOptimize (ParametersType *p, ParametersType &xi, double *val)
 
virtual void LineOptimize (ParametersType *p, ParametersType &xi, double *val, ParametersType &tempCoord)
 
void PrintSelf (std::ostream &os, Indent indent) const override
 
 ~FRPROptimizer () override
 
- Protected Member Functions inherited from itk::PowellOptimizer
virtual void BracketedLineOptimize (double ax, double bx, double cx, double fa, double functionValueOfb, double fc, double *extX, double *extVal)
 
virtual void BracketedLineOptimize (double ax, double bx, double cx, double fa, double functionValueOfb, double fc, double *extX, double *extVal, ParametersType &tempCoord)
 
double GetLineValue (double x) const
 
double GetLineValue (double x, ParametersType &tempCoord) const
 
virtual unsigned int GetSpaceDimension ()
 
virtual bool GetStop ()
 
virtual void LineBracket (double *x1, double *x2, double *x3, double *f1, double *f2, double *f3)
 
virtual void LineBracket (double *x1, double *x2, double *x3, double *f1, double *f2, double *f3, ParametersType &tempCoord)
 
 PowellOptimizer ()
 
 PowellOptimizer (const PowellOptimizer &)
 
void PrintSelf (std::ostream &os, Indent indent) const override
 
virtual void SetCurrentCost (double _arg)
 
virtual void SetCurrentIteration (unsigned int _arg)
 
void SetCurrentLinePoint (double x, double fx)
 
void SetLine (const ParametersType &origin, const vnl_vector< double > &direction)
 
void SetSpaceDimension (unsigned int dim)
 
virtual void SetStop (bool _arg)
 
void Shift (double *a, double *b, double *c, double d) const
 
void Swap (double *a, double *b) const
 
 ~PowellOptimizer () override
 
- Protected Member Functions inherited from itk::SingleValuedNonLinearOptimizer
void PrintSelf (std::ostream &os, Indent indent) const override
 
 SingleValuedNonLinearOptimizer ()
 
 ~SingleValuedNonLinearOptimizer () override=default
 
- Protected Member Functions inherited from itk::NonLinearOptimizer
 NonLinearOptimizer ()=default
 
 ~NonLinearOptimizer () override
 
- Protected Member Functions inherited from itk::Optimizer
 Optimizer ()
 
void PrintSelf (std::ostream &os, Indent indent) const override
 
virtual void SetCurrentPosition (const ParametersType &param)
 
 ~Optimizer () override=default
 
- Protected Member Functions inherited from itk::Object
 Object ()
 
bool PrintObservers (std::ostream &os, Indent indent) const
 
void PrintSelf (std::ostream &os, Indent indent) const override
 
virtual void SetTimeStamp (const TimeStamp &timeStamp)
 
 ~Object () override
 
- Protected Member Functions inherited from itk::LightObject
virtual LightObject::Pointer InternalClone () const
 
 LightObject ()
 
virtual void PrintHeader (std::ostream &os, Indent indent) const
 
virtual void PrintSelf (std::ostream &os, Indent indent) const
 
virtual void PrintTrailer (std::ostream &os, Indent indent) const
 
virtual ~LightObject ()
 

Private Types

using OptimizationEnum = FRPROptimizerEnums::Optimization
 

Private Attributes

OptimizationEnum m_OptimizationType {}
 
bool m_UseUnitLengthGradient {}
 

Additional Inherited Members

- Protected Attributes inherited from itk::SingleValuedNonLinearOptimizer
CostFunctionPointer m_CostFunction {}
 
- Protected Attributes inherited from itk::Optimizer
ParametersType m_CurrentPosition {}
 
bool m_ScalesInitialized { false }
 
- Protected Attributes inherited from itk::LightObject
std::atomic< int > m_ReferenceCount {}
 

Member Typedef Documentation

◆ ConstPointer

Definition at line 78 of file itkFRPROptimizer.h.

◆ CostFunctionPointer

Definition at line 90 of file itkFRPROptimizer.h.

◆ CostFunctionType

Type of the Cost Function

Definition at line 89 of file itkFRPROptimizer.h.

◆ OptimizationEnum

Definition at line 130 of file itkFRPROptimizer.h.

◆ ParametersType

Definition at line 80 of file itkFRPROptimizer.h.

◆ Pointer

Definition at line 77 of file itkFRPROptimizer.h.

◆ Self

Standard "Self" type alias.

Definition at line 75 of file itkFRPROptimizer.h.

◆ Superclass

Definition at line 76 of file itkFRPROptimizer.h.

Constructor & Destructor Documentation

◆ FRPROptimizer()

itk::FRPROptimizer::FRPROptimizer ( )
protected

◆ ~FRPROptimizer()

itk::FRPROptimizer::~FRPROptimizer ( )
overrideprotected

Member Function Documentation

◆ GetNameOfClass()

const char * itk::FRPROptimizer::GetNameOfClass ( ) const
overridevirtual
See also
LightObject::GetNameOfClass()

Reimplemented from itk::Object.

◆ GetUseUnitLengthGradient()

virtual bool itk::FRPROptimizer::GetUseUnitLengthGradient ( ) const
virtual

Convert gradient to a unit length vector

◆ GetValueAndDerivative()

virtual void itk::FRPROptimizer::GetValueAndDerivative ( ParametersType p,
double *  val,
ParametersType xi 
)
protectedvirtual

Get the value of the n-dimensional cost function at this scalar step distance along the current line direction from the current line origin. Line origin and distances are set via SetLine

◆ LineOptimize() [1/2]

virtual void itk::FRPROptimizer::LineOptimize ( ParametersType p,
ParametersType xi,
double *  val 
)
protectedvirtual

◆ LineOptimize() [2/2]

virtual void itk::FRPROptimizer::LineOptimize ( ParametersType p,
ParametersType xi,
double *  val,
ParametersType tempCoord 
)
protectedvirtual

◆ New()

static Pointer itk::FRPROptimizer::New ( )
static

Method for creation through the object factory.

◆ PrintSelf()

void itk::FRPROptimizer::PrintSelf ( std::ostream &  os,
Indent  indent 
) const
overrideprotectedvirtual

Methods invoked by Print() to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.

Reimplemented from itk::Object.

◆ SetToFletchReeves()

void itk::FRPROptimizer::SetToFletchReeves ( )

Set it to the Fletch-Reeves optimizer

◆ SetToPolakRibiere()

void itk::FRPROptimizer::SetToPolakRibiere ( )

Set it to the Fletch-Reeves optimizer

◆ SetUseUnitLengthGradient()

virtual void itk::FRPROptimizer::SetUseUnitLengthGradient ( bool  _arg)
virtual

Convert gradient to a unit length vector

◆ StartOptimization()

void itk::FRPROptimizer::StartOptimization ( )
overridevirtual

Start optimization.

Reimplemented from itk::Optimizer.

◆ UseUnitLengthGradientOn()

virtual void itk::FRPROptimizer::UseUnitLengthGradientOn ( )
virtual

Convert gradient to a unit length vector

Member Data Documentation

◆ m_OptimizationType

OptimizationEnum itk::FRPROptimizer::m_OptimizationType {}
private

Definition at line 137 of file itkFRPROptimizer.h.

◆ m_UseUnitLengthGradient

bool itk::FRPROptimizer::m_UseUnitLengthGradient {}
private

Definition at line 139 of file itkFRPROptimizer.h.


The documentation for this class was generated from the following file: