Skip to content

Commit 1c221eb

Browse files
format code
1 parent 246a3fb commit 1c221eb

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

src/update_parameters.jl

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -307,18 +307,21 @@ function update_parameter_in_quadratic_constraints_pv!(model::Optimizer)
307307
end
308308
end
309309
old_ci = model.quadratic_added_cache[ci]
310-
changes = Vector{MOI.ScalarCoefficientChange}(undef, length(new_coeff_per_variable))
310+
changes = Vector{MOI.ScalarCoefficientChange}(
311+
undef,
312+
length(new_coeff_per_variable),
313+
)
311314
i = 1
312315
for (vi, value) in new_coeff_per_variable
313316
changes[i] = MOI.ScalarCoefficientChange(vi, value)
314317
i += 1
315318
end
316319
# Make multiple changes at once.
317320
MOI.modify(
318-
model.optimizer,
319-
fill(old_ci, length(new_coeff_per_variable)),
320-
changes,
321-
)
321+
model.optimizer,
322+
fill(old_ci, length(new_coeff_per_variable)),
323+
changes,
324+
)
322325
end
323326
return model
324327
end
@@ -352,17 +355,16 @@ function update_parameter_in_quadratic_objective_pv!(model::Optimizer)
352355
end
353356

354357
F_pv = MOI.get(model.optimizer, MOI.ObjectiveFunctionType())
355-
changes = Vector{MOI.ScalarCoefficientChange}(undef, length(new_coeff_per_variable))
358+
changes = Vector{MOI.ScalarCoefficientChange}(
359+
undef,
360+
length(new_coeff_per_variable),
361+
)
356362
i = 1
357363
for (vi, value) in new_coeff_per_variable
358364
changes[i] = MOI.ScalarCoefficientChange(vi, value)
359365
i += 1
360366
end
361-
MOI.modify(
362-
model.optimizer,
363-
MOI.ObjectiveFunction{F_pv}(),
364-
changes,
365-
)
367+
MOI.modify(model.optimizer, MOI.ObjectiveFunction{F_pv}(), changes)
366368
return model
367369
end
368370

test/modifications_tests.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,4 @@
5858
MOI.ObjectiveFunction{MOI.ScalarAffineFunction{Float64}}(),
5959
)
6060
@test MOI.coefficient.(obj.terms) == [4.0, 10.0, 2.0]
61-
end
61+
end

0 commit comments

Comments
 (0)