### A free/open-source library for quantitative finance

Public Member Functions | Protected Attributes
LineSearch Class Reference

Base class for line search. More...

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

Inheritance diagram for LineSearch:
[legend]

List of all members.

## Public Member Functions

| LineSearch (Real=0.0)
| Default constructor.
virtual | ~LineSearch ()
| Destructor.
const Array & | lastX ()
| return last x value
Real | lastFunctionValue ()
| return last cost function value
const Array & | lastGradient ()
| return last gradient
Real | lastGradientNorm2 ()
| return square norm of last gradient
bool | succeed ()
virtual Real | operator() (Problem &P, EndCriteria::Type &ecType, const EndCriteria &, const Real t_ini)=0
| Perform line search.
Real | update (Array &params, const Array &direction, Real beta, const Constraint &constraint)
const Array & | searchDirection () const
| current value of the search direction
Array & | searchDirection ()

## Protected Attributes

Array | searchDirection_
| current values of the search direction
Array | xtd_
| new x and its gradient
Array | gradient_
Real | qt_
| cost function value and gradient norm corresponding to xtd_
Real | qpt_
bool | succeed_
| flag to know if linesearch succeed

## Detailed Description

Base class for line search.