|
1 | 1 | #include <proxsuite/proxqp/dense/dense.hpp> // load the dense solver backend
|
2 | 2 | #include <proxsuite/common/utils/random_qp_problems.hpp> // used for generating a random convex Qp
|
3 | 3 |
|
4 |
| -using namespace proxsuite::proxqp; |
| 4 | +using namespace proxsuite; |
5 | 5 | using T = double;
|
6 | 6 |
|
7 | 7 | int
|
8 | 8 | main()
|
9 | 9 | {
|
10 |
| - isize dim = 10; |
11 |
| - isize n_eq(dim / 4); |
12 |
| - isize n_in(dim / 4); |
| 10 | + common::isize dim = 10; |
| 11 | + common::isize n_eq(dim / 4); |
| 12 | + common::isize n_in(dim / 4); |
13 | 13 | // generate a random qp
|
14 | 14 | T sparsity_factor(0.15);
|
15 | 15 | T strong_convexity_factor(1.e-2);
|
16 | 16 |
|
17 |
| - dense::Model<T> qp = utils::dense_strongly_convex_qp( |
| 17 | + common::dense::Model<T> qp = common::utils::dense_strongly_convex_qp( |
18 | 18 | dim, n_eq, n_in, sparsity_factor, strong_convexity_factor);
|
19 | 19 |
|
20 |
| - dense::QP<T> Qp(dim, n_eq, n_in); // create the QP object |
| 20 | + proxqp::dense::QP<T> Qp(dim, n_eq, n_in); // create the QP object |
21 | 21 | Qp.init(qp.H, qp.g, qp.A, qp.b, qp.C, qp.l, qp.u); // initialize the model
|
22 | 22 | Qp.solve(); // solve the problem without warm start
|
23 | 23 |
|
24 |
| - auto x_wm = utils::rand::vector_rand<T>(dim); |
25 |
| - auto y_wm = utils::rand::vector_rand<T>(n_eq); |
26 |
| - auto z_wm = utils::rand::vector_rand<T>(n_in); |
| 24 | + auto x_wm = common::utils::rand::vector_rand<T>(dim); |
| 25 | + auto y_wm = common::utils::rand::vector_rand<T>(n_eq); |
| 26 | + auto z_wm = common::utils::rand::vector_rand<T>(n_in); |
27 | 27 | Qp.solve(x_wm, y_wm,
|
28 | 28 | z_wm); // if you have a warm start, put it here
|
29 | 29 |
|
|
0 commit comments