Template Struct QP

Struct Documentation

template<typename T>
struct QP

Public Functions

inline QP(isize _dim, isize _n_eq, isize _n_in, bool _box_constraints, proxsuite::proxqp::HessianType _hessian_type, DenseBackend _dense_backend)

Default constructor using QP model dimensions.

Parameters:
  • _dim – primal variable dimension.

  • _n_eq – number of equality constraints.

  • _n_in – number of inequality constraints.

  • _hessian_type – problem type (QP, LP, DIAGONAL)

  • _box_constraints – specify that there are (or not) box constraints.

  • _dense_backend – specify which factorization is used.

inline QP(isize _dim, isize _n_eq, isize _n_in, bool _box_constraints, DenseBackend _dense_backend, proxsuite::proxqp::HessianType _hessian_type)

Default constructor using QP model dimensions.

Parameters:
  • _dim – primal variable dimension.

  • _n_eq – number of equality constraints.

  • _n_in – number of inequality constraints.

  • _hessian_type – problem type (QP, LP, DIAGONAL)

  • _box_constraints – specify that there are (or not) box constraints.

  • _dense_backend – specify which factorization is used.

inline QP(isize _dim, isize _n_eq, isize _n_in, bool _box_constraints, proxsuite::proxqp::HessianType _hessian_type)

Default constructor using QP model dimensions.

Parameters:
  • _dim – primal variable dimension.

  • _n_eq – number of equality constraints.

  • _n_in – number of inequality constraints.

  • _hessian_type – problem type (QP, LP, DIAGONAL)

  • _box_constraints – specify that there are (or not) box constraints.

inline QP(isize _dim, isize _n_eq, isize _n_in, bool _box_constraints, DenseBackend _dense_backend)

Default constructor using QP model dimensions.

Parameters:
  • _dim – primal variable dimension.

  • _n_eq – number of equality constraints.

  • _n_in – number of inequality constraints.

  • _hessian_type – problem type (QP, LP, DIAGONAL)

  • _box_constraints – specify that there are (or not) box constraints.

  • _dense_backend – specify which factorization is used.

inline QP(isize _dim, isize _n_eq, isize _n_in, bool _box_constraints)

Default constructor using QP model dimensions.

Parameters:
  • _dim – primal variable dimension.

  • _n_eq – number of equality constraints.

  • _n_in – number of inequality constraints.

  • _box_constraints – specify that there are (or not) box constraints.

inline QP(isize _dim, isize _n_eq, isize _n_in, proxsuite::proxqp::HessianType _hessian_type)

Default constructor using QP model dimensions.

Parameters:
  • _dim – primal variable dimension.

  • _n_eq – number of equality constraints.

  • _n_in – number of inequality constraints.

  • _hessian_type – specify that there are (or not) box constraints.

inline QP(isize _dim, isize _n_eq, isize _n_in)

Default constructor using QP model dimensions.

Parameters:
  • _dim – primal variable dimension.

  • _n_eq – number of equality constraints.

  • _n_in – number of inequality constraints.

inline bool is_box_constrained() const
inline DenseBackend which_dense_backend() const
inline HessianType which_hessian_type() const
inline void init(optional<MatRef<T>> H, optional<VecRef<T>> g, optional<MatRef<T>> A, optional<VecRef<T>> b, optional<MatRef<T>> C, optional<VecRef<T>> l, optional<VecRef<T>> u, bool compute_preconditioner = true, optional<T> rho = nullopt, optional<T> mu_eq = nullopt, optional<T> mu_in = nullopt, optional<T> manual_minimal_H_eigenvalue = nullopt)

Setups the QP model (with dense matrix format) and equilibrates it if specified by the user.

Parameters:
  • H – quadratic cost input defining the QP model.

  • g – linear cost input defining the QP model.

  • A – equality constraint matrix input defining the QP model.

  • b – equality constraint vector input defining the QP model.

  • C – inequality constraint matrix input defining the QP model.

  • l – lower inequality constraint vector input defining the QP model.

  • u – upper inequality constraint vector input defining the QP model.

  • compute_preconditioner – boolean parameter for executing or not the preconditioner.

  • rho – proximal step size wrt primal variable.

  • mu_eq – proximal step size wrt equality constrained multiplier.

  • mu_in – proximal step size wrt inequality constrained multiplier.

  • manual_minimal_H_eigenvalue – manual minimal eigenvalue proposed for H

inline void init(optional<MatRef<T>> H, optional<VecRef<T>> g, optional<MatRef<T>> A, optional<VecRef<T>> b, optional<MatRef<T>> C, optional<VecRef<T>> l, optional<VecRef<T>> u, optional<VecRef<T>> l_box, optional<VecRef<T>> u_box, bool compute_preconditioner = true, optional<T> rho = nullopt, optional<T> mu_eq = nullopt, optional<T> mu_in = nullopt, optional<T> manual_minimal_H_eigenvalue = nullopt)

