LBFGS++
Loading...
Searching...
No Matches
LBFGSpp::LBFGSSolver< Scalar, LineSearch > Class Template Reference

#include <LBFGS.h>

Public Member Functions

 LBFGSSolver (const LBFGSParam< Scalar > &param)
 
template<typename Foo >
int minimize (Foo &f, Vector &x, Scalar &fx)
 
const Vector & final_grad () const
 
Scalar final_grad_norm () const
 

Detailed Description

template<typename Scalar, template< class > class LineSearch = LineSearchNocedalWright>
class LBFGSpp::LBFGSSolver< Scalar, LineSearch >

L-BFGS solver for unconstrained numerical optimization

Definition at line 22 of file LBFGS.h.

Constructor & Destructor Documentation

◆ LBFGSSolver()

template<typename Scalar , template< class > class LineSearch = LineSearchNocedalWright>
LBFGSpp::LBFGSSolver< Scalar, LineSearch >::LBFGSSolver ( const LBFGSParam< Scalar > &  param)
inline

Constructor for the L-BFGS solver.

Parameters
paramAn object of LBFGSParam to store parameters for the algorithm

Definition at line 59 of file LBFGS.h.

Member Function Documentation

◆ minimize()

template<typename Scalar , template< class > class LineSearch = LineSearchNocedalWright>
template<typename Foo >
int LBFGSpp::LBFGSSolver< Scalar, LineSearch >::minimize ( Foo &  f,
Vector &  x,
Scalar &  fx 
)
inline

Minimizing a multivariate function using the L-BFGS algorithm. Exceptions will be thrown if error occurs.

Parameters
fA function object such that f(x, grad) returns the objective function value at x, and overwrites grad with the gradient.
xIn: An initial guess of the optimal point. Out: The best point found.
fxOut: The objective function value at x.
Returns
Number of iterations used.

Definition at line 79 of file LBFGS.h.

◆ final_grad()

template<typename Scalar , template< class > class LineSearch = LineSearchNocedalWright>
const Vector & LBFGSpp::LBFGSSolver< Scalar, LineSearch >::final_grad ( ) const
inline

Returning the gradient vector on the last iterate. Typically used to debug and test convergence. Should only be called after the minimize() function.

Returns
A const reference to the gradient vector.

Definition at line 182 of file LBFGS.h.

◆ final_grad_norm()

template<typename Scalar , template< class > class LineSearch = LineSearchNocedalWright>
Scalar LBFGSpp::LBFGSSolver< Scalar, LineSearch >::final_grad_norm ( ) const
inline

Returning the Euclidean norm of the final gradient.

Definition at line 187 of file LBFGS.h.


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