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

#include <LBFGSB.h>

Public Member Functions

 LBFGSBSolver (const LBFGSBParam< Scalar > &param)
 
template<typename Foo >
int minimize (Foo &f, Vector &x, Scalar &fx, const Vector &lb, const Vector &ub)
 
const Vector & final_grad () const
 
Scalar final_grad_norm () const
 

Detailed Description

template<typename Scalar, template< class > class LineSearch = LineSearchMoreThuente>
class LBFGSpp::LBFGSBSolver< Scalar, LineSearch >

L-BFGS-B solver for box-constrained numerical optimization

Definition at line 23 of file LBFGSB.h.

Constructor & Destructor Documentation

◆ LBFGSBSolver()

template<typename Scalar , template< class > class LineSearch = LineSearchMoreThuente>
LBFGSpp::LBFGSBSolver< Scalar, LineSearch >::LBFGSBSolver ( const LBFGSBParam< Scalar > &  param)
inline

Constructor for the L-BFGS-B solver.

Parameters
paramAn object of LBFGSParam to store parameters for the algorithm

Definition at line 95 of file LBFGSB.h.

Member Function Documentation

◆ minimize()

template<typename Scalar , template< class > class LineSearch = LineSearchMoreThuente>
template<typename Foo >
int LBFGSpp::LBFGSBSolver< Scalar, LineSearch >::minimize ( Foo &  f,
Vector &  x,
Scalar &  fx,
const Vector &  lb,
const Vector &  ub 
)
inline

Minimizing a multivariate function subject to box constraints, using the L-BFGS-B 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.
lbLower bounds for x.
ubUpper bounds for x.
Returns
Number of iterations used.

Definition at line 117 of file LBFGSB.h.

◆ final_grad()

template<typename Scalar , template< class > class LineSearch = LineSearchMoreThuente>
const Vector & LBFGSpp::LBFGSBSolver< 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 271 of file LBFGSB.h.

◆ final_grad_norm()

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

Returning the infinity norm of the final projected gradient. The projected gradient is defined as \(P(x-g,l,u)-x\), where \(P(v,l,u)\) stands for the projection of a vector \(v\) onto the box specified by the lower bound vector \(l\) and upper bound vector \(u\).

Definition at line 279 of file LBFGSB.h.


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