Setups the QP model (with dense matrix format) and equilibrates it if specified by the user.

Parameters:
  • H – quadratic cost input defining the QP model.

  • g – linear cost input defining the QP model.

  • A – equality constraint matrix input defining the QP model.

  • b – equality constraint vector input defining the QP model.

  • C – inequality constraint matrix input defining the QP model.

  • l – lower inequality constraint vector input defining the QP model.

  • u – upper inequality constraint vector input defining the QP model.

  • l_box – lower box inequality constraint vector input defining the QP model.

  • u_box – uppper box inequality constraint vector input defining the QP model.

  • compute_preconditioner – boolean parameter for executing or not the preconditioner.

  • rho – proximal step size wrt primal variable.

  • mu_eq – proximal step size wrt equality constrained multiplier.

  • mu_in – proximal step size wrt inequality constrained multiplier.

  • manual_minimal_H_eigenvalue – manual minimal eigenvalue proposed for H

inline void update(optional<MatRef<T>> H, optional<VecRef<T>> g, optional<MatRef<T>> A, optional<VecRef<T>> b, optional<MatRef<T>> C, optional<VecRef<T>> l, optional<VecRef<T>> u, bool update_preconditioner = false, optional<T> rho = nullopt, optional<T> mu_eq = nullopt, optional<T> mu_in = nullopt, optional<T> manual_minimal_H_eigenvalue = nullopt)

Updates the QP model (with dense matrix format) and re-equilibrates it if specified by the user.

Note

The init method should be called before update. If it has not been done before, init is called depending on the is_initialized flag.

Parameters:
  • H – quadratic cost input defining the QP model.

  • g – linear cost input defining the QP model.

  • A – equality constraint matrix input defining the QP model.

  • b – equality constraint vector input defining the QP model.

  • C – inequality constraint matrix input defining the QP model.

  • l – lower inequality constraint vector input defining the QP model.

  • u – upper inequality constraint vector input defining the QP model.

  • update_preconditioner – bool parameter for updating or not the preconditioner and the associated scaled model.

  • rho – proximal step size wrt primal variable.

  • mu_eq – proximal step size wrt equality constrained multiplier.

  • mu_in – proximal step size wrt inequality constrained multiplier.

  • manual_minimal_H_eigenvalue – manual minimal eigenvalue proposed for H

inline void update(optional<MatRef<T>> H, optional<VecRef<T>> g, optional<MatRef<T>> A, optional<VecRef<T>> b, optional<MatRef<T>> C, optional<VecRef<T>> l, optional<VecRef<T>> u, optional<VecRef<T>> l_box, optional<VecRef<T>> u_box, bool update_preconditioner = false, optional<T> rho = nullopt, optional<T> mu_eq = nullopt, optional<T> mu_in = nullopt, optional<T> manual_minimal_H_eigenvalue = nullopt)

Updates the QP model (with dense matrix format) and re-equilibrates it if specified by the user.

Note

The init method should be called before update. If it has not been done before, init is called depending on the is_initialized flag.

Parameters:
  • H – quadratic cost input defining the QP model.

  • g – linear cost input defining the QP model.

  • A – equality constraint matrix input defining the QP model.

  • b – equality constraint vector input defining the QP model.

  • C – inequality constraint matrix input defining the QP model.

  • l – lower inequality constraint vector input defining the QP model.

  • u – upper inequality constraint vector input defining the QP model.

  • l_box – lower inequality constraint vector input defining the QP model.

  • u_box – upper inequality constraint vector input defining the QP model.

  • update_preconditioner – bool parameter for updating or not the preconditioner and the associated scaled model.

  • rho – proximal step size wrt primal variable.

  • mu_eq – proximal step size wrt equality constrained multiplier.

  • mu_in – proximal step size wrt inequality constrained multiplier.

  • manual_minimal_H_eigenvalue – manual minimal eigenvalue proposed for H

inline void solve()

Solves the QP problem using PRXOQP algorithm.

inline void solve(optional<VecRef<T>> x, optional<VecRef<T>> y, optional<VecRef<T>> z)

Solves the QP problem using PROXQP algorithm using a warm start.

Parameters:
  • x – primal warm start.

  • y – dual equality warm start.

  • z – dual inequality warm start.

inline void cleanup()

Clean-ups solver’s results and workspace.

Public Members

Results<T> results
Settings<T> settings
Model<T> model
Workspace<T> work
preconditioner::RuizEquilibration<T> ruiz