Solve a quadratic program with a specific structure. qp_as = Quadratic Programming / Active Set.
More...
#include <qp_as.h>
List of all members.
Public Member Functions |
| qp_as (const int N_, const double, const double, const double, const double, const double) |
| Constructor: initialization of the constant parameters.
|
| ~qp_as () |
void | set_parameters (const double *, const double *, const double, const double *, const double *, const double *, const double *, const double *) |
| Initializes quadratic problem.
|
int | solve () |
| Solve QP problem.
|
Private Member Functions |
void | form_iHg (const double *, const double *) |
| Forms inv(2*H) * g.
|
void | form_bounds (const double *, const double *) |
| Forms the upper and lower bounds.
|
int | check_blocking_bounds () |
| Checks for blocking bounds.
|
int | choose_excl_constr (const double *) |
| Selects a constraint for removal from active set.
|
Private Attributes |
chol_solve_as | chol |
| An instance of chol_solve_as class.
|
double * | iHg |
| inv(H) * g
|
int * | W |
int * | W_sign |
int | nW |
std::vector< bound > | Bounds |
| Vector of bounds.
|
Detailed Description
Solve a quadratic program with a specific structure. qp_as = Quadratic Programming / Active Set.
Definition at line 62 of file qp_as.h.
Constructor & Destructor Documentation
qp_as::qp_as |
( |
const int |
N_, |
|
|
const double |
Alpha, |
|
|
const double |
Beta, |
|
|
const double |
Gamma, |
|
|
const double |
regularization, |
|
|
const double |
tol_ |
|
) |
| |
Constructor: initialization of the constant parameters.
- Parameters:
-
[in] | N_ | Number of sampling times in a preview window |
[in] | Alpha | Velocity gain |
[in] | Beta | Position gain |
[in] | Gamma | Jerk gain |
[in] | regularization | regularization |
[in] | tol_ | tolerance |
Definition at line 50 of file qp_as.cpp.
Member Function Documentation
Checks for blocking bounds.
- Returns:
- sequential number of constraint to be added, -1 if no constraints.
Definition at line 165 of file qp_as.cpp.
Selects a constraint for removal from active set.
- Parameters:
-
[in] | lambda | vector of Lagrange multipliers corresponding to inequality constraints. |
- Returns:
- index of constraint in the active set, -1 if no constraint can be removed.
- Attention:
- If a constraint for removal is selected, then it is removed from the active set (W) and the number of constraints in active set (nW) is decremented.
Definition at line 226 of file qp_as.cpp.
Forms the upper and lower bounds.
- Parameters:
-
[in] | lb | array of lower bounds for z |
[in] | ub | array of upper bounds for z |
Definition at line 149 of file qp_as.cpp.
void qp_as::form_iHg |
( |
const double * |
zref_x, |
|
|
const double * |
zref_y |
|
) |
| [private] |
Forms inv(2*H) * g.
- Parameters:
-
[in] | zref_x | reference values of z_x |
[in] | zref_y | reference values of z_y |
Definition at line 121 of file qp_as.cpp.
void qp_as::set_parameters |
( |
const double * |
T_, |
|
|
const double * |
h_, |
|
|
const double |
h_initial_, |
|
|
const double * |
angle, |
|
|
const double * |
zref_x, |
|
|
const double * |
zref_y, |
|
|
const double * |
lb, |
|
|
const double * |
ub |
|
) |
| [virtual] |
Initializes quadratic problem.
- Parameters:
-
[in] | T_ | Sampling time (for the moment it is assumed to be constant) [sec.] |
[in] | h_ | Height of the Center of Mass divided by gravity |
[in] | h_initial_ | current h |
[in] | angle | Rotation angle for each state in the preview window |
[in] | zref_x | reference values of z_x |
[in] | zref_y | reference values of z_y |
[in] | lb | array of lower bounds for z_x and z_y |
[in] | ub | array of upper bounds for z_x and z_y |
Implements qp_solver.
Definition at line 95 of file qp_as.cpp.
Solve QP problem.
- Returns:
- number of activated constraints
Implements qp_solver.
Definition at line 261 of file qp_as.cpp.
Member Data Documentation
Vector of bounds.
Definition at line 123 of file qp_as.h.
Number of inequality constraints already included in W. W(nW-1) is the index of the last inequality constraint added to W.
Definition at line 120 of file qp_as.h.
Working set (contains the indexes of only inequality constraints). It is assumed that the only inequality constraints are simple bounds. See also 'Implementing bounds'.
Definition at line 109 of file qp_as.h.
Since we do not distinguish lower/upper bounds of active constraints (<= and => inequlities are treated in the same way), we have to adjust signs of lagrange multipliers before downdate. See also 'Implementing bounds'.
Definition at line 116 of file qp_as.h.
The documentation for this class was generated from the following files: