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 void f(
const InternalParametersType & inparameters,
77 InternalMeasureType & measures)
override;
80 void gradf(
const InternalParametersType & inparameters,
81 InternalDerivativeType & gradient)
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;
ParametersType m_CachedCurrentParameters
Array2D< double > DerivativeType
This class is a base for the CostFunctions returning a multiple values.
Superclass::ParametersType ParametersType
void SetCostFunction(MultipleValuedCostFunction *costFunction)
DerivativeType m_CachedDerivative
MultipleValuedCostFunction::Pointer m_CostFunction
Object::Pointer m_Reporter
Array< double > MeasureType
Array2D class representing a 2D array with size defined at construction time.
vnl_vector< double > InternalParametersType
Abstraction of the Events used to communicating among filters and with GUIs.
ScalesType m_InverseScales
vnl_matrix< double > InternalDerivativeType
MeasureType m_CachedValue
This class is an Adaptor that allows to pass itk::MultipleValuedCostFunctions to vnl_optimizers expec...
Superclass for callback/observer methods.
vnl_vector< double > InternalMeasureType
const MultipleValuedCostFunction * GetCostFunction() const