Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to Project.toml, require Julia 1, test agreement with CUTEst #36

Merged
merged 9 commits into from
Oct 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
*.jl.cov
*.jl.*.cov
*.jl.mem
Manifest.toml
8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ branches:
only:
- master

script:
- if [[ -a .git/shallow ]]; then git fetch --unshallow; fi
- julia -e 'VERSION >= v"0.7" && using Pkg; Pkg.clone(pwd()); Pkg.build("OptimizationProblems"); Pkg.test("OptimizationProblems"; coverage=true)'
# script:
# - if [[ -a .git/shallow ]]; then git fetch --unshallow; fi
# - julia -e 'VERSION >= v"0.7" && using Pkg; Pkg.clone(pwd()); Pkg.build("OptimizationProblems"); Pkg.test("OptimizationProblems"; coverage=true)'

after_success:
- julia -e 'VERSION >= v"0.7" && using Pkg; cd(Pkg.dir("OptimizationProblems")); Pkg.add("Coverage"); using Coverage; Coveralls.submit(Coveralls.process_folder())'
- 'import Pkg; Pkg.add("Coverage"); using Coverage; Coveralls.submit(Coveralls.process_folder())'
16 changes: 16 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name = "OptimizationProblems"
uuid = "5049e819-d29b-5fba-b941-0eee7e64c1c6"
version = "0.2.0"

[deps]
JuMP = "4076af6c-e467-56ae-b986-b466b2749572"

[compat]
JuMP = "~0.15, ~0.16, ~0.17, ~0.18"
julia = "~1"

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

[targets]
test = ["Test"]
3 changes: 0 additions & 3 deletions REQUIRE

This file was deleted.

2 changes: 1 addition & 1 deletion src/NZF1.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export NZF1

function NZF1(n :: Int=13)

mod(n,13) != 0 && Compat.@warn("NZF1: number of variables adjusted to be divisible by 13")
mod(n,13) != 0 && @warn("NZF1: number of variables adjusted to be divisible by 13")
nbis = max(1,div(n,13))
n = 13*nbis

Expand Down
2 changes: 1 addition & 1 deletion src/OptimizationProblems.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module OptimizationProblems

using JuMP, Compat
using JuMP

path = dirname(@__FILE__)
files = filter(x->x[end-2:end] == ".jl", readdir(path))
Expand Down
4 changes: 2 additions & 2 deletions src/arglina.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
export arglina

"Linear function with `n` parameters and `m` observations - full rank"
function arglina(n::Int=100, m::Int=200)
function arglina(n::Int=100, m::Int=2n)

m < n && Compat.@warn("arglina: must have m ≥ n")
m < n && @warn("arglina: must have m ≥ n")
m = max(m, n)

nlp = Model()
Expand Down
4 changes: 2 additions & 2 deletions src/arglinb.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
export arglinb

"Linear function with `n` parameters and `m` observations - rank 1"
function arglinb(n::Int=10, m::Int=20)
function arglinb(n::Int=10, m::Int=2n)

m < n && Compat.@warn("arglinb: must have m ≥ n")
m < n && @warn("arglinb: must have m ≥ n")
m = max(m, n)

nlp = Model()
Expand Down
4 changes: 2 additions & 2 deletions src/arglinc.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
export arglinc

"Linear function with `n` parameters and `m` observations - rank 1, zero columns and rows"
function arglinc(n::Int=10, m::Int=20)
function arglinc(n::Int=10, m::Int=2n)

m < n && Compat.@warn("arglinc: must have m ≥ n")
m < n && @warn("arglinc: must have m ≥ n")
m = max(m, n)

nlp = Model()
Expand Down
2 changes: 1 addition & 1 deletion src/arwhead.jl
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export arwhead
"Arrow head model in size `n`"
function arwhead(n :: Int=100)

n < 2 && Compat.@warn("arwhead: number of variables must be ≥ 2")
n < 2 && @warn("arwhead: number of variables must be ≥ 2")
n = max(2, n)

nlp = Model()
Expand Down
2 changes: 1 addition & 1 deletion src/bdqrtic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export bdqrtic
"Banded quartic model in size `n`"
function bdqrtic(n :: Int=100)

