diff --git a/gcsopt/programs.py b/gcsopt/programs.py index ccc1e8b..77598c4 100644 --- a/gcsopt/programs.py +++ b/gcsopt/programs.py @@ -216,12 +216,12 @@ def to_conic(self): conic_program = ConicProgram(cp_conic.x.size, id_to_range, self.binary_variable) # Define cost of conic program. - cd = cp_conic.c.toarray().flatten() + cd = cp_conic.q.toarray().flatten() conic_program.add_cost(cd[:-1], cd[-1]) # Define constraints of conic program. Sparse matrices are converted to # dense arrays, since keeping them sparse seems to make things slower. - cols = cp_conic.c.shape[0] + cols = cp_conic.q.shape[0] Ab = cp_conic.A.toarray().reshape((-1, cols), order='F') K = [(type(c), c.size) for c in cp_conic.constraints] conic_program.add_constraints(Ab[:, :-1], Ab[:, -1], K) @@ -234,4 +234,4 @@ def solve(self, **kwargs): """ prob = cp.Problem(cp.Minimize(self.cost), self.constraints) prob.solve(**kwargs) - return prob.value \ No newline at end of file + return prob.value diff --git a/requirements.txt b/requirements.txt index 2030785..5de61e5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ numpy -cvxpy >=1.5, <=1.7.1 +cvxpy >=1.7.4 pytest \ No newline at end of file diff --git a/setup.py b/setup.py index 837f1cc..8475c61 100644 --- a/setup.py +++ b/setup.py @@ -15,7 +15,7 @@ packages=find_packages(), install_requires=[ "numpy", - "cvxpy >=1.5, <=1.7.1", + "cvxpy >=1.7.4", "pytest", ], )