Skip to content

Commit 8079430

Browse files
committed
Add an extension for QPSReader.jl
1 parent 498c65e commit 8079430

File tree

5 files changed

+23
-21
lines changed

5 files changed

+23
-21
lines changed

Project.toml

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,22 @@ LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
77
LinearOperators = "5c8ed15e-5a4c-59e4-a42b-c7e8811fb125"
88
NLPModels = "a4795742-8479-5a88-8948-cc11e1c8c1a6"
99
NLPModelsModifiers = "e01155f1-5c6f-4375-a9d8-616dd036575f"
10-
Requires = "ae029012-a4dd-5104-9daa-d747884805df"
1110
SolverCore = "ff4d7338-4cf1-434d-91df-b86cb86fb843"
1211
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
1312
SparseMatricesCOO = "fa32481b-f100-4b48-8dc8-c62f61b13870"
1413

14+
[weakdeps]
15+
QPSReader = "10f199a5-22af-520b-b891-7ce84a7b1bd0"
16+
17+
[extensions]
18+
QuadraticModelsQPSReaderExt = "QPSReader"
19+
1520
[compat]
16-
LinearAlgebra = "1.6"
17-
LinearOperators = "2.2.2, 2.3"
18-
NLPModels = "0.18, 0.19, 0.20, 0.21"
19-
NLPModelsModifiers = "0.6, 0.7"
20-
Requires = "0.3, 0.4, 0.5, 1.0"
21+
LinearAlgebra = "1.10"
22+
LinearOperators = "2.3"
23+
NLPModels = "0.21.4"
24+
NLPModelsModifiers = "0.7"
2125
SolverCore = "0.3"
22-
SparseArrays = "1.6"
23-
SparseMatricesCOO = "0.1.1, 0.2"
24-
julia = "1.6"
26+
SparseArrays = "1.10"
27+
SparseMatricesCOO = "0.2.3"
28+
julia = "1.10"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ The problems represented have the form
1313
<p align="center">
1414
optimize &nbsp; c₀ + cᵀ x + ½ xᵀ Q x
1515
&nbsp;&nbsp;
16-
subject to &nbsp; L ≤ Ax ≤ U and ℓ ≤ x ≤ u,
16+
subject to &nbsp; L ≤ Ax ≤ U and ℓ ≤ x ≤ u,
1717
</p>
1818

1919
where the square symmetric matrix Q is zero for linear optimization problems.

src/qps.jl renamed to ext/QuadraticModelsQPSReaderExt.jl

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
using .QPSReader
1+
module QuadraticModelsQPSReaderExt
22

3-
function QuadraticModel(qps::QPSData, x0 = zeros(qps.nvar))
4-
QuadraticModel(
3+
import QuadraticModels
4+
import QPSReader
5+
6+
function QuadraticModels.QuadraticModel(qps::QPSReader.QPSData, x0 = zeros(qps.nvar))
7+
QuadraticModels.QuadraticModel(
58
qps.c,
69
qps.qrows,
710
qps.qcols,
@@ -17,3 +20,5 @@ function QuadraticModel(qps::QPSData, x0 = zeros(qps.nvar))
1720
x0 = x0,
1821
)
1922
end
23+
24+
end

src/QuadraticModels.jl

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ using LinearAlgebra, SparseArrays
66
# our packages
77
using LinearOperators, NLPModels, NLPModelsModifiers, SolverCore, SparseMatricesCOO
88

9-
# auxiliary packages
10-
using Requires
11-
129
import NLPModels:
1310
objgrad,
1411
objgrad!,
@@ -36,8 +33,4 @@ include("linalg_utils.jl")
3633
include("qpmodel.jl")
3734
include("presolve/presolve.jl")
3835

39-
function __init__()
40-
@require QPSReader = "10f199a5-22af-520b-b891-7ce84a7b1bd0" include("qps.jl")
41-
end
42-
4336
end # module

test/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
1616
[compat]
1717
ADNLPModels = "0.8"
1818
LinearOperators = "2"
19-
NLPModels = "0.21"
19+
NLPModels = "0.21.4"
2020
NLPModelsModifiers = "0.7"
2121
NLPModelsTest = "0.10"
2222
QPSReader = "0.2"

0 commit comments

Comments
 (0)