00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkSingleValuedCostFunction_h
00018 #define __itkSingleValuedCostFunction_h
00019
00020 #include "itkCostFunction.h"
00021 #include "itkArray.h"
00022 #include "itkObjectFactory.h"
00023 #include "itkNumericTraits.h"
00024
00025
00026 namespace itk
00027 {
00028
00035 class ITK_EXPORT SingleValuedCostFunction :
00036 public CostFunction
00037 {
00038 public:
00040 typedef SingleValuedCostFunction Self;
00041 typedef CostFunction Superclass;
00042 typedef SmartPointer<Self> Pointer;
00043 typedef SmartPointer<const Self> ConstPointer;
00044
00046 itkTypeMacro( SingleValuedCostFunction, CostFunction );
00047
00050 typedef double MeasureType;
00051
00054 typedef Array<double> DerivativeType;
00055
00058 typedef Superclass::ParametersType ParametersType;
00059
00062 virtual MeasureType GetValue( const ParametersType & parameters ) const = 0;
00063
00066 virtual void GetDerivative( const ParametersType & parameters,
00067 DerivativeType & derivative ) const = 0;
00068
00071 virtual void GetValueAndDerivative( const ParametersType & parameters,
00072 MeasureType & value,
00073 DerivativeType & derivative ) const
00074 {
00075 value = this->GetValue( parameters );
00076 this->GetDerivative( parameters, derivative );
00077 };
00079
00080 protected:
00081 SingleValuedCostFunction() {};
00082 virtual ~SingleValuedCostFunction() {};
00083
00084 private:
00085 SingleValuedCostFunction(const Self&);
00086 void operator=(const Self&);
00087
00088 };
00089
00090
00091
00092
00093
00094
00095 }
00096
00097
00098 #endif
00099
00100
00101
00102