Skip to content

Commit 8714247

Browse files
pre-commit-ci[bot]jcarpent
authored andcommitted
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 0e24d27 commit 8714247

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

doc/3-ProxQP_solve.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ $$\begin{equation}\label{eq:approx_qp_sol_relative_criterion}
6565

6666
\section OverviewAsingleSolveFunction A single solve function for dense and sparse backends
6767

68-
If if you don't want to pass through [ProxQP API](2-ProxQP_api.md), it is also possible to use one single solve function. We will show how to do so with examples.
68+
If if you don't want to pass through [ProxQP API](2-ProxQP_api.md), it is also possible to use one single solve function. We will show how to do so with examples.
6969

7070
You just need to call a "solve" function with in entry the model of the convex QP you want to solve. We show you below examples in C++ and python for ProxQP sparse and dense backends. Note that the sparse and dense solvers take respectivaly entries in sparse and dense formats.
7171

examples/cpp/solve_without_api.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ main()
3232
std::cout << "optimal z from sparse solver: " << results_sparse_solver.z
3333
<< std::endl;
3434
// Solve the problem using the dense backend
35-
Results<T> results_dense_solver = dense::solve<T>(dense::Mat<T>(H), g,dense::Mat<T>(A), b,dense::Mat<T>(C), u, l);
35+
Results<T> results_dense_solver = dense::solve<T>(
36+
dense::Mat<T>(H), g, dense::Mat<T>(A), b, dense::Mat<T>(C), u, l);
3637
// print an optimal solution x,y and z
3738
std::cout << "optimal x from dense solver: " << results_dense_solver.x
3839
<< std::endl;

examples/python/solve_without_api.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ def generate_mixed_qp(n, seed=1):
4040

4141
# solve the problem using the dense backend
4242

43-
results2 = proxsuite.proxqp.dense.solve(H.toarray(), g, A.toarray(), b, C.toarray(), u, l)
43+
results2 = proxsuite.proxqp.dense.solve(
44+
H.toarray(), g, A.toarray(), b, C.toarray(), u, l
45+
)
4446
# Note finally, that the matrices are in sparse format, when using the dense backend you
4547
# should convert them in dense format
4648

test/src/dense_qp_wrapper.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3276,7 +3276,9 @@ def test_case_update_A_for_different_initial_guess(self):
32763276
True,
32773277
)
32783278
qp.solve()
3279-
A = spa.random(n_eq, n, density=0.15, data_rvs=np.random.randn, format="csc").toarray()
3279+
A = spa.random(
3280+
n_eq, n, density=0.15, data_rvs=np.random.randn, format="csc"
3281+
).toarray()
32803282
dua_res = normInf(
32813283
H @ qp.results.x
32823284
+ g

0 commit comments

Comments
 (0)