Skip to content

Commit 10dbeb4

Browse files
committed
Fix format
1 parent d8f2ab1 commit 10dbeb4

File tree

3 files changed

+18
-28
lines changed

3 files changed

+18
-28
lines changed

src/Utilities/matrix_of_constraints.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ MOI.is_empty(v::MatrixOfConstraints) = MOI.is_empty(v.sets)
306306
function _reset_caches!(v::MatrixOfConstraints{T}) where {T}
307307
v.caches =
308308
[Tuple{_affine_function_type(T, S),S}[] for S in set_types(v.sets)]
309-
v.are_indices_mapped = [BitSet() for _ in eachindex(v.caches)]
309+
return v.are_indices_mapped = [BitSet() for _ in eachindex(v.caches)]
310310
end
311311

312312
function MOI.empty!(v::MatrixOfConstraints)

src/Utilities/sparse_matrix.jl

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -186,16 +186,10 @@ end
186186
_indexing(A::MutableSparseMatrixCSC) = A.indexing
187187
_indexing(::SparseArrays.SparseMatrixCSC) = OneBasedIndexing()
188188

189-
const _SparseMatrixCSC{Tv,Ti} = Union{
190-
MutableSparseMatrixCSC{Tv,Ti},
191-
SparseArrays.SparseMatrixCSC{Tv,Ti}
192-
}
189+
const _SparseMatrixCSC{Tv,Ti} =
190+
Union{MutableSparseMatrixCSC{Tv,Ti},SparseArrays.SparseMatrixCSC{Tv,Ti}}
193191

194-
function _first_in_column(
195-
A::_SparseMatrixCSC,
196-
row::Integer,
197-
col::Integer,
198-
)
192+
function _first_in_column(A::_SparseMatrixCSC, row::Integer, col::Integer)
199193
range = SparseArrays.nzrange(A, col)
200194
row = _shift(row, OneBasedIndexing(), _indexing(A))
201195
idx = searchsortedfirst(view(A.rowval, range), row)

test/Utilities/matrix_of_constraints.jl

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -714,15 +714,18 @@ function test_unsupported_constraint()
714714
return
715715
end
716716

717-
MOI.Utilities.@product_of_sets(
718-
_EqualTos,
719-
MOI.EqualTo{T},
720-
)
717+
MOI.Utilities.@product_of_sets(_EqualTos, MOI.EqualTo{T},)
721718

722-
function _equality_constraints(A::AbstractMatrix{T}, b::AbstractVector{T}) where {T}
719+
function _equality_constraints(
720+
A::AbstractMatrix{T},
721+
b::AbstractVector{T},
722+
) where {T}
723723
sets = _EqualTos{T}()
724724
for _ in eachindex(b)
725-
MOI.Utilities.add_set(sets, MOI.Utilities.set_index(sets, MOI.EqualTo{T}))
725+
MOI.Utilities.add_set(
726+
sets,
727+
MOI.Utilities.set_index(sets, MOI.EqualTo{T}),
728+
)
726729
end
727730
MOI.Utilities.final_touch(sets)
728731
constants = MOI.Utilities.Hyperrectangle(b, b)
@@ -731,7 +734,6 @@ function _equality_constraints(A::AbstractMatrix{T}, b::AbstractVector{T}) where
731734
return model
732735
end
733736

734-
735737
# Inspired from MatrixOfConstraints
736738
function test_lp_standard_form()
737739
s = """
@@ -760,10 +762,7 @@ function test_lp_standard_form()
760762
)
761763

762764
model = MOI.Utilities.Model{Float64}()
763-
MOI.copy_to(
764-
MOI.Bridges.Constraint.Scalarize{Float64}(model),
765-
form,
766-
)
765+
MOI.copy_to(MOI.Bridges.Constraint.Scalarize{Float64}(model), form)
767766
MOI.set(
768767
model,
769768
MOI.VariableName(),
@@ -776,16 +775,13 @@ function test_lp_standard_form()
776775
MOI.ConstraintIndex{
777776
MOI.ScalarAffineFunction{Float64},
778777
MOI.EqualTo{Float64},
779-
}.(eachindex(con_names)),
778+
}.(
779+
eachindex(con_names),
780+
),
780781
con_names,
781782
)
782783

783-
MOI.Test.util_test_models_equal(
784-
model,
785-
expected,
786-
var_names,
787-
con_names,
788-
)
784+
MOI.Test.util_test_models_equal(model, expected, var_names, con_names)
789785

790786
return
791787
end

0 commit comments

Comments
 (0)