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
47 : Hff_inv(Hff_inv), x(x), free_idx(free_idx), clamped_idx(clamped_idx) {}
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;
125 const std::size_t& get_maxiter()
const;
130 const double& get_th_acceptstep()
const;
135 const double& get_th_grad()
const;
140 const double& get_reg()
const;
145 const std::vector<double>& get_alphas()
const;
150 void set_nx(
const std::size_t& nx);
155 void set_maxiter(
const std::size_t& maxiter);
160 void set_th_acceptstep(
const double& th_acceptstep);
165 void set_th_grad(
const double& th_grad);
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_
This class implements a Box QP solver based on a Projected Newton method.
Eigen::MatrixXd Hff_inv
Inverse of the free space Hessian.
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.
Eigen::VectorXd x
Decision vector.
EIGEN_MAKE_ALIGNED_OPERATOR_NEW BoxQPSolution()
Initialize the QP solution structure.
std::vector< size_t > clamped_idx
Clamped space indexes.
std::vector< size_t > free_idx
Free space indexes.