nmpc_ddp
Classes | Public Types | Public Member Functions | Public Attributes | Protected Attributes | List of all members
nmpc_ddp::BoxQP< VarDim > Class Template Reference

Solver for quadratic programming problems with box constraints (i.e., only upper and lower bounds). More...

#include <BoxQP.h>

Collaboration diagram for nmpc_ddp::BoxQP< VarDim >:
Collaboration graph
[legend]

Classes

struct  Configuration
 Configuration. More...
 
struct  TraceData
 Data to trace optimization loop. More...
 

Public Types

using VarDimVector = Eigen::Matrix< double, VarDim, 1 >
 Type of vector of variables dimension. More...
 
using VarVarDimMatrix = Eigen::Matrix< double, VarDim, VarDim >
 Type of matrix of variables x variables dimension. More...
 
using VarDimArray = Eigen::Array< bool, VarDim, 1 >
 Type of boolean array of variables dimension. More...
 

Public Member Functions

EIGEN_MAKE_ALIGNED_OPERATOR_NEW BoxQP (int var_dim=VarDim)
 Constructor. More...
 
VarDimVector solve (const VarVarDimMatrix &H, const VarDimVector &g, const VarDimVector &lower, const VarDimVector &upper)
 Solve optimization. More...
 
VarDimVector solve (const VarVarDimMatrix &H, const VarDimVector &g, const VarDimVector &lower, const VarDimVector &upper, const VarDimVector &initial_x)
 Solve optimization. More...
 
Configurationconfig ()
 Accessor to configuration. More...
 
const Configurationconfig () const
 Const accessor to configuration. More...
 
const std::vector< TraceData > & traceDataList () const
 Const accessor to trace data list. More...
 

Public Attributes

const int var_dim_ = 0
 Dimension of decision variables. More...
 
int retval_ = 0
 Return value. More...
 
const std::unordered_map< int, std::string > retstr_
 Return string. More...
 
std::unique_ptr< Eigen::LLT< Eigen::MatrixXd > > llt_free_
 Cholesky decomposition (LLT) of free block of objective Hessian matrix. More...
 
std::vector< int > free_idxs_
 Indices of free dimensions in decision variables. More...
 

Protected Attributes

Configuration config_
 Configuration. More...
 
std::vector< TraceDatatrace_data_list_
 Sequence of trace data. More...
 

Detailed Description

template<int VarDim>
class nmpc_ddp::BoxQP< VarDim >

Solver for quadratic programming problems with box constraints (i.e., only upper and lower bounds).

Template Parameters
VarDimdimension of decision variables

See the following for a detailed algorithm.

Definition at line 19 of file BoxQP.h.

Member Typedef Documentation

◆ VarDimArray

template<int VarDim>
using nmpc_ddp::BoxQP< VarDim >::VarDimArray = Eigen::Array<bool, VarDim, 1>

Type of boolean array of variables dimension.

Definition at line 29 of file BoxQP.h.

◆ VarDimVector

template<int VarDim>
using nmpc_ddp::BoxQP< VarDim >::VarDimVector = Eigen::Matrix<double, VarDim, 1>

Type of vector of variables dimension.

Definition at line 23 of file BoxQP.h.

◆ VarVarDimMatrix

template<int VarDim>
using nmpc_ddp::BoxQP< VarDim >::VarVarDimMatrix = Eigen::Matrix<double, VarDim, VarDim>

Type of matrix of variables x variables dimension.

Definition at line 26 of file BoxQP.h.

Constructor & Destructor Documentation

◆ BoxQP()

template<int VarDim>
EIGEN_MAKE_ALIGNED_OPERATOR_NEW nmpc_ddp::BoxQP< VarDim >::BoxQP ( int  var_dim = VarDim)
inline

Constructor.

Parameters
var_dimdimension of decision variables
Note
dimensions in parameter can be omitted if a fixed value is given in the template value.

Definition at line 101 of file BoxQP.h.

Member Function Documentation

◆ config() [1/2]

template<int VarDim>
Configuration& nmpc_ddp::BoxQP< VarDim >::config ( )
inline

Accessor to configuration.

Definition at line 350 of file BoxQP.h.

◆ config() [2/2]

template<int VarDim>
const Configuration& nmpc_ddp::BoxQP< VarDim >::config ( ) const
inline

Const accessor to configuration.

Definition at line 356 of file BoxQP.h.

◆ solve() [1/2]

template<int VarDim>
VarDimVector nmpc_ddp::BoxQP< VarDim >::solve ( const VarVarDimMatrix H,
const VarDimVector g,
const VarDimVector lower,
const VarDimVector upper 
)
inline

Solve optimization.

Parameters
HHessian matrix of objective function
ggradient vector of objective function
lowerlower limit of decision variables
upperupper limit of decision variables

Definition at line 126 of file BoxQP.h.

◆ solve() [2/2]

template<int VarDim>
VarDimVector nmpc_ddp::BoxQP< VarDim >::solve ( const VarVarDimMatrix H,
const VarDimVector g,
const VarDimVector lower,
const VarDimVector upper,
const VarDimVector initial_x 
)
inline

Solve optimization.

Parameters
HHessian matrix of objective function
ggradient vector of objective function
lowerlower limit of decision variables
upperupper limit of decision variables
initial_xinitial guess of decision variables

Definition at line 141 of file BoxQP.h.

◆ traceDataList()

template<int VarDim>
const std::vector<TraceData>& nmpc_ddp::BoxQP< VarDim >::traceDataList ( ) const
inline

Const accessor to trace data list.

Definition at line 362 of file BoxQP.h.

Member Data Documentation

◆ config_

template<int VarDim>
Configuration nmpc_ddp::BoxQP< VarDim >::config_
protected

Configuration.

Definition at line 393 of file BoxQP.h.

◆ free_idxs_

template<int VarDim>
std::vector<int> nmpc_ddp::BoxQP< VarDim >::free_idxs_

Indices of free dimensions in decision variables.

Definition at line 389 of file BoxQP.h.

◆ llt_free_

template<int VarDim>
std::unique_ptr<Eigen::LLT<Eigen::MatrixXd> > nmpc_ddp::BoxQP< VarDim >::llt_free_

Cholesky decomposition (LLT) of free block of objective Hessian matrix.

Definition at line 386 of file BoxQP.h.

◆ retstr_

template<int VarDim>
const std::unordered_map<int, std::string> nmpc_ddp::BoxQP< VarDim >::retstr_
Initial value:
= {{-2, "Gradient of search direction is positive"},
{-1, "Hessian is not positive definite"},
{0, "Computation is not finished"},
{1, "Maximum main iterations exceeded"},
{2, "Maximum line-search iterations exceeded"},
{3, "No bounds, returning Newton point"},
{4, "Improvement smaller than tolerance"},
{5, "Gradient norm smaller than tolerance"},
{6, "All dimensions are clamped"}}

Return string.

Definition at line 375 of file BoxQP.h.

◆ retval_

template<int VarDim>
int nmpc_ddp::BoxQP< VarDim >::retval_ = 0

Return value.

Definition at line 372 of file BoxQP.h.

◆ trace_data_list_

template<int VarDim>
std::vector<TraceData> nmpc_ddp::BoxQP< VarDim >::trace_data_list_
protected

Sequence of trace data.

Definition at line 396 of file BoxQP.h.

◆ var_dim_

template<int VarDim>
const int nmpc_ddp::BoxQP< VarDim >::var_dim_ = 0

Dimension of decision variables.

Definition at line 369 of file BoxQP.h.


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