@@ -70,6 +70,8 @@ include("empty_rows.jl")
70
70
include (" singleton_rows.jl" )
71
71
include (" unconstrained_reductions.jl" )
72
72
include (" linear_singleton_columns.jl" )
73
+ include (" primal_constraints.jl" )
74
+ include (" free_rows.jl" )
73
75
include (" postsolve_utils.jl" )
74
76
75
77
mutable struct PresolvedData{T, S}
@@ -210,6 +212,23 @@ function presolve(
210
212
kept_cols,
211
213
)
212
214
215
+ infeasible_cst = primal_constraints! (
216
+ operations,
217
+ arows,
218
+ lcon,
219
+ ucon,
220
+ lvar,
221
+ uvar,
222
+ nvar,
223
+ ncon,
224
+ kept_rows,
225
+ kept_cols,
226
+ row_cnt,
227
+ col_cnt,
228
+ )
229
+
230
+ free_rows_pass = free_rows! (operations, lcon, ucon, ncon, row_cnt, kept_rows)
231
+
213
232
psdata. c0, ifix_pass = remove_ifix! (
214
233
operations,
215
234
hcols,
@@ -228,11 +247,11 @@ function presolve(
228
247
xps,
229
248
)
230
249
231
- infeasible = check_bounds (lvar, uvar, lcon, ucon, nvar, ncon, kept_rows, kept_cols)
250
+ infeasible_bnd = check_bounds (lvar, uvar, lcon, ucon, nvar, ncon, kept_rows, kept_cols)
232
251
233
- keep_iterating =
234
- ( empty_row_pass || singl_row_pass || ifix_pass || free_lsc_pass) &&
235
- ( ! unbounded || ! infeasible)
252
+ infeasible = infeasible_bnd || infeasible_cst
253
+ reduction_pass = empty_row_pass || singl_row_pass || ifix_pass || free_lsc_pass || free_rows_pass
254
+ keep_iterating = reduction_pass && ! unbounded && ! infeasible
236
255
keep_iterating && (nb_pass += 1 )
237
256
end
238
257
@@ -295,7 +314,8 @@ function presolve(
295
314
multipliers_U = s_u,
296
315
iter = 0 ,
297
316
elapsed_time = time () - start_time,
298
- solver_specific = Dict (:presolvedQM => nothing ),
317
+ solver_specific = Dict (:presolvedQM => nothing ,
318
+ :psoperations => operations),
299
319
)
300
320
else
301
321
psmeta = NLPModelMeta {T, S} (
@@ -319,7 +339,7 @@ function presolve(
319
339
ps,
320
340
iter = 0 ,
321
341
elapsed_time = time () - start_time,
322
- solver_specific = Dict (:presolvedQM => ps),
342
+ solver_specific = Dict (:presolvedQM => ps, :psoperations => operations ),
323
343
)
324
344
end
325
345
end
@@ -343,12 +363,12 @@ function postsolve!(
343
363
end
344
364
345
365
"""
346
- x, y, s_l, s_u = postsolve(qm::QuadraticModel{T, S}, psqm::PresolvedQuadraticModel{T, S},
347
- x_in::S, y_in::S,
348
- s_l_in::SparseVector{T, Int},
349
- s_u_in::SparseVector{T, Int}) where {T, S}
366
+ pt = postsolve(qm::QuadraticModel{T, S}, psqm::PresolvedQuadraticModel{T, S},
367
+ x_in::S, y_in::S,
368
+ s_l_in::SparseVector{T, Int},
369
+ s_u_in::SparseVector{T, Int}) where {T, S}
350
370
351
- Retrieve the solution `x, y, s_l, s_u` of the original QP `qm` given the solution of the presolved QP (`psqm`)
371
+ Retrieve the solution `( x, y, s_l, s_u) ` of the original QP `qm` given the solution of the presolved QP (`psqm`)
352
372
`x_in, y_in, s_l_in, s_u_in`.
353
373
"""
354
374
function postsolve (
0 commit comments