Skip to content

Commit d7d4126

Browse files
authored
Simplify with MatrixOfConstraints (#35)
* Simplify with MatrixOfConstraints * Fix format * Use MOI master * Drop Julia v1.10 * Remove MathOptInterface installation from CI Removed the installation step for the MathOptInterface package from the CI workflow. * Apply suggestion from @blegat * Update README to remove development version warning Removed warning about needing the development version of MathOptInterface.
1 parent 34bcd9d commit d7d4126

7 files changed

Lines changed: 459 additions & 428 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- version: '1'
2020
os: ubuntu-latest
2121
arch: x64
22-
- version: '1.6'
22+
- version: '1.10'
2323
os: ubuntu-latest
2424
arch: x64
2525
- version: '1'

Project.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@ uuid = "2f4eb8e6-3e35-4ae4-8c7a-f3d7d9bf20ed"
33
version = "0.1.0"
44

55
[deps]
6+
FillArrays = "1a297f60-69ca-5386-bcde-b61e274b549b"
67
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
78
MathOptInterface = "b8f27783-ece8-5eb3-8dc8-9495eed66fee"
89
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
910

1011
[compat]
11-
MathOptInterface = "1"
12-
julia = "1.6"
12+
FillArrays = "1.15.0"
13+
MathOptInterface = "1.49"
14+
julia = "1.10"
1315

1416
[extras]
1517
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

src/MatrixOptInterface.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
module MatrixOptInterface
77

88
using LinearAlgebra, SparseArrays
9+
import FillArrays
910
using MathOptInterface
1011
const MOI = MathOptInterface
1112
const MOIU = MathOptInterface.Utilities
@@ -67,6 +68,6 @@ end
6768
include("sparse_matrix.jl")
6869
include("conic_form.jl")
6970
include("matrix_input.jl")
70-
include("change_form.jl")
71+
#include("change_form.jl")
7172

7273
end

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,

0 commit comments

Comments
 (0)