smooth_feedback
Control and estimation on Lie groups
Loading...
Searching...
No Matches
Classes | Typedefs | Functions
qp_solver.hpp File Reference

Quadratic Program solver. More...

#include <chrono>
#include <iomanip>
#include <iostream>
#include <limits>
#include <optional>
#include <Eigen/Cholesky>
#include <Eigen/Dense>
#include <Eigen/Sparse>
#include <Eigen/SparseCholesky>
#include "qp.hpp"
#include "utils/sparse.hpp"
Include dependency graph for qp_solver.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  smooth::feedback::QPSolverParams
 Options for solve_qp. More...
 
struct  smooth::feedback::detail::LDLTWrapper< LDLTt >
 Copy-able wrapper around Eigen LDLT types. More...
 
class  smooth::feedback::QPSolver< Pbm >
 Solver for quadratic programs. More...
 

Typedefs

template<typename Pbm >
using smooth::feedback::detail::qp_solution_t = QPSolution< decltype(Pbm::A)::RowsAtCompileTime, decltype(Pbm::A)::ColsAtCompileTime, typename decltype(Pbm::A)::Scalar >
 

Functions

template<typename Pbm , typename D1 , typename D2 >
bool smooth::feedback::detail::polish_qp (const Pbm &pbm, qp_solution_t< Pbm > &sol, const QPSolverParams &prm, const typename decltype(Pbm::A)::Scalar c, const Eigen::MatrixBase< D1 > &sx, const Eigen::MatrixBase< D2 > &sy)
 Polish solution of quadratic program. More...
 
template<typename Pbm >
detail::qp_solution_t< Pbm > smooth::feedback::solve_qp (const Pbm &pbm, const QPSolverParams &prm, std::optional< std::reference_wrapper< const detail::qp_solution_t< Pbm > > > warmstart={})
 Solve a quadratic program using the operator splitting approach. More...
 

Detailed Description

Quadratic Program solver.

Definition in file qp_solver.hpp.

Typedef Documentation

◆ qp_solution_t

template<typename Pbm >
using smooth::feedback::detail::qp_solution_t = typedef QPSolution< decltype(Pbm::A)::RowsAtCompileTime, decltype(Pbm::A)::ColsAtCompileTime, typename decltype(Pbm::A)::Scalar>

Definition at line 73 of file qp_solver.hpp.

Function Documentation

◆ polish_qp()

template<typename Pbm , typename D1 , typename D2 >
bool smooth::feedback::detail::polish_qp ( const Pbm &  pbm,
qp_solution_t< Pbm > &  sol,
const QPSolverParams prm,
const typename decltype(Pbm::A)::Scalar  c,
const Eigen::MatrixBase< D1 > &  sx,
const Eigen::MatrixBase< D2 > &  sy 
)

Polish solution of quadratic program.

Template Parameters
Pbmproblem type
Parameters
[in]pbmproblem formulation
[in,out]solsolution to polish
[in]prmsolver options
[in]ccost scaling
[in]sxvariable scaling
[in]syconstraint scaling
Warning
This function allocates dynamic memory even for static-sized problems.

Definition at line 93 of file qp_solver.hpp.

◆ solve_qp()

template<typename Pbm >
detail::qp_solution_t< Pbm > smooth::feedback::solve_qp ( const Pbm &  pbm,
const QPSolverParams prm,
std::optional< std::reference_wrapper< const detail::qp_solution_t< Pbm > > >  warmstart = {} 
)

Solve a quadratic program using the operator splitting approach.

Template Parameters
Pbmproblem type (QuadraticProgram or QuadraticProgramSparse)
Parameters
pbmproblem formulation
prmsolver options
warmstartprovide initial guess for primal and dual variables
Returns
solution as QuasraticProgramSolution<M, N>
Note
dynamic problem sizes (M == -1 || N == -1) are supported

This is a third-party implementation of the algorithm described in the following paper:

For the official C implementation, see https://osqp.org/.

Definition at line 780 of file qp_solver.hpp.