A sparse MPC solver for walking motion generation (old version).
solver/qp_ip.h
Go to the documentation of this file.
00001 
00009 #ifndef QPIP_H
00010 #define QPIP_H
00011 
00012 /****************************************
00013  * INCLUDES 
00014  ****************************************/
00015 #include "smpc_common.h"
00016 #include "qp_solver.h"
00017 #include "chol_solve_ip.h"
00018 
00019 #include <vector>
00020 
00021 
00022 /****************************************
00023  * Defines
00024  ****************************************/
00025 
00026 
00027 using namespace std;
00028 
00031 
00036 class qp_ip : public qp_solver
00037 {
00038     public:
00039 // functions        
00040         qp_ip(
00041                 const int N_, 
00042                 const double, 
00043                 const double, 
00044                 const double,
00045                 const double,
00046                 const double);
00047         ~qp_ip();
00048 
00049         void set_parameters(
00050                 const double*, 
00051                 const double*, 
00052                 const double, 
00053                 const double*, 
00054                 const double*, 
00055                 const double*, 
00056                 const double*, 
00057                 const double*);
00058 
00059 
00060         void set_ip_parameters (
00061                 const double, 
00062                 const double, 
00063                 const double, 
00064                 const double, 
00065                 const int,
00066                 const double);
00067         int solve();
00068 
00069 
00070     private:
00072         double *g;
00073 
00076         double *i2hess;
00077 
00079         double *i2hess_grad;
00080 
00082         double *grad;
00083 
00085         double phi_X; 
00086 
00087 
00090         double Q[3];
00091         double P;
00093         
00094 
00096         chol_solve_ip chol;
00097 
00098 
00101         const double *lb;
00102         const double *ub;
00104         
00105 // IP parameters
00106         double t; 
00107         double mu; 
00108         double bs_alpha; 
00109         double bs_beta; 
00110         int max_iter; 
00111         double tol_out; 
00112 
00113 
00114 // functions        
00115         void init_alpha();
00116         double form_bs_alpha_grad_dX ();
00117         double form_phi_X_tmp (const double);
00118         bool solve_onestep (const double);
00119         void form_g (const double *, const double *);
00120         void form_grad_i2hess_logbar (const double);
00121         void form_i2hess_grad ();
00122         void form_phi_X ();
00123 };
00124 
00126 #endif /*QPIP_H*/