A sparse MPC solver for walking motion generation (old version).
|
00001 00009 #ifndef QPAS_H 00010 #define QPAS_H 00011 00012 /**************************************** 00013 * INCLUDES 00014 ****************************************/ 00015 #include "smpc_common.h" 00016 #include "chol_solve_as.h" 00017 #include "qp_solver.h" 00018 00019 #include <vector> 00020 00021 00022 /**************************************** 00023 * Defines 00024 ****************************************/ 00025 00026 00027 using namespace std; 00028 00031 00033 class bound 00034 { 00035 public: 00036 void set (const int, const double, const double, const bool); 00037 00038 00040 int var_num; 00041 00043 double lb; 00044 00046 double ub; 00047 00052 bool isActive; 00053 }; 00054 00055 00056 00057 00062 class qp_as : public qp_solver 00063 { 00064 public: 00065 // functions 00066 qp_as( 00067 const int N_, 00068 const double, 00069 const double, 00070 const double, 00071 const double, 00072 const double); 00073 ~qp_as(); 00074 00075 void set_parameters( 00076 const double*, 00077 const double*, 00078 const double, 00079 const double*, 00080 const double*, 00081 const double*, 00082 const double*, 00083 const double*); 00084 00085 00086 int solve (); 00087 00088 00089 private: 00090 00091 // functions 00092 void form_iHg(const double *, const double *); 00093 void form_bounds(const double *, const double *); 00094 int check_blocking_bounds(); 00095 00096 int choose_excl_constr (const double *); 00097 00099 chol_solve_as chol; 00100 00101 00103 double *iHg; 00104 00105 00106 // active set 00109 int *W; 00110 00116 int *W_sign; 00117 00120 int nW; 00121 00123 std::vector <bound> Bounds; 00124 }; 00125 00127 #endif /*QPAS_H*/