18 #ifndef itkMultipleValuedVnlCostFunctionAdaptor_h
19 #define itkMultipleValuedVnlCostFunctionAdaptor_h
22 #include "vnl/vnl_least_squares_function.h"
23 #include "ITKOptimizersExport.h"
38 public vnl_least_squares_function
65 unsigned int numberOfValues);
69 { m_CostFunction = costFunction; }
73 {
return m_CostFunction; }
76 virtual void f(
const InternalParametersType & inparameters,
77 InternalMeasureType & measures) ITK_OVERRIDE;
80 virtual void gradf(
const InternalParametersType & inparameters,
81 InternalDerivativeType & gradient) ITK_OVERRIDE;
84 virtual void compute(
const InternalParametersType & x,
85 InternalMeasureType *f,
86 InternalDerivativeType *g);
89 void ConvertExternalToInternalGradient(
90 const DerivativeType & input,
91 InternalDerivativeType & output);
94 void ConvertExternalToInternalMeasures(
95 const MeasureType & input,
96 InternalMeasureType & output);
101 void SetUseGradient(
bool);
105 bool GetUseGradient()
const;
108 void SetScales(
const ScalesType & scales);
120 const MeasureType & GetCachedValue()
const;
122 const DerivativeType & GetCachedDerivative()
const;
124 const ParametersType & GetCachedCurrentParameters()
const;
130 void ReportIteration(
const EventObject & event)
const;
vnl_vector< double > InternalParametersType
ParametersType m_CachedCurrentParameters
This class is a base for the CostFunctions returning a multiple values.
void SetCostFunction(MultipleValuedCostFunction *costFunction)
MultipleValuedCostFunction::MeasureType MeasureType
DerivativeType m_CachedDerivative
MultipleValuedCostFunction::Pointer m_CostFunction
Object::Pointer m_Reporter
vnl_vector< double > InternalMeasureType
Array2D class representing a 2D array with size defined at construction time.
MultipleValuedCostFunction::ParametersType ParametersType
Abstraction of the Events used to communicating among filters and with GUIs.
ScalesType m_InverseScales
const MultipleValuedCostFunction * GetCostFunction(void) const
MeasureType m_CachedValue
This class is an Adaptor that allows to pass itk::MultipleValuedCostFunctions to vnl_optimizers expec...
Array< double > ScalesType
vnl_matrix< double > InternalDerivativeType
MultipleValuedCostFunction::DerivativeType DerivativeType
Superclass for callback/observer methods.