LeastSquareFunction Class Reference

Cost function for least-square problems. More...

`#include <ql/math/optimization/leastsquare.hpp>`

Inheritance diagram for LeastSquareFunction:
[legend]

## Public Member Functions

| LeastSquareFunction (LeastSquareProblem &lsp)
| Default constructor.
virtual | ~LeastSquareFunction ()
| Destructor.
virtual Real | value (const Array &x) const
| compute value of the least square function
virtual Disposable< Array > | values (const Array &) const
| method to overload to compute the cost function values in x
virtual void | gradient (Array &grad_f, const Array &x) const
| compute vector of derivatives of the least square function
virtual Real | valueAndGradient (Array &grad_f, const Array &x) const
| compute value and gradient of the least square function
Public Member Functions inherited from CostFunction
virtual void | jacobian (Matrix &jac, const Array &x) const
| method to overload to compute J_f, the jacobian of
virtual Disposable< Array > | valuesAndJacobian (Matrix &jac, const Array &x) const
| method to overload to compute J_f, the jacobian of
virtual Real | finiteDifferenceEpsilon () const
| Default epsilon for finite difference method :

## Protected Attributes

LeastSquareProblem & | lsp_
| least square problem

## Detailed Description

Cost function for least-square problems.

Implements a cost function using the interface provided by the LeastSquareProblem class.