n < 5 && Compat.@warn("bdqrtic: number of variables must be ≥ 5")
n < 5 && @warn("bdqrtic: number of variables must be ≥ 5")
n = max(5, n)

nlp = Model()
Expand Down
4 changes: 2 additions & 2 deletions src/beale.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ function beale(args...)
@NLobjective(
nlp,
Min,
(1.5 + x[1] * (1.0 - x[2]))^2 + (2.25 + x[1] * (1.0 - x[2]^2))^2 + (2.625 + x[1] * (1.0 - x[2]^3))^2
)
(1.5 - x[1] * (1.0 - x[2]))^2 + (2.25 - x[1] * (1.0 - x[2]^2))^2 + (2.625 - x[1] * (1.0 - x[2]^3))^2,
)

return nlp
end
2 changes: 1 addition & 1 deletion src/brownden.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export brownden
"Brown and Dennis function"
function brownden(m::Int=20)

m < 4 && Compat.@warn("brownden: must have m ≥ 4")
m < 4 && @warn("brownden: must have m ≥ 4")
m = max(m, 4)

nlp = Model()
Expand Down
5 changes: 4 additions & 1 deletion src/broydn7d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,15 @@
#
# D. Orban, Montreal, 08/2015.

# Note: discrepancy with CUTEst appears to be a bug in CUTEst, this matches the original paper
# (See issue #36)

export broydn7d

"Broyden 7-diagonal model in size `n`"
function broydn7d(n :: Int=100, p :: Float64=7/3)

mod(n, 2) > 0 && Compat.@warn("broydn7d: number of variables adjusted to be even")
mod(n, 2) > 0 && @warn("broydn7d: number of variables adjusted to be even")
n2 = max(1, div(n, 2))
n = 2 * n2

Expand Down
3 changes: 3 additions & 0 deletions src/brybnd.jl
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
#
# D. Orban, Montreal, 08/2015.

# Note: discrepancy with CUTEst appears to be a bug in CUTEst, this matches the original paper
# (See issue #36)

export brybnd

"Broyden banded model in size `n`"
Expand Down
2 changes: 1 addition & 1 deletion src/chainwoo.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export chainwoo, woods
"The chained Woods function in size `n`, a variant on the Woods function"
function chainwoo(n :: Int=100)

(n % 4 == 0) || Compat.@warn("chainwoo: number of variables adjusted to be a multiple of 4")
(n % 4 == 0) || @warn("chainwoo: number of variables adjusted to be a multiple of 4")
n = 4 * max(1, div(n, 4))

nlp = Model()
Expand Down
2 changes: 1 addition & 1 deletion src/chnrosnb_mod.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export chnrosnb_mod

function chnrosnb_mod(n :: Int=100)

n < 2 && Compat.@warn("chnrosnb: number of variables must be ≥ 2")
n < 2 && @warn("chnrosnb: number of variables must be ≥ 2")
n = max(2, n)

nlp = Model()
Expand Down
2 changes: 1 addition & 1 deletion src/clplatea.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export clplatea
function clplatea(n::Int=5041, wght::Float64=-0.1)

p = floor(Int, sqrt(n))
p*p != n && Compat.@warn("clplatea: number of variables adjusted from $n down to $(p*p)")
p*p != n && @warn("clplatea: number of variables adjusted from $n down to $(p*p)")
n = p * p

nlp = Model()
Expand Down
2 changes: 1 addition & 1 deletion src/clplateb.jl
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export clplateb
function clplateb(n::Int=5041, wght::Float64=-0.1)

p = floor(Int, sqrt(n))
p*p != n && Compat.@warn("clplateb: number of variables adjusted from $n down to $(p*p)")
p*p != n && @warn("clplateb: number of variables adjusted from $n down to $(p*p)")
n = p * p

nlp = Model()
Expand Down
2 changes: 1 addition & 1 deletion src/clplatec.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export clplatec
function clplatec(n::Int=5041,wght::Float64=-0.1,r::Float64=0.99,l::Float64=0.01)

p = floor(Int, sqrt(n))
p*p != n && Compat.@warn("clplatec: number of variables adjusted from $n down to $(p*p)")
p*p != n && @warn("clplatec: number of variables adjusted from $n down to $(p*p)")
n = p * p

