crocoddyl
1.4.0
Contact RObot COntrol by Differential DYnamic programming Library (Crocoddyl)
|
|
9 #ifndef CROCODDYL_CORE_SOLVERS_BOX_QP_HPP_
10 #define CROCODDYL_CORE_SOLVERS_BOX_QP_HPP_
13 #include <Eigen/Dense>
14 #include <Eigen/Cholesky>
16 #include "crocoddyl/core/utils/exception.hpp"
30 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
81 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
92 BoxQP(
const std::size_t nx, std::size_t maxiter = 100,
const double th_acceptstep = 0.1,
const double th_grad = 1e-9,
93 const double reg = 1e-9);
109 const BoxQPSolution&
solve(
const Eigen::MatrixXd& H,
const Eigen::VectorXd& q,
const Eigen::VectorXd& lb,
110 const Eigen::VectorXd& ub,
const Eigen::VectorXd& xinit);
120 const std::size_t&
get_nx()
const;
145 const std::vector<double>&
get_alphas()
const;
150 void set_nx(
const std::size_t& nx);
170 void set_reg(
const double& reg);
175 void set_alphas(
const std::vector<double>& alphas);
180 std::size_t maxiter_;
181 double th_acceptstep_;
189 std::vector<double> alphas_;
191 Eigen::VectorXd xnew_;
198 Eigen::VectorXd dxf_;
199 Eigen::MatrixXd Hff_;
200 Eigen::MatrixXd Hfc_;
201 Eigen::LLT<Eigen::MatrixXd> Hff_inv_llt_;
206 #endif // CROCODDYL_CORE_SOLVERS_BOX_QP_HPP_
const BoxQPSolution & solve(const Eigen::MatrixXd &H, const Eigen::VectorXd &q, const Eigen::VectorXd &lb, const Eigen::VectorXd &ub, const Eigen::VectorXd &xinit)
Compute the solution of bound-constrained QP based on Newton projection.
const double & get_reg() const
Return the regularization value.
void set_alphas(const std::vector< double > &alphas)
Modify the stack of step lengths using by the line-search procedure.
std::vector< size_t > free_idx
Free space indexes.
Eigen::MatrixXd Hff_inv
Inverse of the free space Hessian.
This class implements a Box QP solver based on a Projected Newton method.
const double & get_th_acceptstep() const
Return the acceptance step threshold.
void set_maxiter(const std::size_t &maxiter)
Modify the maximum allowed number of iterations.
const BoxQPSolution & get_solution() const
Return the stored solution.
~BoxQP()
Destroy the Projected-Newton QP solver.
EIGEN_MAKE_ALIGNED_OPERATOR_NEW BoxQP(const std::size_t nx, std::size_t maxiter=100, const double th_acceptstep=0.1, const double th_grad=1e-9, const double reg=1e-9)
Initialize the Projected-Newton QP for bound constraints.
BoxQPSolution(const Eigen::MatrixXd &Hff_inv, const Eigen::VectorXd &x, const std::vector< size_t > &free_idx, const std::vector< size_t > &clamped_idx)
Initialize the QP solution structure.
void set_th_acceptstep(const double &th_acceptstep)
Modify the acceptance step threshold.
const double & get_th_grad() const
Return the gradient tolerance threshold.
void set_nx(const std::size_t &nx)
Modify the decision vector dimension.
const std::size_t & get_maxiter() const
Return the maximum allowed number of iterations.
void set_reg(const double ®)
Modify the regularization value.
const std::vector< double > & get_alphas() const
Return the stack of step lengths using by the line-search procedure.
std::vector< size_t > clamped_idx
Clamped space indexes.
Eigen::VectorXd x
Decision vector.
const std::size_t & get_nx() const
Return the decision vector dimension.
EIGEN_MAKE_ALIGNED_OPERATOR_NEW BoxQPSolution()
Initialize the QP solution structure.
void set_th_grad(const double &th_grad)
Modify the gradient tolerance threshold.