Skip to content

Commit

Permalink
[examples/python] fix toarray() for C order
Browse files Browse the repository at this point in the history
  • Loading branch information
ManifoldFR committed Aug 7, 2024
1 parent ddef301 commit 62b9ea4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion examples/python/solve_without_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def generate_mixed_qp(n, seed=1):
# solve the problem using the dense backend

results2 = proxsuite.proxqp.dense.solve(
H.toarray(), g, A.toarray(), b, C.toarray(), l, u
H.toarray(order="C"), g, A.toarray(order="C"), b, C.toarray(order="C"), l, u
)
# Note finally, that the matrices are in sparse format, when using the dense backend you
# should convert them in dense format
Expand Down
4 changes: 3 additions & 1 deletion examples/python/solve_without_api_and_option.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ def generate_mixed_qp(n, seed=1):
P += (abs(s) + 1e-02) * spa.eye(n)
P = spa.coo_matrix(P)
q = np.random.randn(n)
A = spa.random(m, n, density=0.15, data_rvs=np.random.randn, format="csc").toarray()
A = spa.random(m, n, density=0.15, data_rvs=np.random.randn, format="csc").toarray(
order="C"
)
v = np.random.randn(n) # Fictitious solution
delta = np.random.rand(m) # To get inequality
u = A @ v
Expand Down

0 comments on commit 62b9ea4

Please sign in to comment.