nlp = Model()
Expand Down
2 changes: 1 addition & 1 deletion src/cosine.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export cosine
"The cosine function in size `n`"
function cosine(n :: Int=100)

n < 2 && Compat.@warn("cosine: number of variables must be ≥ 2")
n < 2 && @warn("cosine: number of variables must be ≥ 2")
n = max(2, n)

nlp = Model()
Expand Down
2 changes: 1 addition & 1 deletion src/cragglvy.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export cragglvy
"The extented Cragg and Levy function in size `n`"
function cragglvy(n :: Int=100)

n < 2 && Compat.@warn("cragglvy: number of variables must be ≥ 2")
n < 2 && @warn("cragglvy: number of variables must be ≥ 2")
n = max(2, n)

nlp = Model()
Expand Down
2 changes: 1 addition & 1 deletion src/curly.jl
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export curly, curly10, curly20, curly30
"Curly function in size `n` with semi-bandwidth `b`"
function curly(n :: Int=100; b :: Int=10)

n < 2 && Compat.@warn("curly: number of variables must be ≥ 2")
n < 2 && @warn("curly: number of variables must be ≥ 2")
n = max(2, n)

nlp = Model()
Expand Down
2 changes: 1 addition & 1 deletion src/dixmaan_efgh.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export dixmaane, dixmaanf, dixmaang, dixmaanh
function dixmaane(n :: Int=99;
α :: Float64=1.0, β :: Float64=0.0, γ :: Float64=0.125, δ :: Float64=0.125)

(n % 3 == 0) || Compat.@warn("dixmaan: number of variables adjusted to be a multiple of 3")
(n % 3 == 0) || @warn("dixmaan: number of variables adjusted to be a multiple of 3")
m = max(1, div(n, 3))
n = 3 * m

Expand Down
2 changes: 1 addition & 1 deletion src/dixmaan_ijkl.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export dixmaani, dixmaanj, dixmaank, dixmaanl
function dixmaani(n :: Int=99;
α :: Float64=1.0, β :: Float64=0.0, γ :: Float64=0.125, δ :: Float64=0.125)

(n % 3 == 0) || Compat.@warn("dixmaan: number of variables adjusted to be a multiple of 3")
(n % 3 == 0) || @warn("dixmaan: number of variables adjusted to be a multiple of 3")
m = max(1, div(n, 3))
n = 3 * m

Expand Down
2 changes: 1 addition & 1 deletion src/dixmaan_mnop.jl
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export dixmaanm, dixmaann, dixmaano, dixmaanp
function dixmaanm(n :: Int=99;
α :: Float64=1.0, β :: Float64=0.0, γ :: Float64=0.125, δ :: Float64=0.125)

(n % 3 == 0) || Compat.@warn("dixmaan: number of variables adjusted to be a multiple of 3")
(n % 3 == 0) || @warn("dixmaan: number of variables adjusted to be a multiple of 3")
m = max(1, div(n, 3))
n = 3 * m

Expand Down
2 changes: 1 addition & 1 deletion src/edensch.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export edensch
"Extended Dennis-Schnabel model in size `n`"
function edensch(n :: Int=100)

n < 2 && Compat.@warn("edensch: number of variables must be ≥ 2")
n < 2 && @warn("edensch: number of variables must be ≥ 2")
n = max(2, n)

nlp = Model()
Expand Down
2 changes: 1 addition & 1 deletion src/eg2.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export eg2
"model in size `n`"
function eg2(n :: Int=100)

n < 2 && Compat.@warn("eg2: number of variables must be ≥ 2")
n < 2 && @warn("eg2: number of variables must be ≥ 2")
n = max(2, n)

nlp = Model()
Expand Down
2 changes: 1 addition & 1 deletion src/engval1.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export engval1
"The Engval1 model in size `n`"
function engval1(n :: Int=100)

n < 2 && Compat.@warn("engval1: number of variables must be ≥ 2")
n < 2 && @warn("engval1: number of variables must be ≥ 2")
n = max(2, n)

nlp = Model()
Expand Down
2 changes: 1 addition & 1 deletion src/errinros_mod.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export errinros_mod

function errinros_mod(n :: Int=100)

n < 2 && Compat.@warn("errinros_mod: number of variables must be ≥ 2")
n < 2 && @warn("errinros_mod: number of variables must be ≥ 2")
n = max(2, n)

