generate_problem.py 421 B

123456789101112131415
  1. import numpy as np
  2. from scipy import sparse
  3. import utils.codegen_utils as cu
  4. P = sparse.triu([[2., 5.], [5., 1.]], format='csc')
  5. q = np.array([3., 4.])
  6. A = sparse.csc_matrix([[-1., 0.], [0., -1.], [-1., 3.], [2., 5.], [3., 4]])
  7. l = -np.inf * np.ones(A.shape[0])
  8. u = np.array([0., 0., -15., 100., 80.])
  9. sols_data = {'sigma_new': 5}
  10. # Generate problem data
  11. cu.generate_problem_data(P, q, A, l, u, 'non_cvx', sols_data)