Skip to content

Commit 2d5d045

Browse files
authored
Remove duplicated methods (#69)
1 parent 1f57da3 commit 2d5d045

File tree

3 files changed

+11
-17
lines changed

3 files changed

+11
-17
lines changed

src/MultiObjectiveAlgorithms.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -610,6 +610,10 @@ function _warn_on_nonfinite_anti_ideal(algorithm, sense, index)
610610
return
611611
end
612612

613+
function _project(x::Vector{Float64}, axis::Int)
614+
return [x[i] for i in 1:length(x) if i != axis]
615+
end
616+
613617
for file in readdir(joinpath(@__DIR__, "algorithms"))
614618
include(joinpath(@__DIR__, "algorithms", file))
615619
end

src/algorithms/KirlikSayin.jl

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ struct _Rectangle
3434
end
3535
end
3636

37+
_volume(r::_Rectangle, l::Vector{Float64}) = prod(r.u - l)
38+
3739
function Base.issubset(x::_Rectangle, y::_Rectangle)
3840
@assert length(x.l) == length(y.l) "Dimension mismatch"
3941
return all(x.l .>= y.l) && all(x.u .<= y.u)
@@ -72,12 +74,6 @@ function _update_list(L::Vector{_Rectangle}, f::Vector{Float64})
7274
return L_new
7375
end
7476

75-
function _project(x::Vector{Float64}, axis::Int)
76-
return [x[i] for i in 1:length(x) if i != axis]
77-
end
78-
79-
_volume(r::_Rectangle, l::Vector{Float64}) = prod(r.u - l)
80-
8177
function optimize_multiobjective!(algorithm::KirlikSayin, model::Optimizer)
8278
start_time = time()
8379
sense = MOI.get(model.inner, MOI.ObjectiveSense())

src/algorithms/TambyVanderpooten.jl

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88
99
`TambyVanderpooten` implements the algorithm of:
1010
11-
Satya Tamby, Daniel Vanderpooten (2021) Enumeration of the Nondominated Set
12-
of Multiobjective Discrete Optimization Problems. INFORMS Journal on
11+
Satya Tamby, Daniel Vanderpooten (2021) Enumeration of the Nondominated Set
12+
of Multiobjective Discrete Optimization Problems. INFORMS Journal on
1313
Computing 33(1):72-85.
1414
1515
This is an algorithm to generate all nondominated solutions for multi-objective
16-
discrete optimization problems. The algorithm maintains upper bounds (for
17-
minimization problems) and their associated defining points. At each iteration,
18-
one of the objectives and an upper bound is picked and the single objective
16+
discrete optimization problems. The algorithm maintains upper bounds (for
17+
minimization problems) and their associated defining points. At each iteration,
18+
one of the objectives and an upper bound is picked and the single objective
1919
reformulation is solved using one of the defining points as a starting solution.
2020
2121
## Supported optimizer attributes
@@ -25,12 +25,6 @@ reformulation is solved using one of the defining points as a starting solution.
2525
"""
2626
mutable struct TambyVanderpooten <: AbstractAlgorithm end
2727

28-
function _project(x::Vector{Float64}, axis::Int)
29-
return [x[i] for i in 1:length(x) if i != axis]
30-
end
31-
32-
_volume(r::_Rectangle, l::Vector{Float64}) = prod(r.u - l)
33-
3428
function _update_search_region(
3529
U_N::Dict{Vector{Float64},Vector{Vector{Vector{Float64}}}},
3630
y::Vector{Float64},

0 commit comments

Comments
 (0)