Documentation


nr::linmin< TraitsT > Struct Template Reference

#include <linmin.h>

List of all members.


Detailed Description

template<class TraitsT = Old_Traits<>>
struct nr::linmin< TraitsT >

Minimization of an n-dimensional function along a given line, without information on gradient.

The constructor performs the minimization.

Examples:

optimization_N_test.cpp.

Definition at line 15 of file linmin.h.

Public Types

typedef TraitsT Traits
 Traits.

typedef Traits::Real Real
 Floating point value.

typedef Traits::Vector Vector
 Vector.


Public Member Functions

Constructor
template<class Func>  linmin (Vector &p, Vector &xi, unsigned int n, Real *fret, Func(*func), const Real TOL=2.0e-4)
 Given an n-dimensional point p[0..n-1] and an n-dimensional direction xi[0..n-1], moves and resets p to where the function takes on a minimum along the direction xi from p, and replaces xi by the actual vector displacement that p was moved.


Member Typedef Documentation

template<class TraitsT = Old_Traits<>>
typedef Traits::Real nr::linmin< TraitsT >::Real
 

Floating point value.

Definition at line 20 of file linmin.h.

template<class TraitsT = Old_Traits<>>
typedef TraitsT nr::linmin< TraitsT >::Traits
 

Traits.

Definition at line 18 of file linmin.h.

template<class TraitsT = Old_Traits<>>
typedef Traits::Vector nr::linmin< TraitsT >::Vector
 

Vector.

Definition at line 22 of file linmin.h.


Constructor & Destructor Documentation

template<class TraitsT = Old_Traits<>>
template<class Func>
nr::linmin< TraitsT >::linmin Vector p,
Vector xi,
unsigned int  n,
Real fret,
Func *  func,
const Real  TOL = 2.0e-4
[inline]
 

Given an n-dimensional point p[0..n-1] and an n-dimensional direction xi[0..n-1], moves and resets p to where the function takes on a minimum along the direction xi from p, and replaces xi by the actual vector displacement that p was moved.

Also returns as fret the value of the function at the returned location p. This is actually all accomplished by calling the routines mnbrak and brent. Template Func must be similar with Real( Vector )

Definition at line 32 of file linmin.h.

References nr::brent(), nr::linmin< TraitsT >::F1dim< Real, Vector, Func >::funct, nr::mnbrak(), nr::linmin< TraitsT >::F1dim< Real, Vector, Func >::ncom, nr::linmin< TraitsT >::F1dim< Real, Vector, Func >::pcom, nr::linmin< TraitsT >::F1dim< Real, Vector, Func >::xicom, and nr::linmin< TraitsT >::F1dim< Real, Vector, Func >::xt.


The documentation for this struct was generated from the following file:
Generated on Thu Dec 23 13:52:34 2004 by doxygen 1.3.6