vnl_least_squares_cost_function.h
Go to the documentation of this file.
1 // This is core/vnl/vnl_least_squares_cost_function.h
2 #ifndef vnl_least_squares_cost_function_h_
3 #define vnl_least_squares_cost_function_h_
4 //:
5 // \file
6 // \brief vnl_least_squares_function -> vnl_cost_function adaptor
7 // \author Andrew W. Fitzgibbon, Oxford RRG
8 // \date 20 Aug 99
9 //
10 // \verbatim
11 // Modifications
12 // 990820 AWF Initial version.
13 // LSB (Manchester) 23/3/01 Tidied documentation
14 // \endverbatim
15 //
16 //-----------------------------------------------------------------------------
17 
18 #include <vnl/vnl_cost_function.h>
20 #include "vnl/vnl_export.h"
21 
22 //: An adaptor that converts a vnl_least_squares_function to a vnl_cost_function
23 class VNL_EXPORT vnl_least_squares_cost_function : public vnl_cost_function
24 {
25  public:
27 
28  double f(const vnl_vector<double>& x) override;
29 
30  void gradf(const vnl_vector<double>& x, vnl_vector<double>& gradient) override;
31 
32  protected:
34  vnl_matrix<double> jacobian_;
36 };
37 
38 #endif // vnl_least_squares_cost_function_h_
An object that represents a function from R^n -> R.
virtual void gradf(vnl_vector< double > const &x, vnl_vector< double > &gradient)
Calculate the gradient of f at parameter vector x.
Abstract base for minimising functions.
Vector->Real function.
double f(vnl_vector< double > const &x) override
The main function. Given the parameter vector x, compute the value of f(x).
Abstract base for minimising functions.
An adaptor that converts a vnl_least_squares_function to a vnl_cost_function.