Scythe-1.0.3
template<typename T , matrix_order PO1, matrix_style PS1, matrix_order PO2, matrix_style PS2, typename FUNCTOR >
T scythe::zoom ( FUNCTOR  fun,
alpha_lo,
alpha_hi,
const Matrix< T, PO1, PS1 > &  theta,
const Matrix< T, PO2, PS2 > &  p 
)

Find minimum of a function once bracketed.

This function finds the minimum of a function, once bracketed.

Parameters:
funThe function to minimize. This function should take one Matrix (vector) argument of type T and return a single value of type T.
alpha_loThe lower bracket.
alpha_hiThe upper bracket.
thetaA column vector of parameter values that anchor the 1-dimensional function.
pA direction vector that creates the 1-dimensional
See also:
linesearch1(FUNCTOR fun, const Matrix<T,PO1,PS1>& theta, const Matrix<T,PO2,PS2>& p)
linesearch2(FUNCTOR fun, const Matrix<T,PO1,PS1>& theta, const Matrix<T,PO2,PS2>& p, rng<RNGTYPE>& runif)
BFGS(FUNCTOR fun, const Matrix<T,PO,PS>& theta, rng<RNGTYPE>& runif, unsigned int maxit, T tolerance, bool trace = false)
Exceptions:
scythe_dimension_error(Level 1)
Note:
Users will typically wish to implement fun in terms of a functor. Using a functor provides a generic way in which to evaluate functions with more than one parameter. Furthermore, although one can pass a function pointer to this routine, the compiler cannot inline and fully optimize code referenced by function pointers.

References fabs(), gradfdifls(), scythe::Matrix_base< ORDER, STYLE >::isColVector(), and SCYTHE_CHECK_10.

Referenced by linesearch2().