Skip to content

Commit

Permalink
[examples/julia] fix ordering
Browse files Browse the repository at this point in the history
  • Loading branch information
ManifoldFR committed Aug 8, 2024
1 parent 453324e commit 66c4951
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions examples/julia/overview-simple.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,20 @@ function generate_mixed_qp(n, seed=1)

P = spa.random(
n, n, density=0.85, data_rvs=np.random.randn, format="csc"
).toarray()
).toarray(order="C")
P = (P + np.transpose(P)) / 2.0

s = np.max(np.absolute(np.linalg.eigvals(P)))
P += (np.abs(s) + 1e-02) * spa.eye(n)
P = spa.coo_matrix(P)
P = spa.coo_matrix(P).toarray(order="C")
q = np.random.randn(n)
A = spa.random(m, n, density=0.85, data_rvs=np.random.randn, format="csc")
A = spa.random(m, n, density=0.85, 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
l = -1.0e20 * np.ones(m)

return P.toarray(), q, get(A, slice(0, n_eq)), get(u, slice(0, n_eq)), get(A, slice(n_in, m)), get(u, slice(n_in, m, )), l[n_in+1:end]
return P, q, get(A, slice(0, n_eq)), get(u, slice(0, n_eq)), get(A, slice(n_in, m)), get(u, slice(n_in, m, )), l[n_in+1:end]
end

# generate a qp problem
Expand Down

0 comments on commit 66c4951

Please sign in to comment.