11#include < proxsuite/proxqp/dense/dense.hpp> // load the dense solver backend
2- #include < proxsuite/proxqp/utils/random_qp_problems.hpp> // used for generating a random convex Qp
2+ #include < proxsuite/proxqp/utils/random_qp_problems.hpp> // used for generating a random convex qp
33
44using namespace proxsuite ::proxqp;
55using T = double ;
@@ -14,19 +14,19 @@ main()
1414 T sparsity_factor (0.15 );
1515 T strong_convexity_factor (1 .e -2 );
1616
17- dense::Model<T> qp = utils::dense_strongly_convex_qp (
17+ dense::Model<T> qp_random = utils::dense_strongly_convex_qp (
1818 dim, n_eq, n_in, sparsity_factor, strong_convexity_factor);
1919
20- dense::QP<T> Qp (dim, n_eq, n_in); // create the QP object
21- Qp .init (qp .H , qp .g , qp .A , qp .b , qp .C , qp .u , qp .l ); // initialize the model
22- Qp .solve (); // solve the problem without warm start
20+ dense::QP<T> qp (dim, n_eq, n_in); // create the QP object
21+ qp .init (qp_random .H , qp_random .g , qp_random .A , qp_random .b , qp_random .C , qp_random .u , qp_random .l ); // initialize the model
22+ qp .solve (); // solve the problem without warm start
2323 auto x_wm = utils::rand::vector_rand<T>(dim);
2424 auto y_wm = utils::rand::vector_rand<T>(n_eq);
2525 auto z_wm = utils::rand::vector_rand<T>(n_in);
26- Qp .solve (x_wm, y_wm,
26+ qp .solve (x_wm, y_wm,
2727 z_wm); // if you have a warm start, put it here
2828 // print an optimal solution x,y and z
29- std::cout << " optimal x: " << Qp .results .x << std::endl;
30- std::cout << " optimal y: " << Qp .results .y << std::endl;
31- std::cout << " optimal z: " << Qp .results .z << std::endl;
29+ std::cout << " optimal x: " << qp .results .x << std::endl;
30+ std::cout << " optimal y: " << qp .results .y << std::endl;
31+ std::cout << " optimal z: " << qp .results .z << std::endl;
3232}
0 commit comments