Skip to content

Commit b002937

Browse files
🤖 Format .jl files (#86)
Co-authored-by: geoffroyleconte <[email protected]>
1 parent c83e166 commit b002937

File tree

4 files changed

+7
-9
lines changed

4 files changed

+7
-9
lines changed

src/presolve/postsolve_utils.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ function restore_ifix!(kept_cols, xps, x, xout)
22
# put x and xps inside xout according to kept_cols
33
nvar = length(xout)
44
cx = 0
5-
for i=1:nvar
5+
for i = 1:nvar
66
if kept_cols[i]
77
cx += 1
88
xout[i] = x[cx]
@@ -33,7 +33,7 @@ function restore_ilow_iupp!(ilow, iupp, kept_cols)
3333
for i = 1:nvar
3434
if kept_cols[i] == false
3535
offset += 1
36-
end
36+
end
3737
if c_low nlow && ilow[c_low] + offset == i
3838
ilow[c_low] += 1
3939
c_low += 1

src/presolve/presolve_utils.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ function update_kept_v!(kept_v::Vector{Bool}, vec_to_rm::Vector{Int}, n::Int)
2525
end
2626
end
2727
end
28-
end
28+
end

src/presolve/unconstrained_reductions.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ function unconstrained_reductions!(
2222
# check diagonal H or
2323
idx_deb = findfirst(isequal(var), Hcols)
2424
if idx_deb === nothing
25-
if c[var] < zero(T)
25+
if c[var] < zero(T)
2626
xps[var] = uvar[var]
2727
lvar[var] = uvar[var]
2828
else
2929
xps[var] = lvar[var]
3030
uvar[var] = lvar[var]
3131
end
32-
xps[var] == -T(Inf) && (unbounded = true)
32+
xps[var] == -T(Inf) && (unbounded = true)
3333
else
3434
continue
3535
# todo : QP
@@ -41,4 +41,4 @@ function unconstrained_reductions!(
4141
end
4242

4343
return unbounded
44-
end
44+
end

test/test_presolve.jl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,7 @@
3434
6.0 1.0
3535
1.0 4.0
3636
]
37-
Aps_true = [
38-
1.0 1.0
39-
]
37+
Aps_true = [1.0 1.0]
4038
lvarps_true, uvarps_true = [0.0; 0.0], [Inf; Inf]
4139

4240
@test psqp.data.c == [-4.0; 1.0]

0 commit comments

Comments
 (0)