nlp = Model()
Expand Down
2 changes: 1 addition & 1 deletion src/extrosnb.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export extrosnb

function extrosnb(n :: Int=100)

n < 2 && Compat.@warn("extrosnb: number of variables must be ≥ 2")
n < 2 && @warn("extrosnb: number of variables must be ≥ 2")
n = max(2, n)

nlp = Model()
Expand Down
2 changes: 1 addition & 1 deletion src/fletcbv2.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export fletcbv2

function fletcbv2(n :: Int=100)

n < 2 && Compat.@warn("fletcbv2: number of variables must be ≥ 2")
n < 2 && @warn("fletcbv2: number of variables must be ≥ 2")
n = max(2, n)

nlp = Model()
Expand Down
2 changes: 1 addition & 1 deletion src/fletcbv3_mod.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export fletcbv3_mod

function fletcbv3_mod(n :: Int=100)

n < 2 && Compat.@warn("fletchbv3_mod: number of variables must be ≥ 2")
n < 2 && @warn("fletchbv3_mod: number of variables must be ≥ 2")
n = max(2, n)

nlp = Model()
Expand Down
2 changes: 1 addition & 1 deletion src/fletchcr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export fletchcr

function fletchcr(n :: Int=100)

n < 2 && Compat.@warn("fletchcr: number of variables must be ≥ 2")
n < 2 && @warn("fletchcr: number of variables must be ≥ 2")
n = max(2, n)

nlp = Model()
Expand Down
4 changes: 2 additions & 2 deletions src/fminsrf2.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ export fminsrf2

function fminsrf2(n :: Int = 100)

n < 4 && Compat.@warn("fminsrf2: number of variables must be ≥ 4")
n < 4 && @warn("fminsrf2: number of variables must be ≥ 4")
n = max(4, n)

p = floor(Int, sqrt(n))
p*p != n && Compat.@warn("fminsrf2: number of variables adjusted from $n down to $(p*p)")
p*p != n && @warn("fminsrf2: number of variables adjusted from $n down to $(p*p)")
n = p * p

h00 = 1.0
Expand Down
2 changes: 1 addition & 1 deletion src/freuroth.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
export freuroth

function freuroth(n :: Int = 100)
n < 2 && Compat.@warn("freuroth: number of variables must be ≥ 2")
n < 2 && @warn("freuroth: number of variables must be ≥ 2")
n = max(2, n)

ngs = n - 1
Expand Down
6 changes: 5 additions & 1 deletion src/genrose.jl
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,16 @@
#
# D. Orban, Montreal, 08/2015.

# Note: difference from CUTEst is due to the constant 1.0,
# which does not affect its utility as a test problem other than perhaps
# for convergence-testing.

export genrose, rosenbrock

"Generalized Rosenbrock model in size `n`"
function genrose(n :: Int=100)

n < 2 && Compat.@warn("genrose: number of variables must be ≥ 2")
n < 2 && @warn("genrose: number of variables must be ≥ 2")
n = max(2,n)

nlp = Model()
Expand Down
2 changes: 1 addition & 1 deletion src/genrose_nash.jl
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export genrose_nash
"Nash's variant of `genrose()` in size `n`"
function genrose_nash(n :: Int=100)

n < 2 && Compat.@warn("genrose_nash: number of variables must be ≥ 2")
n < 2 && @warn("genrose_nash: number of variables must be ≥ 2")
n = max(2,n)

nlp = Model()
Expand Down
2 changes: 1 addition & 1 deletion src/indef_mod.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export indef_mod

function indef_mod(n :: Int=100)

n < 3 && Compat.@warn("indef_mod: number of variables must be ≥ 4")
n < 3 && @warn("indef_mod: number of variables must be ≥ 4")
n = max(3, n)

nlp = Model()
Expand Down
2 changes: 1 addition & 1 deletion src/liarwhd.jl
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export liarwhd

function liarwhd(n :: Int=100)

n < 2 && Compat.@warn("liarwhd: number of variables must be ≥ 4")
n < 2 && @warn("liarwhd: number of variables must be ≥ 4")
n = max(2, n)

nlp = Model()
Expand Down
Loading