gsl_mmin_wrapper Class Template Reference

#include <gsl_mmin_bfgs2.h>

Inheritance diagram for gsl_mmin_wrapper:

gsl_mmin_wrap_base

Detailed Description

template<class param_t, class func_t, class vec_t = ovector_view, class alloc_vec_t = ovector, class alloc_t = ovector_alloc, class dfunc_t = func_t>
class gsl_mmin_wrapper< param_t, func_t, vec_t, alloc_vec_t, alloc_t, dfunc_t >

Wrapper class for the gsl_mmin_bfgs2 minimizer.

Idea for future:
There's a bit of extra vector copying here which could potentially be avoided.

Definition at line 63 of file gsl_mmin_bfgs2.h.


Public Member Functions

void prepare_wrapper (func_t &ufunc, param_t &upa, gsl_vector *t_x, double f, gsl_vector *t_g, gsl_vector *t_p)
 Initialize wrapper.
void update_position (double alpha, gsl_vector *t_x, double *t_f, gsl_vector *t_g)
 Update position.
void change_direction ()
 Convert cache values to the new minimizer direction.

Data Fields

alloc_vec_t av_x_alpha
 Temporary storage.
alloc_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, void *params)
 Evaluate the function.
virtual double wrap_df (double alpha, void *params)
 Evaluate the derivative.
int simple_df (vec_t &x2, vec_t &g2)
 A simple derivative.
virtual void wrap_fdf (double alpha, void *params, double *f, double *df)
 Evaluate the function and the derivative.

Protected Attributes

func_t * func
 Function.
dfunc_t * dfunc
 Derivative.
param_t * pa
 Parameters.
fixed values
gsl_vector * x
gsl_vector * g
gsl_vector * 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

The documentation for this class was generated from the following file:
Documentation generated with Doxygen and provided under the GNU Free Documentation License. See License Information for details.