Skip to content

Commit ef6a529

Browse files
committed
basic wrapper, force to csc
1 parent 21bcad0 commit ef6a529

2 files changed

Lines changed: 25 additions & 0 deletions

File tree

Project.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,11 @@ StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3"
2323

2424
[weakdeps]
2525
MathOptInterface = "b8f27783-ece8-5eb3-8dc8-9495eed66fee"
26+
QuadraticModels = "f468eda6-eac5-11e8-05a5-ff9e497bcd19"
2627

2728
[extensions]
2829
CoolPDLPMOIExt = "MathOptInterface"
30+
CoolPDLPQuadraticModelsExt = "QuadraticModels"
2931

3032
[compat]
3133
Adapt = "4.4.0"
@@ -37,6 +39,7 @@ KernelAbstractions = "0.9.38"
3739
LinearAlgebra = "1"
3840
MathOptInterface = "1"
3941
Printf = "1.11.0"
42+
QuadraticModels = "0.9"
4043
ProgressMeter = "1.11.0"
4144
QPSReader = "0.2.1"
4245
Random = "1.11.0"

ext/CoolPDLPQuadraticModelsExt.jl

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
module CoolPDLPQuadraticModelsExt
2+
3+
import SparseArrays: SparseMatrixCSC
4+
import QuadraticModels: AbstractQuadraticModel
5+
import CoolPDLP
6+
7+
function CoolPDLP.MILP(qm::AbstractQuadraticModel; ignore_islp = false, kwargs...)
8+
ignore_islp || @assert qm.meta.islp
9+
10+
return CoolPDLP.MILP(;
11+
c = qm.data.c,
12+
lv = qm.meta.lvar,
13+
uv = qm.meta.uvar,
14+
A = SparseMatrixCSC(qm.data.A),
15+
lc = qm.meta.lcon,
16+
uc = qm.meta.ucon,
17+
name = qm.meta.name,
18+
kwargs...
19+
)
20+
end
21+
22+
end # module

0 commit comments

Comments
 (0)