smooth_feedback
Control and estimation on Lie groups
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
smooth::feedback::QPSolver< Pbm > Class Template Reference

Solver for quadratic programs. More...

#include <qp_solver.hpp>

Public Member Functions

 QPSolver (const QPSolverParams &prm={})
 Default constructor. More...
 
 QPSolver (const Pbm &pbm, const QPSolverParams &prm={})
 Construct and allocate working memory. More...
 
 QPSolver (const QPSolver &)=default
 Default copy constructor.
 
 QPSolver (QPSolver &&) noexcept=default
 Default move constructor.
 
QPSolveroperator= (const QPSolver &)=default
 Default copy assignment.
 
QPSolveroperator= (QPSolver &&) noexcept=default
 Default move assignment.
 
 ~QPSolver ()=default
 Default destructor.
 
const QPSolution< M, N, Scalar > & sol () const
 Access most recent QP solution. More...
 
void analyze (const Pbm &pbm)
 Prepare for solving problems. More...
 
const QPSolution< M, N, Scalar > & solve (const Pbm &pbm, std::optional< std::reference_wrapper< const QPSolution< M, N, Scalar > > > warmstart={})
 Solve quadratic program. More...
 

Protected Member Functions

std::optional< QPSolutionStatuscheck_stopping (const Pbm &pbm)
 Check stopping criteria for solver. More...
 
void scale (const Pbm &pbm)
 Re-scale QP. More...
 

Detailed Description

template<typename Pbm>
class smooth::feedback::QPSolver< Pbm >

Solver for quadratic programs.

Use this class to efficiently solve many QPs with the same problem structure.

For one-off QPs, see solve_qp().

Definition at line 243 of file qp_solver.hpp.

Constructor & Destructor Documentation

◆ QPSolver() [1/2]

template<typename Pbm >
smooth::feedback::QPSolver< Pbm >::QPSolver ( const QPSolverParams prm = {})
inline

Default constructor.

Definition at line 267 of file qp_solver.hpp.

◆ QPSolver() [2/2]

template<typename Pbm >
smooth::feedback::QPSolver< Pbm >::QPSolver ( const Pbm &  pbm,
const QPSolverParams prm = {} 
)
inline

Construct and allocate working memory.

Parameters
pbmtemplate problem.

Memory is allocated for solving problems with same structure as pbm.

Definition at line 276 of file qp_solver.hpp.

Member Function Documentation

◆ analyze()

template<typename Pbm >
void smooth::feedback::QPSolver< Pbm >::analyze ( const Pbm &  pbm)
inline

Prepare for solving problems.

Definition at line 297 of file qp_solver.hpp.

◆ check_stopping()

template<typename Pbm >
std::optional< QPSolutionStatus > smooth::feedback::QPSolver< Pbm >::check_stopping ( const Pbm &  pbm)
inlineprotected

Check stopping criteria for solver.

Definition at line 574 of file qp_solver.hpp.

◆ scale()

template<typename Pbm >
void smooth::feedback::QPSolver< Pbm >::scale ( const Pbm &  pbm)
inlineprotected

Re-scale QP.

The scaled problem is defined as

  • \( P_s = c S_x P S_x \),
  • \( q_s = c q S_x \),
  • \( A_s = S_y A S_x \),
  • \( l_s = S_y l \),
  • \( u_s = S_y u \),

where Sx = diag(sx), Sy = diag(sy).

The relation between scaled variables and original variables are

  • Primal: \( x_s = S_x^{-1} x \),
  • Dual: \( y_s = c S_y^{-1} y \).

The objective of the rescaling is the make the columns of

\[ \begin{bmatrix} \bar P & \bar A^T \\ \bar A & 0 \end{bmatrix} \]

have similar \( l_\infty \) norm, and similarly for the columns of

\[ \begin{bmatrix} \bar P & \bar q \end{bmatrix}. \]

Definition at line 673 of file qp_solver.hpp.

◆ sol()

template<typename Pbm >
const QPSolution< M, N, Scalar > & smooth::feedback::QPSolver< Pbm >::sol ( ) const
inline

Access most recent QP solution.

Definition at line 292 of file qp_solver.hpp.

◆ solve()

template<typename Pbm >
const QPSolution< M, N, Scalar > & smooth::feedback::QPSolver< Pbm >::solve ( const Pbm &  pbm,
std::optional< std::reference_wrapper< const QPSolution< M, N, Scalar > > >  warmstart = {} 
)
inline

Solve quadratic program.

Definition at line 344 of file qp_solver.hpp.


The documentation for this class was generated from the following file: