Skip to content

Commit

Permalink
Infer solvers that require sparse inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
stephane-caron authored and Stéphane Caron committed Apr 3, 2023
1 parent ee6634c commit 3b994dd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion qpsolvers_benchmark/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,10 @@ def time_solve_problem(
to compute it.
"""
# Don't time matrix conversions for solvers that require sparse inputs
if solver in ["highs", "osqp", "scs"]:
if (
solver in qpsolvers.sparse_solvers
and solver not in qpsolvers.dense_solvers
):
problem = problem.to_sparse()
start_time = perf_counter()
try:
Expand Down

0 comments on commit 3b994dd

Please sign in to comment.