18 #ifndef itkSingleValuedVnlCostFunctionAdaptor_h
19 #define itkSingleValuedVnlCostFunctionAdaptor_h
22 #include "vnl/vnl_cost_function.h"
23 #include "ITKOptimizersExport.h"
38 public vnl_cost_function
68 { m_CostFunction = costFunction; }
72 {
return m_CostFunction; }
75 InternalMeasureType f(
const InternalParametersType & inparameters)
override;
78 void gradf(
const InternalParametersType & inparameters,
79 InternalDerivativeType & gradient)
override;
82 void compute(
const InternalParametersType & x,
83 InternalMeasureType *f,
84 InternalDerivativeType *g)
override;
87 void ConvertExternalToInternalGradient(
88 const DerivativeType & input,
89 InternalDerivativeType & output)
const;
92 void SetScales(
const ScalesType & scales);
102 void SetNegateCostFunction(
bool value);
104 bool GetNegateCostFunction()
const;
119 const MeasureType & GetCachedValue()
const;
121 const DerivativeType & GetCachedDerivative()
const;
123 const ParametersType & GetCachedCurrentParameters()
const;
129 void ReportIteration(
const EventObject & event)
const;
Array class with size defined at construction time.
This class is a base for the CostFunctions returning a single value.
double InternalMeasureType
Object::Pointer m_Reporter
void NegateCostFunctionOff()
This class is an Adaptor that allows to pass itk::SingleValuedCostFunctions to vnl_optimizers expecti...
MeasureType m_CachedValue
bool m_NegateCostFunction
SingleValuedCostFunction::Pointer m_CostFunction
const SingleValuedCostFunction * GetCostFunction() const
void NegateCostFunctionOn()
vnl_vector< double > InternalParametersType
DerivativeType m_CachedDerivative
Array< ParametersValueType > DerivativeType
void SetCostFunction(SingleValuedCostFunction *costFunction)
Superclass::ParametersType ParametersType
ParametersType m_CachedCurrentParameters
Abstraction of the Events used to communicating among filters and with GUIs.
ScalesType m_InverseScales
SingleValuedCostFunction::MeasureType MeasureType
SingleValuedCostFunction::ParametersType ParametersType
Superclass for callback/observer methods.
vnl_vector< double > InternalDerivativeType