Skip to content

Commit

Permalink
🤖 Format .jl files
Browse files Browse the repository at this point in the history
  • Loading branch information
dpo authored and geoffroyleconte committed Apr 23, 2022
1 parent bc6a817 commit 11903b6
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
22 changes: 11 additions & 11 deletions src/presolve/presolve.jl
Original file line number Diff line number Diff line change
Expand Up @@ -82,17 +82,17 @@ function presolve(
i_u = findall(s .< zero(T))
s_u = sparsevec(i_u, .-s[i_u])
return GenericExecutionStats(
feasible ? :first_order : :infeasible,
qm,
solution = xrm,
objective = obj(qm, xrm),
multipliers = zeros(T, qm.meta.nvar),
multipliers_L = s_l,
multipliers_U = s_u,
iter = 0,
elapsed_time = time() - start_time,
solver_specific = Dict(:presolvedQM => nothing),
)
feasible ? :first_order : :infeasible,
qm,
solution = xrm,
objective = obj(qm, xrm),
multipliers = zeros(T, qm.meta.nvar),
multipliers_L = s_l,
multipliers_U = s_u,
iter = 0,
elapsed_time = time() - start_time,
solver_specific = Dict(:presolvedQM => nothing),
)
else
psmeta = NLPModelMeta{T, S}(
nvarps,
Expand Down
8 changes: 7 additions & 1 deletion test/test_presolve.jl
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,13 @@
@test x_out == [4.0; 2.0; 7.0]

# test that solves the problem
qp2 = QuadraticModel(zeros(2), SparseMatrixCOO(zeros(2,2)), A = SparseMatrixCOO(zeros(0, 2)), lvar = zeros(2), uvar = zeros(2))
qp2 = QuadraticModel(
zeros(2),
SparseMatrixCOO(zeros(2, 2)),
A = SparseMatrixCOO(zeros(0, 2)),
lvar = zeros(2),
uvar = zeros(2),
)
stats_ps2 = presolve(qp2)
@test stats_ps2.status == :first_order
end

0 comments on commit 11903b6

Please sign in to comment.