Skip to content

Commit f7c8638

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent ae2ae08 commit f7c8638

20 files changed

+4063
-2386
lines changed

examples/cpp/init_dense_qp.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ main()
1616
dense::Model<T> qp_random = utils::dense_strongly_convex_qp(
1717
dim, n_eq, n_in, sparsity_factor, strong_convexity_factor);
1818

19-
dense::QP<T> qp(dim, n_eq, n_in); // create the QP object
20-
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
19+
dense::QP<T> qp(dim, n_eq, n_in); // create the QP object
20+
qp.init(qp_random.H,
21+
qp_random.g,
22+
qp_random.A,
23+
qp_random.b,
24+
qp_random.C,
25+
qp_random.u,
26+
qp_random.l); // initialize the model
2127
}

examples/cpp/init_dense_qp_with_other_options.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,15 @@ main()
1818
dense::QP<T> qp(
1919
dim, n_eq, n_in); // create the QP
2020
// initialize the model, along with another rho parameter
21-
qp.init(qp_random.H, qp_random.g, qp_random.A, qp_random.b, qp_random.C, qp_random.u, qp_random.l, true, /*rho*/ 1.e-7);
21+
qp.init(qp_random.H,
22+
qp_random.g,
23+
qp_random.A,
24+
qp_random.b,
25+
qp_random.C,
26+
qp_random.u,
27+
qp_random.l,
28+
true,
29+
/*rho*/ 1.e-7);
2230
// in c++ you must follow the order speficied in the API for the parameters
2331
// if you don't want to change one parameter (here compute_preconditioner),
2432
// just let it be std::nullopt

examples/cpp/init_dense_qp_with_timings.cpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,13 @@ main()
1515
dense::Model<T> qp_random = utils::dense_strongly_convex_qp(
1616
dim, n_eq, n_in, sparsity_factor, strong_convexity_factor);
1717

18-
dense::QP<T> qp(dim, n_eq, n_in); // create the QP object
19-
qp.settings.compute_timings = true; // compute all timings
20-
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
18+
dense::QP<T> qp(dim, n_eq, n_in); // create the QP object
19+
qp.settings.compute_timings = true; // compute all timings
20+
qp.init(qp_random.H,
21+
qp_random.g,
22+
qp_random.A,
23+
qp_random.b,
24+
qp_random.C,
25+
qp_random.u,
26+
qp_random.l); // initialize the model
2127
}

examples/cpp/overview-simple.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,13 @@ main()
2121

2222
// load PROXQP solver with dense backend and solve the problem
2323
dense::QP<T> qp(dim, n_eq, n_in);
24-
qp.init(qp_random.H, qp_random.g, qp_random.A, qp_random.b, qp_random.C, qp_random.u, qp_random.l);
24+
qp.init(qp_random.H,
25+
qp_random.g,
26+
qp_random.A,
27+
qp_random.b,
28+
qp_random.C,
29+
qp_random.u,
30+
qp_random.l);
2531
qp.solve();
2632
// print an optimal solution x,y and z
2733
std::cout << "optimal x: " << qp.results.x << std::endl;

examples/cpp/solve_dense_qp.cpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,15 @@ main()
1717
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_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
20+
dense::QP<T> qp(dim, n_eq, n_in); // create the QP object
21+
qp.init(qp_random.H,
22+
qp_random.g,
23+
qp_random.A,
24+
qp_random.b,
25+
qp_random.C,
26+
qp_random.u,
27+
qp_random.l); // initialize the model
28+
qp.solve(); // solve the problem without warm start
2329
auto x_wm = utils::rand::vector_rand<T>(dim);
2430
auto y_wm = utils::rand::vector_rand<T>(n_eq);
2531
auto z_wm = utils::rand::vector_rand<T>(n_in);

examples/cpp/solve_dense_qp_with_setting.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,14 @@ main()
1616
dense::Model<T> qp_random = utils::dense_strongly_convex_qp(
1717
dim, n_eq, n_in, sparsity_factor, strong_convexity_factor);
1818

19-
dense::QP<T> qp(dim, n_eq, n_in); // create the QP object
20-
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
19+
dense::QP<T> qp(dim, n_eq, n_in); // create the QP object
20+
qp.init(qp_random.H,
21+
qp_random.g,
22+
qp_random.A,
23+
qp_random.b,
24+
qp_random.C,
25+
qp_random.u,
26+
qp_random.l); // initialize the model
2127
qp.settings.eps_abs = T(1.E-9); // set accuracy threshold to 1.e-9
2228
qp.settings.verbose = true; // print some intermediary results
2329
qp.solve(); // solve the problem with previous settings

examples/cpp/update_dense_qp.cpp

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,16 @@ main()
1616
dense::Model<T> qp_random = utils::dense_strongly_convex_qp(
1717
dim, n_eq, n_in, sparsity_factor, strong_convexity_factor);
1818

19-
dense::QP<T> qp(dim, n_eq, n_in); // create the QP object
20-
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
21-
qp.solve(); // solve the problem
22-
// a new qp problem
19+
dense::QP<T> qp(dim, n_eq, n_in); // create the QP object
20+
qp.init(qp_random.H,
21+
qp_random.g,
22+
qp_random.A,
23+
qp_random.b,
24+
qp_random.C,
25+
qp_random.u,
26+
qp_random.l); // initialize the model
27+
qp.solve(); // solve the problem
28+
// a new qp problem
2329
dense::Model<T> qp2 = utils::dense_strongly_convex_qp(
2430
dim, n_eq, n_in, sparsity_factor, strong_convexity_factor);
2531
// re update the model

examples/cpp/update_dense_qp_ws_previous_result.cpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,15 @@ main()
1616
dense::Model<T> qp_random = utils::dense_strongly_convex_qp(
1717
dim, n_eq, n_in, sparsity_factor, strong_convexity_factor);
1818

19-
dense::QP<T> qp(dim, n_eq, n_in); // create the QP object
20-
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
21-
qp.solve(); // solve the problem
19+
dense::QP<T> qp(dim, n_eq, n_in); // create the QP object
20+
qp.init(qp_random.H,
21+
qp_random.g,
22+
qp_random.A,
23+
qp_random.b,
24+
qp_random.C,
25+
qp_random.u,
26+
qp_random.l); // initialize the model
27+
qp.solve(); // solve the problem
2228
// re update the linear cost taking previous result
2329
qp.settings.initial_guess =
2430
InitialGuessStatus::WARM_START_WITH_PREVIOUS_RESULT;

include/proxsuite/proxqp/dense/solver.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -800,8 +800,9 @@ qp_solve( //
800800
}
801801
case InitialGuessStatus::WARM_START: {
802802
qpwork.cleanup();
803-
qpresults.cold_start(qpsettings); // because there was already a solve,
804-
// precond was already computed if set so
803+
qpresults.cold_start(
804+
qpsettings); // because there was already a solve,
805+
// precond was already computed if set so
805806
ruiz.scale_primal_in_place(
806807
{ proxsuite::proxqp::from_eigen,
807808
qpresults

include/proxsuite/proxqp/dense/wrapper.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -635,8 +635,7 @@ struct QP
635635
*/
636636
void cleanup()
637637
{
638-
results.cleanup(
639-
settings);
638+
results.cleanup(settings);
640639
work.cleanup();
641640
}
642641
};

0 commit comments

Comments
 (0)