Object-oriented Scientific Computing Library: Version 0.910
Public Member Functions | Data Fields | Protected Member Functions | Protected Attributes
gsl_mmin_base< func_t, vec_t, alloc_vec_t, alloc_t, dfunc_t, auto_grad_t, def_auto_grad_t > Class Template Reference

Base minimization routines for gsl_mmin_conf and gsl_mmin_conp. More...

#include <gsl_mmin_conf.h>

Inheritance diagram for gsl_mmin_base< func_t, vec_t, alloc_vec_t, alloc_t, dfunc_t, auto_grad_t, def_auto_grad_t >:
multi_min< func_t, func_t, vec_t > gsl_mmin_conf< func_t, vec_t, alloc_vec_t, alloc_t, dfunc_t, auto_grad_t, def_auto_grad_t > gsl_mmin_conp< func_t, vec_t, alloc_vec_t, alloc_t, dfunc_t, auto_grad_t, def_auto_grad_t >

Detailed Description

template<class func_t = multi_funct<>, class vec_t = ovector_base, class alloc_vec_t = ovector, class alloc_t = ovector_alloc, class dfunc_t = grad_funct<ovector_base>, class auto_grad_t = gradient<func_t,ovector_base>, class def_auto_grad_t = simple_grad<func_t,ovector_base>>
class gsl_mmin_base< func_t, vec_t, alloc_vec_t, alloc_t, dfunc_t, auto_grad_t, def_auto_grad_t >

This class is used by the gsl_mmin_conf and gsl_mmin_conp minimizers to perform the line minimization along a specified direction. It is not intended for a casual end-user.

Default template arguments

Definition at line 61 of file gsl_mmin_conf.h.

Public Member Functions

int base_set (func_t &ufunc, auto_grad_t &u_def_grad)
 Set the function.
int base_set_de (func_t &ufunc, dfunc_t &udfunc)
 Set the function and the gradient .
int base_allocate (size_t nn)
 Allocate memory.
int base_free ()
 Clear allocated memory.

Data Fields

double deriv_h
 Stepsize for finite-differencing ( default $ 10^{-4} $ )
int nmaxiter
 Maximum iterations for line minimization (default 10)
def_auto_grad_t def_grad
 Default automatic gradient object.

Protected Member Functions

void take_step (const vec_t &x, const vec_t &px, double stepx, double lambda, vec_t &x1x, vec_t &dx)
 Take a step.
void intermediate_point (const vec_t &x, const vec_t &px, double lambda, double pg, double stepa, double stepc, double fa, double fc, vec_t &x1x, vec_t &dx, vec_t &gradient, double *stepx, double *f)
 Line minimization.
void minimize (const vec_t &x, const vec_t &xp, double lambda, double stepa, double stepb, double stepc, double fa, double fb, double fc, double xtol, vec_t &x1x, vec_t &dx1x, vec_t &x2x, vec_t &dx2x, vec_t &gradient, double *xstep, double *f, double *gnorm_u)
 Perform the minimization.

Protected Attributes

func_t * func
 User-specified function.
dfunc_t * grad
 User-specified gradient.
auto_grad_t * agrad
 Automatic gradient object.
bool grad_given
 If true, a gradient has been specified.
size_t dim
 Memory size.
alloc_t ao
 Memory allocation.

Member Function Documentation

template<class func_t = multi_funct<>, class vec_t = ovector_base, class alloc_vec_t = ovector, class alloc_t = ovector_alloc, class dfunc_t = grad_funct<ovector_base>, class auto_grad_t = gradient<func_t,ovector_base>, class def_auto_grad_t = simple_grad<func_t,ovector_base>>
void gsl_mmin_base< func_t, vec_t, alloc_vec_t, alloc_t, dfunc_t, auto_grad_t, def_auto_grad_t >::intermediate_point ( const vec_t &  x,
const vec_t &  px,
double  lambda,
double  pg,
double  stepa,
double  stepc,
double  fa,
double  fc,
vec_t &  x1x,
vec_t &  dx,
vec_t &  gradient,
double *  stepx,
double *  f 
) [inline, protected]

Do a line minimisation in the region (xa,fa) (xc,fc) to find an intermediate (xb,fb) satisifying fa > fb < fc. Choose an initial xb based on parabolic interpolation.

Definition at line 105 of file gsl_mmin_conf.h.

template<class func_t = multi_funct<>, class vec_t = ovector_base, class alloc_vec_t = ovector, class alloc_t = ovector_alloc, class dfunc_t = grad_funct<ovector_base>, class auto_grad_t = gradient<func_t,ovector_base>, class def_auto_grad_t = simple_grad<func_t,ovector_base>>
void gsl_mmin_base< func_t, vec_t, alloc_vec_t, alloc_t, dfunc_t, auto_grad_t, def_auto_grad_t >::minimize ( const vec_t &  x,
const vec_t &  xp,
double  lambda,
double  stepa,
double  stepb,
double  stepc,
double  fa,
double  fb,
double  fc,
double  xtol,
vec_t &  x1x,
vec_t &  dx1x,
vec_t &  x2x,
vec_t &  dx2x,
vec_t &  gradient,
double *  xstep,
double *  f,
double *  gnorm_u 
) [inline, protected]

Starting at (x0, f0) move along the direction p to find a minimum f(x0 - lambda * p), returning the new point x1 = x0-lambda*p, f1=f(x1) and g1 = grad(f) at x1.

Definition at line 178 of file gsl_mmin_conf.h.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

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

Get Object-oriented Scientific Computing
Lib at SourceForge.net. Fast, secure and Free Open Source software
downloads.