COOLFluiD  Release kernel
COOLFluiD is a Collaborative Simulation Environment (CSE) focused on complex MultiPhysics simulations.
Public Member Functions | Private Attributes | List of all members
Dbrent Class Reference

#include <FindMinimum.hpp>

Inherits BracketMethod.

Public Member Functions

 Dbrent (const Real toll=3.0e-8)
 Default constructor. More...
 
template<class T >
Real minimize (T &funcd)
 
- Public Member Functions inherited from BracketMethod
 BracketMethod ()
 Default constructor. More...
 
template<class T >
void bracket (const Real a, const Real b, T &func)
 
void setMaxStep (const Real &step)
 

Private Attributes

Real xmin
 
Real fmin
 
const Real tol
 

Additional Inherited Members

- Protected Member Functions inherited from BracketMethod
void shft2 (Real &a, Real &b, const Real c)
 
void shft3 (Real &a, Real &b, Real &c, const Real d)
 
void mov3 (Real &a, Real &b, Real &c, const Real d, const Real e, const Real f)
 
void swap (Real &a, Real &b)
 
- Protected Attributes inherited from BracketMethod
Real m_maxStep
 
Real ax
 
Real bx
 
Real cx
 
Real fa
 
Real fb
 
Real fc
 

Detailed Description

Dbrent: This class is finds the minimum of a given function, using the Brent method, and making use of the first derivative of the function. The given function-object requires a subroutine df(x)

Author
Willem Deconinck Based on Numerical Recipes v3.02

Use:

/// class Function
/// {
///   Real operator() (const Real& x) { return x*x;}
///   Real df(const Real& x) { return 2*x;}
/// };
/// Function func;
/// Dbrent dbrent;
/// dbrent.bracket(a,b,func);
/// Real xmin = dbrent.minimize(func);
/// 

Definition at line 330 of file FindMinimum.hpp.

Constructor & Destructor Documentation

Dbrent ( const Real  toll = 3.0e-8)
inline

Default constructor.

Definition at line 337 of file FindMinimum.hpp.

Member Function Documentation

Real minimize ( T &  funcd)
inline

Minimizes the given function

Parameters
funcdThe given function
Returns
The minimum of the function

Definition at line 343 of file FindMinimum.hpp.

Member Data Documentation

Real fmin
private

Definition at line 332 of file FindMinimum.hpp.

const Real tol
private

Definition at line 333 of file FindMinimum.hpp.

Real xmin
private

Definition at line 332 of file FindMinimum.hpp.


The documentation for this class was generated from the following file:
Send comments to:
COOLFluiD Web Admin