proxsuite 0.6.7
The Advanced Proximal Optimization Toolbox
|
Namespaces | |
namespace | detail |
namespace | preconditioner |
Classes | |
struct | BatchQP |
struct | Ldlt |
struct | Model |
This class stores the model of the QP problem. More... | |
struct | PrimalDualGradResult |
struct | QP |
This class defines the API of PROXQP solver with sparse backend. More... | |
struct | QpView |
struct | QpViewMut |
struct | SparseModel |
struct | Workspace |
This class defines the workspace of the sparse solver. More... | |
Typedefs | |
template<typename T > | |
using | DMat = Eigen::Matrix<T, -1, -1> |
template<typename T , typename I > | |
using | SparseMat = Eigen::SparseMatrix<T, Eigen::ColMajor, I> |
template<typename T > | |
using | VecRef = Eigen::Ref<Eigen::Matrix<T, DYN, 1> const> |
template<typename T > | |
using | MatRef = Eigen::Ref<Eigen::Matrix<T, DYN, DYN> const> |
template<typename T > | |
using | Vec = Eigen::Matrix<T, DYN, 1> |
template<typename T , typename I > | |
using | Mat = Eigen::SparseMatrix<T, Eigen::ColMajor, I> |
using | VecBool = Eigen::Matrix<bool, DYN, 1> |
Enumerations | |
enum | { layout = Eigen::RowMajor } |
Functions | |
template<typename T , typename I > | |
void | solve_in_parallel (proxqp::sparse::BatchQP< T, I > &qps, const optional< size_t > num_threads=nullopt) |
template<typename T , typename I > | |
void | solve_in_parallel (std::vector< proxqp::sparse::QP< T, I > > &qps, const optional< size_t > num_threads=nullopt) |
template<typename T , typename I > | |
T | power_iteration (SparseMat< T, I > &H, sparse::Vec< T > &dw, sparse::Vec< T > &rhs, sparse::Vec< T > &err_v, T power_iteration_accuracy, isize nb_power_iteration) |
template<typename T , typename I > | |
T | min_eigen_value_via_modified_power_iteration (SparseMat< T, I > &H, sparse::Vec< T > &dw, sparse::Vec< T > &rhs, sparse::Vec< T > &err_v, T max_eigen_value, T power_iteration_accuracy, isize nb_power_iteration) |
template<typename T , typename I > | |
T | estimate_minimal_eigen_value_of_symmetric_matrix (SparseMat< T, I > &H, T power_iteration_accuracy, isize nb_power_iteration) |
template<typename T > | |
void | update_default_rho_with_minimal_Hessian_eigen_value (optional< T > manual_minimal_H_eigenvalue, Results< T > &results, Settings< T > &settings) |
template<typename T , typename I > | |
void | update_proximal_parameters (Settings< T > &settings, Results< T > &results, Workspace< T, I > &work, optional< T > rho_new, optional< T > mu_eq_new, optional< T > mu_in_new) |
template<typename T , typename I > | |
void | warm_start (optional< VecRef< T > > x_wm, optional< VecRef< T > > y_wm, optional< VecRef< T > > z_wm, Results< T > &results, Settings< T > &settings, Model< T, I > &model) |
template<typename T , typename I , typename P > | |
void | qp_setup (QpView< T, I > qp, Results< T > &results, Model< T, I > &data, Workspace< T, I > &work, Settings< T > &settings, P &precond, PreconditionerStatus &preconditioner_status) |
template<typename T , typename I > | |
auto | have_same_structure (proxsuite::linalg::sparse::MatRef< T, I > a, proxsuite::linalg::sparse::MatRef< T, I > b) -> bool |
template<typename T , typename I > | |
void | copy (proxsuite::linalg::sparse::MatMut< T, I > a, proxsuite::linalg::sparse::MatRef< T, I > b) |
template<typename T , typename I > | |
void | ldl_solve (VectorViewMut< T > sol, VectorView< T > rhs, isize n_tot, proxsuite::linalg::sparse::MatMut< T, I > ldl, Eigen::MINRES< detail::AugmentedKkt< T, I >, Eigen::Upper|Eigen::Lower, Eigen::IdentityPreconditioner > &iterative_solver, bool do_ldlt, proxsuite::linalg::veg::dynstack::DynStackMut stack, T *ldl_values, I *perm, I *ldl_col_ptrs, I const *perm_inv) |
template<typename T , typename I > | |
void | ldl_iter_solve_noalias (VectorViewMut< T > sol, VectorView< T > rhs, VectorView< T > init_guess, Results< T > const &results, Model< T, I > const &data, isize n_tot, proxsuite::linalg::sparse::MatMut< T, I > ldl, Eigen::MINRES< detail::AugmentedKkt< T, I >, Eigen::Upper|Eigen::Lower, Eigen::IdentityPreconditioner > &iterative_solver, bool do_ldlt, proxsuite::linalg::veg::dynstack::DynStackMut stack, T *ldl_values, I *perm, I *ldl_col_ptrs, I const *perm_inv, Settings< T > const &settings, proxsuite::linalg::sparse::MatMut< T, I > kkt_active, proxsuite::linalg::veg::SliceMut< bool > active_constraints) |
template<typename T , typename I > | |
void | ldl_solve_in_place (VectorViewMut< T > rhs, VectorView< T > init_guess, Results< T > const &results, Model< T, I > const &data, isize n_tot, proxsuite::linalg::sparse::MatMut< T, I > ldl, Eigen::MINRES< detail::AugmentedKkt< T, I >, Eigen::Upper|Eigen::Lower, Eigen::IdentityPreconditioner > &iterative_solver, bool do_ldlt, proxsuite::linalg::veg::dynstack::DynStackMut stack, T *ldl_values, I *perm, I *ldl_col_ptrs, I const *perm_inv, Settings< T > const &settings, proxsuite::linalg::sparse::MatMut< T, I > kkt_active, proxsuite::linalg::veg::SliceMut< bool > active_constraints) |
template<typename T , typename I > | |
auto | inner_reconstructed_matrix (proxsuite::linalg::sparse::MatMut< T, I > ldl) -> DMat< T > |
template<typename T , typename I > | |
auto | reconstructed_matrix (proxsuite::linalg::sparse::MatMut< T, I > ldl, I const *perm_inv, isize n_tot) -> DMat< T > |
template<typename T , typename I > | |
auto | reconstruction_error (proxsuite::linalg::sparse::MatMut< T, I > ldl, I const *perm_inv, Results< T > const &results, Model< T, I > const &data, isize n_tot, proxsuite::linalg::sparse::MatMut< T, I > kkt_active, proxsuite::linalg::veg::SliceMut< bool > active_constraints) -> DMat< T > |
template<typename T , typename I , typename P > | |
void | qp_solve (Results< T > &results, Model< T, I > &data, const Settings< T > &settings, Workspace< T, I > &work, P &precond) |
template<typename T , typename I > | |
void | print_setup_header (const Settings< T > &settings, Results< T > &results, const Model< T, I > &model) |
template<typename T , typename I > | |
void | refactorize (Workspace< T, I > &work, Results< T > const &results, Settings< T > const &settings, proxsuite::linalg::sparse::MatMut< T, I > kkt_active, proxsuite::linalg::veg::SliceMut< bool > active_constraints, Model< T, I > const &data, proxsuite::linalg::veg::dynstack::DynStackMut stack, proxsuite::linalg::veg::Tag< T > &xtag) |
template<typename T , typename I > | |
proxqp::Results< T > | solve (optional< SparseMat< T, I > > H, optional< VecRef< T > > g, optional< SparseMat< T, I > > A, optional< VecRef< T > > b, optional< SparseMat< T, I > > C, optional< VecRef< T > > l, optional< VecRef< T > > u, optional< VecRef< T > > x=nullopt, optional< VecRef< T > > y=nullopt, optional< VecRef< T > > z=nullopt, optional< T > eps_abs=nullopt, optional< T > eps_rel=nullopt, optional< T > rho=nullopt, optional< T > mu_eq=nullopt, optional< T > mu_in=nullopt, optional< bool > verbose=nullopt, bool compute_preconditioner=true, bool compute_timings=false, optional< isize > max_iter=nullopt, proxsuite::proxqp::InitialGuessStatus initial_guess=proxsuite::proxqp::InitialGuessStatus::EQUALITY_CONSTRAINED_INITIAL_GUESS, proxsuite::proxqp::SparseBackend sparse_backend=proxsuite::proxqp::SparseBackend::Automatic, bool check_duality_gap=false, optional< T > eps_duality_gap_abs=nullopt, optional< T > eps_duality_gap_rel=nullopt, bool primal_infeasibility_solving=false, optional< T > manual_minimal_H_eigenvalue=nullopt) |
Variables | |
static constexpr auto | DYN = Eigen::Dynamic |
using proxsuite::proxqp::sparse::DMat = Eigen::Matrix<T, -1, -1> |
using proxsuite::proxqp::sparse::SparseMat = Eigen::SparseMatrix<T, Eigen::ColMajor, I> |
using proxsuite::proxqp::sparse::VecRef = Eigen::Ref<Eigen::Matrix<T, DYN, 1> const> |
using proxsuite::proxqp::sparse::MatRef = Eigen::Ref<Eigen::Matrix<T, DYN, DYN> const> |
using proxsuite::proxqp::sparse::Vec = Eigen::Matrix<T, DYN, 1> |
using proxsuite::proxqp::sparse::Mat = Eigen::SparseMatrix<T, Eigen::ColMajor, I> |
using proxsuite::proxqp::sparse::VecBool = Eigen::Matrix<bool, DYN, 1> |
void proxsuite::proxqp::sparse::solve_in_parallel | ( | proxqp::sparse::BatchQP< T, I > & | qps, |
const optional< size_t > | num_threads = nullopt ) |
Definition at line 144 of file qp_solve.hpp.
void proxsuite::proxqp::sparse::solve_in_parallel | ( | std::vector< proxqp::sparse::QP< T, I > > & | qps, |
const optional< size_t > | num_threads = nullopt ) |
Definition at line 166 of file qp_solve.hpp.
T proxsuite::proxqp::sparse::power_iteration | ( | SparseMat< T, I > & | H, |
sparse::Vec< T > & | dw, | ||
sparse::Vec< T > & | rhs, | ||
sparse::Vec< T > & | err_v, | ||
T | power_iteration_accuracy, | ||
isize | nb_power_iteration ) |
Definition at line 20 of file helpers.hpp.
T proxsuite::proxqp::sparse::min_eigen_value_via_modified_power_iteration | ( | SparseMat< T, I > & | H, |
sparse::Vec< T > & | dw, | ||
sparse::Vec< T > & | rhs, | ||
sparse::Vec< T > & | err_v, | ||
T | max_eigen_value, | ||
T | power_iteration_accuracy, | ||
isize | nb_power_iteration ) |
Definition at line 60 of file helpers.hpp.
T proxsuite::proxqp::sparse::estimate_minimal_eigen_value_of_symmetric_matrix | ( | SparseMat< T, I > & | H, |
T | power_iteration_accuracy, | ||
isize | nb_power_iteration ) |
Estimate minimal eigenvalue of a symmetric Matrix via power iteration
H | symmetric matrix. |
power_iteration_accuracy | power iteration algorithm accuracy tracked |
nb_power_iteration | maximal number of power iteration executed |
Definition at line 118 of file helpers.hpp.
void proxsuite::proxqp::sparse::update_default_rho_with_minimal_Hessian_eigen_value | ( | optional< T > | manual_minimal_H_eigenvalue, |
Results< T > & | results, | ||
Settings< T > & | settings ) |
Estimate H minimal eigenvalue
settings | solver settings |
results | solver results. |
manual_minimal_H_eigenvalue | minimal H eigenvalue estimate. |
Definition at line 159 of file helpers.hpp.
void proxsuite::proxqp::sparse::update_proximal_parameters | ( | Settings< T > & | settings, |
Results< T > & | results, | ||
Workspace< T, I > & | work, | ||
optional< T > | rho_new, | ||
optional< T > | mu_eq_new, | ||
optional< T > | mu_in_new ) |
Update the proximal parameters of the results object.
rho_new | primal proximal parameter |
mu_eq_new | dual equality proximal parameter |
mu_in_new | dual inequality proximal parameter |
results | solver result |
Definition at line 183 of file helpers.hpp.
void proxsuite::proxqp::sparse::warm_start | ( | optional< VecRef< T > > | x_wm, |
optional< VecRef< T > > | y_wm, | ||
optional< VecRef< T > > | z_wm, | ||
Results< T > & | results, | ||
Settings< T > & | settings, | ||
Model< T, I > & | model ) |
Warm start the results primal and dual variables.
x_wm | primal proximal parameter |
y_wm | dual equality proximal parameter |
z_wm | dual inequality proximal parameter |
results | solver result |
settings | solver settings |
Definition at line 219 of file helpers.hpp.
void proxsuite::proxqp::sparse::qp_setup | ( | QpView< T, I > | qp, |
Results< T > & | results, | ||
Model< T, I > & | data, | ||
Workspace< T, I > & | work, | ||
Settings< T > & | settings, | ||
P & | precond, | ||
PreconditionerStatus & | preconditioner_status ) |
Setups the QP solver model.
qp | view of the QP model. |
work | solver workspace. |
settings | solver settings. |
data | solver model. |
results | solver result. |
precond | preconditioner. |
preconditioner_status | bool variable for deciding whether executing the preconditioning algorithm, or keeping previous preconditioning variables, or using the identity preconditioner (i.e., no preconditioner). |
Definition at line 282 of file helpers.hpp.
auto proxsuite::proxqp::sparse::have_same_structure | ( | proxsuite::linalg::sparse::MatRef< T, I > | a, |
proxsuite::linalg::sparse::MatRef< T, I > | b ) -> bool |
Checks whether matrix b has the same sparsity structure as matrix a.
a | matrix. |
b | matrix. |
Definition at line 414 of file helpers.hpp.
void proxsuite::proxqp::sparse::copy | ( | proxsuite::linalg::sparse::MatMut< T, I > | a, |
proxsuite::linalg::sparse::MatRef< T, I > | b ) |
Copies matrix b elements into matrix a.
a | matrix. |
b | matrix. |
Definition at line 443 of file helpers.hpp.
void proxsuite::proxqp::sparse::ldl_solve | ( | VectorViewMut< T > | sol, |
VectorView< T > | rhs, | ||
isize | n_tot, | ||
proxsuite::linalg::sparse::MatMut< T, I > | ldl, | ||
Eigen::MINRES< detail::AugmentedKkt< T, I >, Eigen::Upper|Eigen::Lower, Eigen::IdentityPreconditioner > & | iterative_solver, | ||
bool | do_ldlt, | ||
proxsuite::linalg::veg::dynstack::DynStackMut | stack, | ||
T * | ldl_values, | ||
I * | perm, | ||
I * | ldl_col_ptrs, | ||
I const * | perm_inv ) |
Definition at line 40 of file solver.hpp.
void proxsuite::proxqp::sparse::ldl_iter_solve_noalias | ( | VectorViewMut< T > | sol, |
VectorView< T > | rhs, | ||
VectorView< T > | init_guess, | ||
Results< T > const & | results, | ||
Model< T, I > const & | data, | ||
isize | n_tot, | ||
proxsuite::linalg::sparse::MatMut< T, I > | ldl, | ||
Eigen::MINRES< detail::AugmentedKkt< T, I >, Eigen::Upper|Eigen::Lower, Eigen::IdentityPreconditioner > & | iterative_solver, | ||
bool | do_ldlt, | ||
proxsuite::linalg::veg::dynstack::DynStackMut | stack, | ||
T * | ldl_values, | ||
I * | perm, | ||
I * | ldl_col_ptrs, | ||
I const * | perm_inv, | ||
Settings< T > const & | settings, | ||
proxsuite::linalg::sparse::MatMut< T, I > | kkt_active, | ||
proxsuite::linalg::veg::SliceMut< bool > | active_constraints ) |
Definition at line 88 of file solver.hpp.
void proxsuite::proxqp::sparse::ldl_solve_in_place | ( | VectorViewMut< T > | rhs, |
VectorView< T > | init_guess, | ||
Results< T > const & | results, | ||
Model< T, I > const & | data, | ||
isize | n_tot, | ||
proxsuite::linalg::sparse::MatMut< T, I > | ldl, | ||
Eigen::MINRES< detail::AugmentedKkt< T, I >, Eigen::Upper|Eigen::Lower, Eigen::IdentityPreconditioner > & | iterative_solver, | ||
bool | do_ldlt, | ||
proxsuite::linalg::veg::dynstack::DynStackMut | stack, | ||
T * | ldl_values, | ||
I * | perm, | ||
I * | ldl_col_ptrs, | ||
I const * | perm_inv, | ||
Settings< T > const & | settings, | ||
proxsuite::linalg::sparse::MatMut< T, I > | kkt_active, | ||
proxsuite::linalg::veg::SliceMut< bool > | active_constraints ) |
Solves in place a linear system.
rhs | right hand side vector of the linear system to solver. |
init_guess | initial guess for solving the linear system |
ldl | current ldlt. |
do_ldlt | boolean variable for doing the ldlt (rather than MinRes algorithm). |
perm_inv | pointer to the inverse of the permutation. |
results | solver results. |
data | model of the QP. |
n_tot | dimension of the KKT matrix |
kkt_active | active part of the KKT matrix. |
active_constraints | vector boolean precising whether the constraints are active or not. |
iterative_solver | iterative solver matrix free. |
stack | memory stack. |
ldl_values | pointor to ldl values. |
perm | pointor to the ldl permutation. |
ldl_col_ptrs | pointor to the column of the ldl. |
perm_inv | pointor the inverse permutation. |
settings | solver's settings. |
kkt_active | active part of the kkt. |
Definition at line 201 of file solver.hpp.
auto proxsuite::proxqp::sparse::inner_reconstructed_matrix | ( | proxsuite::linalg::sparse::MatMut< T, I > | ldl | ) | -> DMat<T> |
Reconstructs manually the permutted matrix.
ldl | current ldlt. |
do_ldlt | boolean variable for doing the ldlt (rather than MinRes algorithm). |
Definition at line 250 of file solver.hpp.
auto proxsuite::proxqp::sparse::reconstructed_matrix | ( | proxsuite::linalg::sparse::MatMut< T, I > | ldl, |
I const * | perm_inv, | ||
isize | n_tot ) -> DMat<T> |
Reconstructs manually the value of the KKT matrix.
ldl | current ldlt. |
do_ldlt | boolean variable for doing the ldlt (rather than MinRes algorithm). |
perm_inv | pointer to the inverse of the permutation. |
n_tot | dimension of the KKT matrix |
Definition at line 271 of file solver.hpp.
auto proxsuite::proxqp::sparse::reconstruction_error | ( | proxsuite::linalg::sparse::MatMut< T, I > | ldl, |
I const * | perm_inv, | ||
Results< T > const & | results, | ||
Model< T, I > const & | data, | ||
isize | n_tot, | ||
proxsuite::linalg::sparse::MatMut< T, I > | kkt_active, | ||
proxsuite::linalg::veg::SliceMut< bool > | active_constraints ) -> DMat<T> |
Derives the norm of the difference between current KKT and the one it should be (derived manually).
ldl | current ldlt. |
perm_inv | pointer to the inverse of the permutation. |
results | solver results. |
data | model of the QP. |
n_tot | dimension of the KKT matrix |
kkt_active | active part of the KKT matrix. |
active_constraints | vector boolean precising whether the constraints are active or not. |
Definition at line 299 of file solver.hpp.
void proxsuite::proxqp::sparse::qp_solve | ( | Results< T > & | results, |
Model< T, I > & | data, | ||
const Settings< T > & | settings, | ||
Workspace< T, I > & | work, | ||
P & | precond ) |
Executes the PROXQP algorithm.
results | solver results. |
data | QP problem model as defined by the user (without any scaling performed). |
settings | solver settings. |
work | solver workspace. |
precond | preconditioner. |
Definition at line 344 of file solver.hpp.
void proxsuite::proxqp::sparse::refactorize | ( | Workspace< T, I > & | work, |
Results< T > const & | results, | ||
Settings< T > const & | settings, | ||
proxsuite::linalg::sparse::MatMut< T, I > | kkt_active, | ||
proxsuite::linalg::veg::SliceMut< bool > | active_constraints, | ||
Model< T, I > const & | data, | ||
proxsuite::linalg::veg::dynstack::DynStackMut | stack, | ||
proxsuite::linalg::veg::Tag< T > & | xtag ) |
Definition at line 33 of file workspace.hpp.
proxqp::Results< T > proxsuite::proxqp::sparse::solve | ( | optional< SparseMat< T, I > > | H, |
optional< VecRef< T > > | g, | ||
optional< SparseMat< T, I > > | A, | ||
optional< VecRef< T > > | b, | ||
optional< SparseMat< T, I > > | C, | ||
optional< VecRef< T > > | l, | ||
optional< VecRef< T > > | u, | ||
optional< VecRef< T > > | x = nullopt, | ||
optional< VecRef< T > > | y = nullopt, | ||
optional< VecRef< T > > | z = nullopt, | ||
optional< T > | eps_abs = nullopt, | ||
optional< T > | eps_rel = nullopt, | ||
optional< T > | rho = nullopt, | ||
optional< T > | mu_eq = nullopt, | ||
optional< T > | mu_in = nullopt, | ||
optional< bool > | verbose = nullopt, | ||
bool | compute_preconditioner = true, | ||
bool | compute_timings = false, | ||
optional< isize > | max_iter = nullopt, | ||
proxsuite::proxqp::InitialGuessStatus | initial_guess = proxsuite::proxqp::InitialGuessStatus::EQUALITY_CONSTRAINED_INITIAL_GUESS, | ||
proxsuite::proxqp::SparseBackend | sparse_backend = proxsuite::proxqp::SparseBackend::Automatic, | ||
bool | check_duality_gap = false, | ||
optional< T > | eps_duality_gap_abs = nullopt, | ||
optional< T > | eps_duality_gap_rel = nullopt, | ||
bool | primal_infeasibility_solving = false, | ||
optional< T > | manual_minimal_H_eigenvalue = nullopt ) |
Solves the QP problem using PROXQP algorithm without the need to define a QP object, with matrices defined by Dense Eigen matrices. It is possible to set up some of the solver parameters (warm start, initial guess option, proximal step sizes, absolute and relative accuracies, maximum number of iterations, preconditioner execution).
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. |
x | primal warm start. |
y | dual equality constraint warm start. |
z | dual inequality constraint warm start. |
verbose | if set to true, the solver prints more information about each iteration. |
compute_preconditioner | boolean parameter for executing or not the preconditioner. |
compute_timings | boolean parameter for computing the solver timings. |
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. |
eps_abs | absolute accuracy threshold. |
eps_rel | relative accuracy threshold. |
max_iter | maximum number of iteration. |
initial_guess | initial guess option for warm starting or not the initial iterate values. |
check_duality_gap | If set to true, include the duality gap in absolute and relative stopping criteria. |
eps_duality_gap_abs | absolute accuracy threshold for the duality-gap criterion. |
eps_duality_gap_rel | relative accuracy threshold for the duality-gap criterion. |
Definition at line 707 of file wrapper.hpp.