A sparse MPC solver for walking motion generation.
qp_as.h
Go to the documentation of this file.
1 
9 #ifndef QPAS_H
10 #define QPAS_H
11 
12 /****************************************
13  * INCLUDES
14  ****************************************/
15 #include "smpc_common.h"
16 #include "as_chol_solve.h"
17 #include "as_constraint.h"
18 #include "as_problem_param.h"
19 
20 #include <vector>
21 
22 
23 /****************************************
24  * Defines
25  ****************************************/
26 
27 
28 using namespace std;
29 
32 
38 {
39  public:
40 // functions
41  qp_as(
42  const int N_,
43  const double,
44  const double,
45  const double,
46  const double,
47  const double,
48  const bool,
49  const unsigned int,
50  const bool);
51  ~qp_as();
52 
53  void set_parameters(
54  const double*,
55  const double*,
56  const double,
57  const double*,
58  const double*,
59  const double*,
60  const double*,
61  const double*);
62 
63 
64  void solve (vector<double> &);
65  void form_init_fp (
66  const double *,
67  const double *,
68  const double *,
69  const bool,
70  double *);
71 
72 
76  double *X;
77 
78 
79  // counters
80  unsigned int added_constraints_num;
82  unsigned int active_set_size;
83  // limits
86 
87 
88  private:
89 
90 // functions
91  int check_blocking_constraints();
92  int choose_excl_constr (const double *);
93  double compute_obj();
94 
95 // variables
96 
99 
100 
101  const double *zref_x;
102  const double *zref_y;
103 
105  double tol;
106 
108 
109  // active set
111  vector <AS::constraint> active_set;
112 
114  vector <AS::constraint> constraints;
115 
116 
117  // descent direction
119  double *dX;
120 
122  double alpha;
123 };
124 
126 #endif /*QPAS_H*/
const double * zref_y
Definition: qp_as.h:102
bool constraint_removal_on
Definition: qp_as.h:84
bool obj_computation_on
Definition: qp_as.h:107
vector< AS::constraint > active_set
A set of active constraints.
Definition: qp_as.h:111
const double * zref_x
Definition: qp_as.h:101
unsigned int max_added_constraints_num
Definition: qp_as.h:85
double * X
Definition: qp_as.h:76
unsigned int active_set_size
Definition: qp_as.h:82
A set of problem parameters.
Solve a quadratic program with a specific structure. qp_as = Quadratic Programming / Active Set.
Definition: qp_as.h:37
Solves KKT system using Cholesky decomposition.
Definition: as_chol_solve.h:37
double * dX
Definition: qp_as.h:119
unsigned int removed_constraints_num
Definition: qp_as.h:81
unsigned int added_constraints_num
Definition: qp_as.h:80
double alpha
Definition: qp_as.h:122
AS::chol_solve chol
An instance of AS::chol_solve class.
Definition: qp_as.h:98
vector< AS::constraint > constraints
Vector of constraints.
Definition: qp_as.h:114
double tol
tolerance
Definition: qp_as.h:105