9 #ifndef CROCODDYL_CORE_SOLVERS_BOX_QP_HPP_ 10 #define CROCODDYL_CORE_SOLVERS_BOX_QP_HPP_ 13 #include <Eigen/Dense> 14 #include <Eigen/Cholesky> 15 #include "crocoddyl/core/utils/exception.hpp" 29 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
46 : Hff_inv(Hff_inv), x(x), free_idx(free_idx), clamped_idx(clamped_idx) {}
80 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
91 BoxQP(
const std::size_t nx,
const std::size_t maxiter = 100,
const double th_acceptstep = 0.1,
92 const double th_grad = 1e-9,
const double reg = 1e-9);
108 const BoxQPSolution& solve(
const Eigen::MatrixXd& H,
const Eigen::VectorXd& q,
const Eigen::VectorXd& lb,
109 const Eigen::VectorXd& ub,
const Eigen::VectorXd& xinit);
119 std::size_t get_nx()
const;
124 std::size_t get_maxiter()
const;
129 double get_th_acceptstep()
const;
134 double get_th_grad()
const;
139 double get_reg()
const;
144 const std::vector<double>& get_alphas()
const;
149 void set_nx(
const std::size_t nx);
154 void set_maxiter(
const std::size_t maxiter);
159 void set_th_acceptstep(
const double th_acceptstep);
164 void set_th_grad(
const double th_grad);
169 void set_reg(
const double reg);
174 void set_alphas(
const std::vector<double>& alphas);
179 std::size_t maxiter_;
180 double th_acceptstep_;
188 std::vector<double> alphas_;
190 Eigen::VectorXd xnew_;
197 Eigen::VectorXd dxf_;
198 Eigen::MatrixXd Hff_;
199 Eigen::MatrixXd Hfc_;
200 Eigen::LLT<Eigen::MatrixXd> Hff_inv_llt_;
205 #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.