qpmad
Eigen-based C++ QP solver.
|
#include <solver.h>
Classes | |
struct | InputPlaceholders |
Public Types | |
enum | ReturnStatus |
using | Vector = Eigen::Matrix< t_Scalar, t_rows, 1 > |
using | Matrix = Eigen::Matrix< t_Scalar, t_rows, t_cols > |
using | Scalar = t_Scalar |
Public Member Functions | |
SolverTemplate () | |
template<class... t_Args> | |
ReturnStatus | solve (t_Args &&...args) |
Solve QP. More... | |
SolverParameters::HessianType | getHessianType () const |
Returns type of the Hessian produced by the latest execution of solve() . More... | |
std::ptrdiff_t | getNumberOfInequalityIterations () const |
Returns number of inequality iterations during the latest execution of solve() . More... | |
void | getInequalityDual (Vector< t_dual_size > &dual, Eigen::Matrix< MatrixIndex, t_index_size, 1 > &indices, Eigen::Matrix< bool, t_status_size, 1 > &is_lower) const |
Returns dual variables (Lagrange multipliers) corresponding to inequality constraints. Must be called after successful solve() , the result is undefined if previous call to solve() failed. More... | |
void | reserve (const MatrixIndex primal_size, const MatrixIndex num_simple_bounds, const MatrixIndex num_general_constraints) |
Protected Types | |
template<typename t_Type > | |
using | VectorEnablerReturnType = const typename std::enable_if< t_Type::IsVectorAtCompileTime, ReturnStatus >::type |
template<typename t_Type > | |
using | MatrixEnablerReturnType = const typename std::enable_if< t_Type::ColsAtCompileTime !=1, ReturnStatus >::type |
using | MatrixConstRef = const Eigen::Ref< const Eigen::Matrix< t_Scalar, Eigen::Dynamic, Eigen::Dynamic > > |
using | VectorConstRef = const Eigen::Ref< const Eigen::Matrix< t_Scalar, Eigen::Dynamic, 1 > > |
using | MatrixRef = Eigen::Ref< Eigen::Matrix< t_Scalar, Eigen::Dynamic, Eigen::Dynamic > > |
using | VectorRef = Eigen::Ref< Eigen::Matrix< t_Scalar, Eigen::Dynamic, 1 > > |
Protected Member Functions | |
template<class t_primal , class... t_Args> | |
VectorEnablerReturnType< t_primal > | solve0 (t_primal &primal, t_Args &&...args) |
template<class... t_Args> | |
ReturnStatus | solve0 (VectorRef primal, t_Args &&...args) |
template<class t_primal , class t_H , class... t_Args> | |
MatrixEnablerReturnType< t_H > | solve1 (t_primal &primal, t_H &H, t_Args &&...args) |
template<class t_primal , class... t_Args> | |
ReturnStatus | solve1 (t_primal &primal, MatrixRef H, t_Args &&...args) |
template<class t_primal , class t_H , class t_h , class... t_Args> | |
VectorEnablerReturnType< t_h > | solve2 (t_primal &primal, t_H &H, const t_h &h, t_Args &&...args) |
template<class t_primal , class t_H , class... t_Args> | |
ReturnStatus | solve2 (t_primal &primal, t_H &H, VectorConstRef h, t_Args &&...args) |
template<class t_primal , class t_H , class t_h , class t_lb , class... t_Args> | |
VectorEnablerReturnType< t_lb > | solve3 (t_primal &primal, t_H &H, const t_h &h, const t_lb &lb, t_Args &&...args) |
template<class t_primal , class t_H , class t_h , class t_lb , class... t_Args> | |
ReturnStatus | solve3 (t_primal &primal, t_H &H, const t_h &h, VectorConstRef lb, t_Args &&...args) |
template<class t_primal , class t_H , class t_h , class t_A , class... t_Args> | |
MatrixEnablerReturnType< t_A > | solve3 (t_primal &primal, t_H &H, const t_h &h, const t_A &A, t_Args &&...args) |
template<class t_primal , class t_H , class t_h , class... t_Args> | |
ReturnStatus | solve3 (t_primal &primal, t_H &H, const t_h &h, MatrixConstRef A, t_Args &&...args) |
template<class t_primal , class t_H , class t_h , class t_lb , class t_ub > | |
VectorEnablerReturnType< t_ub > | solve4 (t_primal &primal, t_H &H, const t_h &h, const t_lb &lb, const t_ub &ub) |
template<class t_primal , class t_H , class t_h , class t_lb , class t_ub , class... t_Args> | |
VectorEnablerReturnType< t_ub > | solve4 (t_primal &primal, t_H &H, const t_h &h, const t_lb &lb, const t_ub &ub, t_Args &&...args) |
template<class t_primal , class t_H , class t_h , class t_lb > | |
ReturnStatus | solve4 (t_primal &primal, t_H &H, const t_h &h, const t_lb &lb, VectorConstRef ub) |
template<class t_primal , class t_H , class t_h , class t_lb , class... t_Args> | |
ReturnStatus | solve4 (t_primal &primal, t_H &H, const t_h &h, const t_lb &lb, VectorConstRef ub, t_Args &&...args) |
template<class t_primal , class t_H , class t_h , class t_lb , class t_ub > | |
ReturnStatus | solve5 (t_primal &primal, t_H &H, const t_h &h, const t_lb &lb, const t_ub &ub, const SolverParameters ¶m) |
template<class t_primal , class t_H , class t_h , class t_lb , class t_ub , class t_A , class... t_Args> | |
MatrixEnablerReturnType< t_A > | solve5 (t_primal &primal, t_H &H, const t_h &h, const t_lb &lb, const t_ub &ub, const t_A &A, t_Args &&...args) |
template<class t_primal , class t_H , class t_h , class t_lb , class t_ub , class... t_Args> | |
ReturnStatus | solve5 (t_primal &primal, t_H &H, const t_h &h, const t_lb &lb, const t_ub &ub, MatrixConstRef A, t_Args &&...args) |
template<class t_primal , class t_H , class t_h , class t_lb , class t_ub , class t_A , class t_Alb > | |
VectorEnablerReturnType< t_Alb > | solve6 (t_primal &primal, t_H &H, const t_h &h, const t_lb &lb, const t_ub &ub, const t_A &A, const t_Alb &Alb) |
template<class t_primal , class t_H , class t_h , class t_lb , class t_ub , class t_A , class t_Alb , class... t_Args> | |
VectorEnablerReturnType< t_Alb > | solve6 (t_primal &primal, t_H &H, const t_h &h, const t_lb &lb, const t_ub &ub, const t_A &A, const t_Alb &Alb, t_Args &&...args) |
template<class t_primal , class t_H , class t_h , class t_lb , class t_ub , class t_A > | |
ReturnStatus | solve6 (t_primal &primal, t_H &H, const t_h &h, const t_lb &lb, const t_ub &ub, const t_A &A, VectorConstRef Alb) |
template<class t_primal , class t_H , class t_h , class t_lb , class t_ub , class t_A , class... t_Args> | |
ReturnStatus | solve6 (t_primal &primal, t_H &H, const t_h &h, const t_lb &lb, const t_ub &ub, const t_A &A, VectorConstRef Alb, t_Args &&...args) |
template<class t_primal , class t_H , class t_h , class t_lb , class t_ub , class t_A , class t_Alb , class t_Aub > | |
VectorEnablerReturnType< t_Aub > | solve7 (t_primal &primal, t_H &H, const t_h &h, const t_lb &lb, const t_ub &ub, const t_A &A, const t_Alb &Alb, const t_Aub &Aub) |
template<class t_primal , class t_H , class t_h , class t_lb , class t_ub , class t_A , class t_Alb , class t_Aub , class... t_Args> | |
VectorEnablerReturnType< t_Aub > | solve7 (t_primal &primal, t_H &H, const t_h &h, const t_lb &lb, const t_ub &ub, const t_A &A, const t_Alb &Alb, const t_Aub &Aub, t_Args &&...args) |
template<class t_primal , class t_H , class t_h , class t_lb , class t_ub , class t_A , class t_Alb > | |
ReturnStatus | solve7 (t_primal &primal, t_H &H, const t_h &h, const t_lb &lb, const t_ub &ub, const t_A &A, const t_Alb &Alb, VectorConstRef Aub) |
template<class t_primal , class t_H , class t_h , class t_lb , class t_ub , class t_A , class t_Alb , class... t_Args> | |
ReturnStatus | solve7 (t_primal &primal, t_H &H, const t_h &h, const t_lb &lb, const t_ub &ub, const t_A &A, const t_Alb &Alb, VectorConstRef Aub, t_Args &&...args) |
template<class t_primal , class t_H , class t_h , class t_lb , class t_ub , class t_A , class t_Alb , class t_Aub > | |
ReturnStatus | solve8 (t_primal &primal, t_H &H, const t_h &h, const t_lb &lb, const t_ub &ub, const t_A &A, const t_Alb &Alb, const t_Aub &Aub, const SolverParameters ¶m) |
ReturnStatus | solveGeneric (t_primal &primal, t_H &H, const t_h &h, const t_lb &lb, const t_ub &ub, const t_A &A, const t_Alb &Alb, const t_Aub &Aub, const SolverParameters ¶m) |
Protected Attributes | |
const struct qpmad::SolverTemplate::InputPlaceholders | input_placeholders_ |
Vector< t_primal_size > | dual_ |
Vector< t_primal_size > | primal_step_direction_ |
Vector< t_primal_size > | dual_step_direction_ |
ActiveSet< t_primal_size > | active_set_ |
FactorizationData< t_Scalar, t_primal_size > | factorization_data_ |
MatrixIndex | primal_size_ |
MatrixIndex | h_size_ |
MatrixIndex | num_simple_bounds_ |
MatrixIndex | num_general_constraints_ |
MatrixIndex | num_constraints_ |
Vector< t_general_ctr_number > | general_ctr_dot_primal_ |
std::ptrdiff_t | iter_counter_ |
ChosenConstraint | chosen_ctr_ |
SolverParameters::HessianType | hessian_type_ |
bool | machinery_initialized_ |
Eigen::Array< uint8_t, num_constraints_compile_time_, 1 > | constraints_status_ |
Static Protected Attributes | |
static const MatrixIndex | num_constraints_compile_time_ |
Private Member Functions | |
void | reserveMachinery (const MatrixIndex primal_size, const MatrixIndex num_general_constraints) |
void | reserveDual (const MatrixIndex primal_size) |
void | initializeMachineryLazy (t_MatrixType &H, const bool return_inverted_cholesky_factor) |
void | chooseConstraint (const t_Primal &primal, const t_LowerBounds &lb, const t_UpperBounds &ub, const t_Constraints &A, const t_ConstraintsLowerBounds &Alb, const t_ConstraintsUpperBounds &Aub, const double tolerance) |
void | checkConstraintViolation (const MatrixIndex i, const double lb_i, const double ub_i, const double ctr_i_dot_primal) |
double | getConstraintDotPrimalStepDirection (const t_VectorType &primal_step_direction, const t_MatrixType &A) const |
void | setZero (t_primal &primal) |
void | setZero (VectorRef primal) |
Static Private Member Functions | |
static void | factorizeCholeskyInPlace (Eigen::Matrix< t_Scalar, t_Other... > &H) |
static void | factorizeCholeskyInPlace (MatrixRef &H) |
static void | factorizeCholeskyInPlace (Eigen::SparseMatrix< t_Scalar, t_Options, t_StorageIndex > &H) |
|
inherited |
Definition at line 45 of file implementation.h.
|
protected |
|
protected |
|
protectedinherited |
Definition at line 50 of file implementation.h.
|
inherited |
Definition at line 46 of file implementation.h.
|
inherited |
Definition at line 43 of file implementation.h.
|
protected |
|
protected |
|
protectedinherited |
Definition at line 51 of file implementation.h.
|
inherited |
Definition at line 35 of file implementation.h.
|
inline |
|
inlineprivateinherited |
Definition at line 689 of file implementation.h.
|
inlineprivateinherited |
Definition at line 644 of file implementation.h.
|
inlinestaticprivateinherited |
Definition at line 729 of file implementation.h.
|
inlinestaticprivateinherited |
Definition at line 745 of file implementation.h.
|
inlinestaticprivateinherited |
Definition at line 736 of file implementation.h.
|
inlineprivateinherited |
Definition at line 714 of file implementation.h.
|
inlineinherited |
Returns type of the Hessian produced by the latest execution of solve()
.
Definition at line 107 of file implementation.h.
|
inlineinherited |
Returns dual variables (Lagrange multipliers) corresponding to inequality constraints. Must be called after successful solve()
, the result is undefined if previous call to solve()
failed.
t_status_size | |
t_dual_size | |
t_index_size |
[out] | dual | dual variables |
[out] | indices | constraint indices corresponding to the dual variables, index 0 corresponds to the first simple bound if present or to the first general constraint otherwise |
[out] | is_lower | flags indicating if lower or upper bound is active |
Definition at line 141 of file implementation.h.
|
inlineinherited |
Returns number of inequality iterations during the latest execution of solve()
.
Definition at line 117 of file implementation.h.
|
inlineprivateinherited |
Definition at line 620 of file implementation.h.
|
inlineinherited |
Definition at line 173 of file implementation.h.
|
inlineprivateinherited |
Definition at line 612 of file implementation.h.
|
inlineprivateinherited |
Definition at line 602 of file implementation.h.
|
inlineprivateinherited |
Definition at line 756 of file implementation.h.
|
inlineprivateinherited |
Definition at line 761 of file implementation.h.
|
inline |
Solve QP.
Inputs:
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
|
inlineprotectedinherited |
Definition at line 186 of file implementation.h.
|
protectedinherited |
Definition at line 60 of file implementation.h.
|
protectedinherited |
Definition at line 80 of file implementation.h.
|
protectedinherited |
Definition at line 85 of file implementation.h.
|
protectedinherited |
Definition at line 55 of file implementation.h.
|
protectedinherited |
Definition at line 58 of file implementation.h.
|
protectedinherited |
Definition at line 61 of file implementation.h.
|
protectedinherited |
Definition at line 77 of file implementation.h.
|
protectedinherited |
Definition at line 64 of file implementation.h.
|
protectedinherited |
Definition at line 82 of file implementation.h.
|
protected |
|
protectedinherited |
Definition at line 79 of file implementation.h.
|
protectedinherited |
Definition at line 83 of file implementation.h.
|
protectedinherited |
Definition at line 67 of file implementation.h.
|
staticprotectedinherited |
Definition at line 69 of file implementation.h.
|
protectedinherited |
Definition at line 66 of file implementation.h.
|
protectedinherited |
Definition at line 65 of file implementation.h.
|
protectedinherited |
Definition at line 63 of file implementation.h.
|
protectedinherited |
Definition at line 57 of file implementation.h.