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

#include <FindMinimum.hpp>

Inherited by Brent, Dbrent, and Golden.

Public Member Functions

 BracketMethod ()
 Default constructor. More...
 
template<class T >
void bracket (const Real a, const Real b, T &func)
 
void setMaxStep (const Real &step)
 

Protected Member Functions

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

Real m_maxStep
 
Real ax
 
Real bx
 
Real cx
 
Real fa
 
Real fb
 
Real fc
 

Detailed Description

BracketMethod: This class is the basis class to find the minimum of a given function. This basis class allows to bracket the minimum and assert that the minimum exists.

Author
Willem Deconinck Based on Numerical Recipes v3.02

Use:

/// class Function
/// {
///   operator() (const Real& x) { return x*x;}
/// };
/// Function func;
/// BracketMethod bracket;
/// bracket.bracket(a,b,func);
/// 

Definition at line 41 of file FindMinimum.hpp.

Constructor & Destructor Documentation

BracketMethod ( )
inline

Default constructor.

Definition at line 45 of file FindMinimum.hpp.

Member Function Documentation

void bracket ( const Real  a,
const Real  b,
T &  func 
)
inline

Bracket the minimum in a given function, starting with 2 values pointing downwards to the minimum

Parameters
aA first value
bA second value
funcThe function to bracket

Definition at line 54 of file FindMinimum.hpp.

void mov3 ( Real &  a,
Real &  b,
Real &  c,
const Real  d,
const Real  e,
const Real  f 
)
inlineprotected

Definition at line 130 of file FindMinimum.hpp.

void setMaxStep ( const Real &  step)
inline

Sets the maximum step taken to bracket the minimum. This is purely optional

Parameters
stepthe maximum step

Definition at line 110 of file FindMinimum.hpp.

void shft2 ( Real &  a,
Real &  b,
const Real  c 
)
inlineprotected

Definition at line 119 of file FindMinimum.hpp.

void shft3 ( Real &  a,
Real &  b,
Real &  c,
const Real  d 
)
inlineprotected

Definition at line 124 of file FindMinimum.hpp.

void swap ( Real &  a,
Real &  b 
)
inlineprotected

Definition at line 135 of file FindMinimum.hpp.

Member Data Documentation

Real ax
protected

Definition at line 117 of file FindMinimum.hpp.

Real bx
protected

Definition at line 117 of file FindMinimum.hpp.

Real cx
protected

Definition at line 117 of file FindMinimum.hpp.

Real fa
protected

Definition at line 117 of file FindMinimum.hpp.

Real fb
protected

Definition at line 117 of file FindMinimum.hpp.

Real fc
protected

Definition at line 117 of file FindMinimum.hpp.

Real m_maxStep
protected

Definition at line 116 of file FindMinimum.hpp.


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