Commit 64c5ca9f by roangel

### First draft of trying to shape the problem as gurobi input in C

parent 8af6f3dc
 ... ... @@ -306,6 +306,45 @@ VectorUtype mympc_varying_another(std::vector A_tray, std::vector q_row; std::vector q_col; std::vector q_val; std::vector l_obj_ind; std::vector l_obj_coeff; for(int i = 0; i < size_H; i++) { for(int j = i; j < size_H; j++) { std::cout << "i,j -->" << i << "," << j << std::endl; if(H(i,j) != 0) { q_row.push_back(i); q_col.push_back(j); if(i == j) { q_val.push_back(H(i,j)); std::cout << "H(i,j)" << H(i,j) << endl; } else { q_val.push_back(2*H(i,j)); std::cout << "2H(i,j)" << 2*H(i,j) << endl; } } } if(F(i) != 0) { l_obj_ind.push_back(i); l_obj_coeff.push_back(F(i)); } } // Eigen::IOFormat CleanFmt(4, 0, ", ", "\n", "[", "]"); ... ... @@ -315,17 +354,19 @@ VectorUtype mympc_varying_another(std::vector A_tray, std::vector A_tray, std::vector= 1 */ // /* Second constraint: x + y >= 1 */ ind[0] = 0; ind[1] = 1; val[0] = 1; val[1] = 1; // ind[0] = 0; ind[1] = 1; // val[0] = 1; val[1] = 1; error = GRBaddconstr(model, 2, ind, val, GRB_GREATER_EQUAL, 1.0, "c1"); if (error) goto QUIT; // error = GRBaddconstr(model, 2, ind, val, GRB_GREATER_EQUAL, 1.0, "c1"); // if (error) goto QUIT; /* Optimize model */ ... ... @@ -393,14 +437,16 @@ VectorUtype mympc_varying_another(std::vector A_tray, std::vector A_tray, std::vector
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment