Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
o2scl::mmin_wrapper_gsl< func_t, vec_t, dfunc_t, auto_grad_t > Class Template Reference

Wrapper class for the mmin_bfgs2 minimizer. More...

#include <mmin_bfgs2.h>

Inheritance diagram for o2scl::mmin_wrapper_gsl< func_t, vec_t, dfunc_t, auto_grad_t >:
o2scl::mmin_wrap_gsl

Public Member Functions

void prepare_wrapper (func_t &ufunc, dfunc_t *udfunc, vec_t &t_x, double f, vec_t &t_g, vec_t &t_p, auto_grad_t *ag)
 Initialize wrapper.
 
void update_position (double alpha, vec_t &t_x, double *t_f, vec_t &t_g)
 Update position.
 
void change_direction ()
 Convert cache values to the new minimizer direction. More...
 

Public Attributes

vec_t av_x_alpha
 Temporary storage.
 
vec_t av_g_alpha
 Temporary storage.
 
size_t dim
 Number of minimization dimensions.
 

Protected Member Functions

void moveto (double alpha)
 Move to a new point, using the cached value if possible.
 
double slope ()
 Compute the slope.
 
virtual double wrap_f (double alpha)
 Evaluate the function.
 
virtual double wrap_df (double alpha)
 Evaluate the derivative.
 
virtual void wrap_fdf (double alpha, double *f, double *df)
 Evaluate the function and the derivative.
 

Protected Attributes

func_t * func
 Function.
 
dfunc_t * dfunc
 Derivative.
 
auto_grad_t * agrad
 The automatic gradient object.
 
bool grad_given
 True if the gradient was given by the user.
 
fixed values
vec_t * x
 
vec_t * g
 
vec_t * p
 
cached values, for x(alpha)=x + alpha * p
double f_alpha
 
double df_alpha
 
cache keys
double f_cache_key
 
double df_cache_key
 
double x_cache_key
 
double g_cache_key
 

Detailed Description

template<class func_t = multi_funct11, class vec_t = boost::numeric::ublas::vector<double>, class dfunc_t = grad_funct11, class auto_grad_t = gradient<multi_funct11,boost::numeric::ublas::vector<double> >>
class o2scl::mmin_wrapper_gsl< func_t, vec_t, dfunc_t, auto_grad_t >

This is a reimplmentation of the internal GSL wrapper for function calls in the BFGS minimizer

Definition at line 67 of file mmin_bfgs2.h.

Member Function Documentation

◆ change_direction()

template<class func_t = multi_funct11, class vec_t = boost::numeric::ublas::vector<double>, class dfunc_t = grad_funct11, class auto_grad_t = gradient<multi_funct11,boost::numeric::ublas::vector<double> >>
void o2scl::mmin_wrapper_gsl< func_t, vec_t, dfunc_t, auto_grad_t >::change_direction ( )
inline

Convert the cache values from the end of the current minimisation to those needed for the start of the next minimisation, alpha=0

Definition at line 263 of file mmin_bfgs2.h.


The documentation for this class was generated from the following file:

Documentation generated with Doxygen. Provided under the GNU Free Documentation License (see License Information).