Skip to content

Commit 7b697e2

Browse files
committed
Fixes
1 parent 0b1f98b commit 7b697e2

2 files changed

Lines changed: 3 additions & 43 deletions

File tree

src/change_form.jl

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,6 @@ function change_form(::Type{LPForm{T,AT,VT}}, lp::LPForm) where {T,AT,VT}
1515
)
1616
end
1717

18-
function change_form(
19-
::Type{LPForm{T,AT,VT}},
20-
lp::LPStandardForm{T},
21-
) where {T,AT,VT}
22-
return LPForm{T,AT,VT}(
23-
lp.sense,
24-
lp.c,
25-
lp.A,
26-
lp.b,
27-
lp.b,
28-
fill(zero(T), length(lp.c)),
29-
fill(typemax(T), length(lp.c)),
30-
)
31-
end
32-
3318
function change_form(
3419
::Type{LPForm{T,AT,VT}},
3520
lp::LPGeometricForm{T},
@@ -125,31 +110,6 @@ function change_form(
125110
return change_form(LPGeometricForm{T,AT,VT}, temp_lp)
126111
end
127112

128-
function change_form(
129-
::Type{LPStandardForm{T,AT,VT}},
130-
lp::LPStandardForm,
131-
) where {T,AT,VT}
132-
return LPStandardForm(lp.sense, lp.c, lp.A, lp.b)
133-
end
134-
135-
function change_form(
136-
::Type{LPStandardForm{T,AT,VT}},
137-
lp::LPGeometricForm{T},
138-
) where {T,AT,VT}
139-
new_A = hcat(lp.A, -lp.A, AT(I, length(lp.b), length(lp.b)))
140-
new_c = vcat(lp.c, -lp.c, fill(0.0, length(lp.b)))
141-
return LPStandardForm{T,AT,VT}(lp.sense, new_c, new_A, copy(lp.b))
142-
end
143-
144-
function change_form(
145-
::Type{LPStandardForm{T,AT,VT}},
146-
lp::F,
147-
) where {T,AT,VT,F<:AbstractLPForm{T}}
148-
temp_lp = change_form(LPForm{T,AT,VT}, lp)
149-
new_lp = change_form(LPGeometricForm{T,AT,VT}, temp_lp)
150-
return change_form(LPStandardForm{T,AT,VT}, new_lp)
151-
end
152-
153113
function change_form(
154114
::Type{LPSolverForm{T,AT,VT}},
155115
lp::LPSolverForm,

src/matrix_input.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ function linear_function(c::AbstractVector{T}) where {T}
9393
)
9494
end
9595

96-
function linear_objective(sense::MOI.OptimizationSense, c::AbstractVector{T})
96+
function linear_objective(sense::MOI.OptimizationSense, c::AbstractVector{T}) where {T}
9797
model = MOI.Utilities.ObjectiveContainer{T}()
9898
MOI.set(model, MOI.ObjectiveSense(), sense)
9999
func = linear_function(c)
@@ -118,7 +118,7 @@ function equality_constraints(A::AbstractMatrix{T}, b::AbstractVector{T}) where
118118
end
119119

120120
"""
121-
lp_standard_form(sense::MOI.OptimizationSense, c::AbtractVector, A::AbstractMatrix, b::AbstractVector)
121+
lp_standard_form(sense::MOI.OptimizationSense, c::AbstractVector, A::AbstractMatrix, b::AbstractVector)
122122
123123
Represents a problem of the form:
124124
```
@@ -127,7 +127,7 @@ s.t. A x == b
127127
x ≥ 0
128128
```
129129
"""
130-
function lp_standard_form(sense::MOI.OptimizationSense, c::AbtractVector{T}, A::AbstractMatrix{T}, b::AbstractVector{T}) where {T}
130+
function lp_standard_form(sense::MOI.OptimizationSense, c::AbstractVector{T}, A::AbstractMatrix{T}, b::AbstractVector{T}) where {T}
131131
m, n = size(A)
132132
@assert length(c) == n
133133
@assert length(b) == m

0 commit comments

Comments
 (0)