Chemical Data Processing Library C++ API - Version 1.1.1
Public Types | Public Member Functions | List of all members
CDPL::Math::BFGSMinimizer< VA, VT, FVT > Class Template Reference

Fletcher's implementation of the BFGS method. More...

#include <BFGSMinimizer.hpp>

+ Inheritance diagram for CDPL::Math::BFGSMinimizer< VA, VT, FVT >:

Public Types

enum  Status {
  SUCCESS = 0,
  NO_PROGRESS = 1,
  ITER_LIMIT_REACHED = 2,
  GNORM_REACHED = 4,
  DELTAF_REACHED = 8
}
 
typedef VA VariableArrayType
 
typedef VT ValueType
 
typedef FVT FunctionValueType
 
typedef std::function< FVT(const VA &, VA &)> GradientFunction
 
typedef std::function< FVT(const VA &)> ObjectiveFunction
 

Public Member Functions

 BFGSMinimizer (const ObjectiveFunction &func, const GradientFunction &grad_func)
 
ValueType getGradientNorm () const
 
ValueType getFunctionDelta () const
 
ValueType getFunctionValue () const
 
std::size_t getNumIterations () const
 
Status getStatus () const
 
Status minimize (VariableArrayType &x, VariableArrayType &g, std::size_t max_iter, const ValueType &g_norm, const ValueType &delta_f, bool do_setup=true)
 
ValueType setup (const VariableArrayType &x, VariableArrayType &g, const ValueType &step_size=0.001, const ValueType &tol=0.15)
 
Status iterate (ValueType &f, VariableArrayType &x, VariableArrayType &g)
 

Detailed Description

template<typename VA, typename VT = typename MinimizerVariableArrayTraits<VA>::ValueType, typename FVT = VT>
class CDPL::Math::BFGSMinimizer< VA, VT, FVT >

Fletcher's implementation of the BFGS method.

The implementation has been taken from the GNU Scientific Library.

See also
R. Fletcher, "Practical Method's of Optimization", Second Edition, ISBN 0471915475. Algorithms 2.6.2 and 2.6.4.

Member Typedef Documentation

◆ VariableArrayType

template<typename VA , typename VT = typename MinimizerVariableArrayTraits<VA>::ValueType, typename FVT = VT>
typedef VA CDPL::Math::BFGSMinimizer< VA, VT, FVT >::VariableArrayType

◆ ValueType

template<typename VA , typename VT = typename MinimizerVariableArrayTraits<VA>::ValueType, typename FVT = VT>
typedef VT CDPL::Math::BFGSMinimizer< VA, VT, FVT >::ValueType

◆ FunctionValueType

template<typename VA , typename VT = typename MinimizerVariableArrayTraits<VA>::ValueType, typename FVT = VT>
typedef FVT CDPL::Math::BFGSMinimizer< VA, VT, FVT >::FunctionValueType

◆ GradientFunction

template<typename VA , typename VT = typename MinimizerVariableArrayTraits<VA>::ValueType, typename FVT = VT>
typedef std::function<FVT(const VA&, VA&)> CDPL::Math::BFGSMinimizer< VA, VT, FVT >::GradientFunction

◆ ObjectiveFunction

template<typename VA , typename VT = typename MinimizerVariableArrayTraits<VA>::ValueType, typename FVT = VT>
typedef std::function<FVT(const VA&)> CDPL::Math::BFGSMinimizer< VA, VT, FVT >::ObjectiveFunction

Member Enumeration Documentation

◆ Status

template<typename VA , typename VT = typename MinimizerVariableArrayTraits<VA>::ValueType, typename FVT = VT>
enum CDPL::Math::BFGSMinimizer::Status
Enumerator
SUCCESS 
NO_PROGRESS 
ITER_LIMIT_REACHED 
GNORM_REACHED 
DELTAF_REACHED 

Constructor & Destructor Documentation

◆ BFGSMinimizer()

template<typename VA , typename VT = typename MinimizerVariableArrayTraits<VA>::ValueType, typename FVT = VT>
CDPL::Math::BFGSMinimizer< VA, VT, FVT >::BFGSMinimizer ( const ObjectiveFunction func,
const GradientFunction grad_func 
)
inline

Member Function Documentation

◆ getGradientNorm()

template<typename VA , typename VT = typename MinimizerVariableArrayTraits<VA>::ValueType, typename FVT = VT>
ValueType CDPL::Math::BFGSMinimizer< VA, VT, FVT >::getGradientNorm ( ) const
inline

◆ getFunctionDelta()

template<typename VA , typename VT = typename MinimizerVariableArrayTraits<VA>::ValueType, typename FVT = VT>
ValueType CDPL::Math::BFGSMinimizer< VA, VT, FVT >::getFunctionDelta ( ) const
inline

◆ getFunctionValue()

template<typename VA , typename VT = typename MinimizerVariableArrayTraits<VA>::ValueType, typename FVT = VT>
ValueType CDPL::Math::BFGSMinimizer< VA, VT, FVT >::getFunctionValue ( ) const
inline

◆ getNumIterations()

template<typename VA , typename VT = typename MinimizerVariableArrayTraits<VA>::ValueType, typename FVT = VT>
std::size_t CDPL::Math::BFGSMinimizer< VA, VT, FVT >::getNumIterations ( ) const
inline

◆ getStatus()

template<typename VA , typename VT = typename MinimizerVariableArrayTraits<VA>::ValueType, typename FVT = VT>
Status CDPL::Math::BFGSMinimizer< VA, VT, FVT >::getStatus ( ) const
inline

◆ minimize()

template<typename VA , typename VT = typename MinimizerVariableArrayTraits<VA>::ValueType, typename FVT = VT>
Status CDPL::Math::BFGSMinimizer< VA, VT, FVT >::minimize ( VariableArrayType x,
VariableArrayType g,
std::size_t  max_iter,
const ValueType g_norm,
const ValueType delta_f,
bool  do_setup = true 
)
inline

◆ setup()

template<typename VA , typename VT = typename MinimizerVariableArrayTraits<VA>::ValueType, typename FVT = VT>
ValueType CDPL::Math::BFGSMinimizer< VA, VT, FVT >::setup ( const VariableArrayType x,
VariableArrayType g,
const ValueType step_size = 0.001,
const ValueType tol = 0.15 
)
inline

◆ iterate()

template<typename VA , typename VT = typename MinimizerVariableArrayTraits<VA>::ValueType, typename FVT = VT>
Status CDPL::Math::BFGSMinimizer< VA, VT, FVT >::iterate ( ValueType f,
VariableArrayType x,
VariableArrayType g 
)
inline

The documentation for this class was generated from the following file: