Skip to content

Commit

Permalink
added OSQP_scaling variable in python
Browse files Browse the repository at this point in the history
  • Loading branch information
ajordana committed Aug 19, 2024
1 parent 5ee535f commit 70e732b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions python/qp_solvers/qpsolvers.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def __init__(self, shootingProblem, method, verboseQP = True):
self.verboseQP = verboseQP
self.eps_abs = 1e-4
self.eps_rel = 0.
self.OSQP_scaling = False

self.BENCHMARK = True
self.DEBUG = False
Expand Down Expand Up @@ -226,8 +227,8 @@ def computeDirectionFullQP(self):
print("nnz(P) = ", P.count_nonzero(), " out of ", NNZ_block_P, " = ", 100* P.count_nonzero() / NNZ_block_P)
print("nnz(A) = ", Aosqp.count_nonzero(), " out of ", NNZ_block_A, " = ", 100* Aosqp.count_nonzero() / NNZ_block_A)
prob = osqp.OSQP()
prob.setup(P, q, Aosqp, losqp, uosqp, warm_start=False, scaling=False, max_iter = self.max_qp_iters, \
adaptive_rho=True, verbose = self.verboseQP, eps_rel=self.eps_rel, eps_abs=self.eps_abs)
prob.setup(P, q, Aosqp, losqp, uosqp, warm_start=False, scaling=self.OSQP_scaling, max_iter = self.max_qp_iters, \
adaptive_rho=True, verbose = self.verboseQP, eps_rel=self.eps_rel, eps_abs=self.eps_abs)
t1 = time.time()
tmp = prob.solve()
self.qp_time = time.time() - t1
Expand Down

0 comments on commit 70e732b

Please sign in to comment.