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 virtual InternalMeasureType f(
const InternalParametersType & inparameters) ITK_OVERRIDE;
78 virtual void gradf(
const InternalParametersType & inparameters,
79 InternalDerivativeType & gradient) ITK_OVERRIDE;
82 virtual void compute(
const InternalParametersType & x,
83 InternalMeasureType *f,
84 InternalDerivativeType *g) ITK_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.
SingleValuedCostFunction::DerivativeType DerivativeType
This class is a base for the CostFunctions returning a single value.
Object::Pointer m_Reporter
void NegateCostFunctionOff()
vnl_vector< double > InternalDerivativeType
This class is an Adaptor that allows to pass itk::SingleValuedCostFunctions to vnl_optimizers expecti...
MeasureType m_CachedValue
bool m_NegateCostFunction
double InternalMeasureType
SingleValuedCostFunction::Pointer m_CostFunction
SingleValuedCostFunction::MeasureType MeasureType
void NegateCostFunctionOn()
SingleValuedCostFunction::ParametersType ParametersType
DerivativeType m_CachedDerivative
void SetCostFunction(SingleValuedCostFunction *costFunction)
ParametersType m_CachedCurrentParameters
Array< double > ScalesType
Abstraction of the Events used to communicating among filters and with GUIs.
Superclass::ParametersType ParametersType
ScalesType m_InverseScales
vnl_vector< double > InternalParametersType
const SingleValuedCostFunction * GetCostFunction(void) const
Superclass for callback/observer methods.