Skip to content

Commit

Permalink
give reg a meaning
Browse files Browse the repository at this point in the history
  • Loading branch information
ManifoldFR committed Aug 13, 2024
1 parent 24206cd commit 488b874
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/python/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import scipy.sparse as spa


def generate_mixed_qp(n, seed=1, reg=-2.0, dens1=0.075):
def generate_mixed_qp(n, seed=1, reg=1e-2, dens1=0.075):
# A function for generating sparse random convex qps in dense format

np.random.seed(seed)
Expand All @@ -16,7 +16,7 @@ def generate_mixed_qp(n, seed=1, reg=-2.0, dens1=0.075):
P = (P + P.T) / 2.0

s = max(np.absolute(np.linalg.eigvals(P)))
P += (abs(s) + 1e-02) * spa.eye(n)
P += (abs(s) + reg) * 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()
Expand Down

0 comments on commit 488b874

Please sign in to comment.