-
Notifications
You must be signed in to change notification settings - Fork 49
Add problems 5-13 except 9,10 #375
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
Merged
tmigot
merged 110 commits into
JuliaSmoothOptimizers:main
from
arnavk23:luksan/add-problems-5-12
Oct 31, 2025
Merged
Changes from 104 commits
Commits
Show all changes
110 commits
Select commit
Hold shift + click to select a range
7d950c5
Add Problems 5-12 (genbroyden, genbroydenb, placeholders for 7-12) an…
arnavk23 0243327
Renaming variables to be consistent across all problems
arnavk23 68460ee
Add PureJuMP counterparts for Problems 5-12 (genbroyden, genbroydenb,…
arnavk23 ccc6b20
JuMP
arnavk23 a70e7f5
Relax test: use intersection of problems in ADNLPProblems and PureJuM…
arnavk23 c893535
comments
arnavk23 7c5f406
Add convenience wrapper auglag() to ADNLPProblems.auglag
arnavk23 9c5c090
Add ADNLS variant for auglag and update auglag metadata nls count
arnavk23 7163faa
browngen
arnavk23 1fc23d9
changes
arnavk23 31e74f3
browngen
arnavk23 c2ce1ba
fixing checksum issues
arnavk23 9661813
toint
arnavk23 9e1d4f0
toint
arnavk23 9c79bd9
Delete src/ADNLPProblems/toint.jl
arnavk23 1c169ec
Update test_utils.jl
arnavk23 56dc762
Delete src/ADNLPProblems/trig.jl
arnavk23 76f9e9b
Removing trig and toint
arnavk23 fa11e18
Update src/ADNLPProblems/cragglvy2.jl
arnavk23 82e2fe6
Update src/ADNLPProblems/auglag.jl
arnavk23 ce63619
Update src/ADNLPProblems/auglag.jl
arnavk23 aafedce
changes proposed by @tmigot
arnavk23 3526af4
pdf changes
arnavk23 7d06b5e
Merge branch 'main' into luksan/add-problems-5-12
arnavk23 bccf9ff
Implementation of Augmented Lagrangian problem in PureJuMP without ex…
arnavk23 11e9015
fixing issues in auglag problem definitions
arnavk23 734a28e
Update src/PureJuMP/auglag.jl
arnavk23 f8a84f3
Update src/PureJuMP/auglag.jl
arnavk23 9ee9737
Update src/PureJuMP/auglag.jl
arnavk23 0a4bca7
Update src/PureJuMP/auglag.jl
arnavk23 a3cdf38
Update src/PureJuMP/auglag.jl
arnavk23 7fce265
Update src/ADNLPProblems/auglag.jl
arnavk23 930f079
Update src/ADNLPProblems/auglag.jl
arnavk23 8079928
auglag multiply by 10
arnavk23 e63ab1e
auglag documentation
arnavk23 b4840da
Brown generalized function
arnavk23 e0b70d4
Update src/PureJuMP/auglag.jl
arnavk23 bbc687e
Update src/ADNLPProblems/browngen.jl
arnavk23 ccd1d04
Update src/PureJuMP/auglag.jl
arnavk23 fdd1503
Update src/ADNLPProblems/browngen.jl
arnavk23 9c57ccd
Update src/ADNLPProblems/broyden7d.jl
arnavk23 32afb3c
Update src/Meta/genrose.jl
arnavk23 2af4718
Update src/Meta/chainwoo.jl
arnavk23 f68e258
Update src/Meta/cragglvy2.jl
arnavk23 76c8462
Update src/Meta/browngen.jl
arnavk23 1024b3e
Update src/ADNLPProblems/broyden7d.jl
arnavk23 945f075
Update src/Meta/broyden7d.jl
arnavk23 a14f598
Update src/PureJuMP/broyden7d.jl
arnavk23 aad39a9
Update src/ADNLPProblems/cragglvy2.jl
arnavk23 5139449
Update src/ADNLPProblems/cragglvy2.jl
arnavk23 173a8e4
Update src/ADNLPProblems/cragglvy2.jl
arnavk23 7257220
Update src/ADNLPProblems/genbroyden.jl
arnavk23 9a2f7eb
Update src/ADNLPProblems/genrose.jl
arnavk23 0bd40a8
Update src/ADNLPProblems/genrose.jl
arnavk23 405ffe7
Update src/ADNLPProblems/nazareth.jl
arnavk23 275c7b6
Update src/ADNLPProblems/nazareth.jl
arnavk23 09064a6
Update src/ADNLPProblems/nazareth.jl
arnavk23 5d3e551
fixing errors and adding documentation
arnavk23 cce8815
Implementation of Problem 13
arnavk23 9671fc9
Update src/PureJuMP/auglag.jl
arnavk23 2436b24
Update src/PureJuMP/browngen2.jl
arnavk23 046ef5a
Update src/PureJuMP/browngen1.jl
arnavk23 4629ee7
Update src/PureJuMP/browngen2.jl
arnavk23 a4a1d3c
Update src/Meta/browngen2.jl
arnavk23 52b88a5
Update src/ADNLPProblems/browngen2.jl
arnavk23 3ab4917
Update src/ADNLPProblems/broyden7d.jl
arnavk23 4ad0719
Update src/ADNLPProblems/broyden7d.jl
arnavk23 14b6acf
Update src/PureJuMP/browngen1.jl
arnavk23 e6b5aea
Update src/PureJuMP/browngen1.jl
arnavk23 9f159b2
changes
arnavk23 8438c54
Added neighbors = [Int[] for _ in 1:n].
arnavk23 98f7cfc
Update src/PureJuMP/browngen1.jl
arnavk23 99d9e8a
Update src/ADNLPProblems/broyden7d.jl
arnavk23 d5ae2c9
Update src/Meta/chainwoo.jl
arnavk23 ef363fd
Update src/ADNLPProblems/genbroydenb.jl
arnavk23 b301427
Update src/ADNLPProblems/nazareth.jl
arnavk23 c695b37
Update src/ADNLPProblems/genbroydenb.jl
arnavk23 9aab84b
Update src/ADNLPProblems/genbroydenb.jl
arnavk23 db62cf5
Update src/ADNLPProblems/genbroydentri.jl
arnavk23 1d89d83
Update src/Meta/genrose.jl
arnavk23 3dec1df
Update src/PureJuMP/nazareth.jl
arnavk23 59a36a0
Update src/ADNLPProblems/powellsg.jl
arnavk23 7e2f98d
Update src/ADNLPProblems/powellsg.jl
arnavk23 5996d0d
Update src/ADNLPProblems/powellsg.jl
arnavk23 eff9b55
Update src/ADNLPProblems/powellsg.jl
arnavk23 8492676
Update src/ADNLPProblems/nazareth.jl
arnavk23 03cd941
Update src/ADNLPProblems/nazareth.jl
arnavk23 ddfdca0
Update src/ADNLPProblems/nazareth.jl
arnavk23 2f697ee
Update src/ADNLPProblems/nazareth.jl
arnavk23 d9a82af
Update src/ADNLPProblems/nazareth.jl
arnavk23 b987ab1
Update src/ADNLPProblems/nazareth.jl
arnavk23 e2a953f
changes
arnavk23 2078516
Update src/ADNLPProblems/genbroydenb.jl
arnavk23 14759d0
Update src/ADNLPProblems/genbroydenb.jl
arnavk23 e2b9dbd
Update src/ADNLPProblems/genbroydenb.jl
arnavk23 dcc91dc
Update src/ADNLPProblems/genbroydenb.jl
arnavk23 60f7615
Update src/ADNLPProblems/genrose.jl
arnavk23 9b82d82
Update src/ADNLPProblems/genrose.jl
arnavk23 09e1ac7
Update src/ADNLPProblems/chainwoo.jl
arnavk23 ed2fdd8
chainwoo: simplify residual calculations
arnavk23 0f7a50e
Update src/ADNLPProblems/chainwoo.jl
arnavk23 c305223
Update src/ADNLPProblems/chainwoo.jl
arnavk23 c54dcca
Update src/ADNLPProblems/chainwoo.jl
arnavk23 49f682e
chainwoo
arnavk23 dc2916d
Update src/Meta/chainwoo.jl
arnavk23 d1c06f9
easier implementation of the algorithm.
arnavk23 4c5115f
genbroydenb and running JuliaFormatter
arnavk23 ae0a0eb
fixing x0 in genbroydenb problem
arnavk23 ad66a20
vector adaptation for large-scale unconstrained optimization problems.
arnavk23 0216f26
Apply suggestions from code review
tmigot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| export auglag | ||
|
|
||
| function auglag(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} | ||
| λ₁ = T(-0.002008) | ||
| λ₂ = T(-0.001900) | ||
| λ₃ = T(-0.000261) | ||
|
|
||
| function f(x; n = length(x)) | ||
| s = zero(T) | ||
| for i = 1:n | ||
| if mod(i, 5) == 0 | ||
| prod_term = one(T) | ||
| sum_sq = zero(T) | ||
| for j = 1:5 | ||
| idx = i + 1 - j | ||
| if 1 <= idx <= n | ||
| prod_term *= x[idx] | ||
| sum_sq += x[idx]^2 | ||
| end | ||
| end | ||
| s += exp(prod_term) + 10 * (sum_sq - 10 - λ₁)^2 | ||
|
|
||
| if i >= 4 | ||
| s += 10 * (x[i-3] * x[i-2] - 5 * x[i-1] * x[i] - λ₂)^2 | ||
| end | ||
|
|
||
| if i >= 4 | ||
| s += 10 * (x[i-4]^3 + x[i-3]^3 + 1 - λ₃)^2 | ||
| end | ||
| end | ||
| end | ||
| return s | ||
| end | ||
|
|
||
| x0 = zeros(T, n) | ||
| for i = 1:n | ||
| m = mod(i, 5) | ||
| if m == 1 | ||
| x0[i] = i <= 2 ? T(-2) : T(-1) | ||
| elseif m == 2 | ||
| x0[i] = i <= 2 ? T(2) : T(-1) | ||
tmigot marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| elseif m == 3 | ||
| x0[i] = T(2) | ||
tmigot marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| elseif m == 4 | ||
| x0[i] = T(-1) | ||
tmigot marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| else | ||
| x0[i] = T(-1) | ||
tmigot marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| end | ||
| end | ||
|
|
||
| return ADNLPModels.ADNLPModel(f, x0, name = "auglag"; kwargs...) | ||
| end | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| export browngen1 | ||
|
|
||
| function browngen1(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} | ||
| n = max(2, n) | ||
| function f(x; n = length(x)) | ||
| s = zero(T) | ||
| @inbounds for i in 2:n | ||
| s += (x[i - 1] - 3)^2 + | ||
| (x[i - 1] - x[i])^2 + | ||
| exp(20 * (x[i - 1] - x[i])) | ||
| end | ||
| return s | ||
| end | ||
| x0 = [isodd(i) ? zero(T) : -one(T) for i in 1:n] | ||
| return ADNLPModels.ADNLPModel(f, x0, name = "browngen1"; kwargs...) | ||
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| export browngen2 | ||
|
|
||
| function browngen2(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} | ||
| n = max(2, n) | ||
| function f(x; n = length(x)) | ||
| s = zero(T) | ||
| @inbounds for i = 2:n | ||
| s += (x[i-1]^2)^(x[i]^2 + 1) + (x[i]^2)^(x[i-1]^2 + 1) | ||
| end | ||
| return s | ||
| end | ||
| x0 = [isodd(i) ? -one(T) : one(T) for i in 1:n] | ||
| return ADNLPModels.ADNLPModel(f, x0, name = "browngen2"; kwargs...) | ||
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| export broyden7d | ||
|
|
||
| function broyden7d(; use_nls::Bool = false, kwargs...) | ||
| model = use_nls ? :nls : :nlp | ||
| return broyden7d(Val(model); kwargs...) | ||
| end | ||
|
|
||
| function broyden7d(::Val{:nlp}; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} | ||
| p = 7 // 3 | ||
| function f(x; n = length(x), p = p) | ||
| x0 = zero(T) | ||
| xn1 = zero(T) | ||
| s = zero(T) | ||
| s += abs((3 - 2 * x[1]) * x[1] - x0 - x[2] + 1)^p | ||
| for i = 2:(n - 1) | ||
| s += abs((3 - 2 * x[i]) * x[i] - x[i - 1] - x[i + 1] + 1)^p | ||
| end | ||
| s += abs((3 - 2 * x[n]) * x[n] - x[n - 1] - xn1 + 1)^p | ||
| nh = div(n, 2) | ||
| for i = 1:nh | ||
| s += abs(x[i] + x[i + nh])^p | ||
| end | ||
| return s | ||
| end | ||
| x0 = fill(-one(T), n) | ||
| return ADNLPModels.ADNLPModel(f, x0, name = "broyden7d"; kwargs...) | ||
| end | ||
|
|
||
| function broyden7d(::Val{:nls}; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} | ||
| x0 = fill(-one(T), n) | ||
| function F!(r, x; n = length(x)) | ||
| p = 7 // 6 | ||
| nh = div(n, 2) | ||
| @inbounds begin | ||
| r[1] = abs((3 - 2 * x[1]) * x[1] - zero(T) - x[2] + one(T))^p | ||
| for i = 2:(n - 1) | ||
| r[i] = abs((3 - 2 * x[i]) * x[i] - x[i - 1] - x[i + 1] + one(T))^p | ||
| end | ||
| r[n] = abs((3 - 2 * x[n]) * x[n] - x[n - 1] - zero(T) + one(T))^p | ||
| for i = 1:nh | ||
| r[n + i] = abs(x[i] + x[i + nh])^p | ||
| end | ||
| end | ||
| return r | ||
| end | ||
| nequ = n + div(n, 2) | ||
| return ADNLPModels.ADNLSModel!(F!, x0, nequ, name = "broyden7d-nls"; kwargs...) | ||
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| export genbroydenb | ||
|
|
||
| function genbroydenb(; use_nls::Bool = false, kwargs...) | ||
arnavk23 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| model = use_nls ? :nls : :nlp | ||
| return genbroydenb(Val(model); kwargs...) | ||
| end | ||
|
|
||
| function genbroydenb(::Val{:nlp}; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} | ||
| p = 7 // 3 | ||
| function f(x; n = length(x)) | ||
| s = zero(T) | ||
| for i = 1:n | ||
| diag = (2 + 5 * x[i]^2) * x[i] + 1 | ||
| neigh = zero(T) | ||
| @inbounds for j = max(1, i - 5):min(n, i + 1) | ||
| if j != i | ||
| neigh += x[j] * (1 + x[j]) | ||
| end | ||
| end | ||
| s += abs(diag + neigh)^p | ||
| end | ||
| return s | ||
| end | ||
| x0 = fill(-one(T), n) | ||
| return ADNLPModels.ADNLPModel(f, x0, name = "genbroydenb", minimize = true; kwargs...) | ||
| end | ||
|
|
||
| function genbroydenb(::Val{:nls}; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} | ||
| p = 7 // 6 | ||
| function F!(r, x; n = length(x)) | ||
| @inbounds for i = 1:n | ||
arnavk23 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| diag = (2 + 5 * x[i]^2) * x[i] + 1 | ||
| neigh = zero(T) | ||
| lo = max(1, i - 5) | ||
| hi = min(n, i + 1) | ||
| for j = lo:hi | ||
| if j != i | ||
| neigh += x[j] * (1 + x[j]) | ||
| end | ||
| end | ||
| r[i] = abs(diag + neigh)^p | ||
| end | ||
| return r | ||
| end | ||
| x0 = fill(-one(T), n) | ||
| return ADNLPModels.ADNLSModel!(F!, x0, n, name = "genbroydenb-nls"; kwargs...) | ||
| end | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| export genbroydentri | ||
|
|
||
| function genbroydentri(; use_nls::Bool = false, kwargs...) | ||
| model = use_nls ? :nls : :nlp | ||
| return genbroydentri(Val(model); kwargs...) | ||
| end | ||
|
|
||
| function genbroydentri(::Val{:nlp}; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} | ||
| p = 7 // 3 | ||
| function f(x; n = length(x)) | ||
| x0 = zero(T) | ||
| xn1 = zero(T) | ||
| s = abs((3 - 2 * x[1]) * x[1] - x0 - x[2] + 1)^p | ||
| for i = 2:(n - 1) | ||
| s += abs((3 - 2 * x[i]) * x[i] - x[i - 1] - x[i + 1] + 1)^p | ||
| end | ||
| s += abs((3 - 2 * x[n]) * x[n] - x[n - 1] - xn1 + 1)^p | ||
| return s | ||
| end | ||
| x0 = fill(-one(T), n) | ||
| return ADNLPModels.ADNLPModel(f, x0, name = "genbroydentri"; kwargs...) | ||
| end | ||
|
|
||
| function genbroydentri(::Val{:nls}; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} | ||
| p = 7 // 6 | ||
| x0 = fill(-one(T), n) | ||
| function F!(r, x) | ||
| x0_val = zero(T) | ||
| xn1_val = zero(T) | ||
| @inbounds begin | ||
| r[1] = abs((3 - 2 * x[1]) * x[1] - x0_val - x[2] + 1)^p | ||
| for i = 2:(n - 1) | ||
| r[i] = abs((3 - 2 * x[i]) * x[i] - x[i - 1] - x[i + 1] + 1)^p | ||
| end | ||
| r[n] = abs((3 - 2 * x[n]) * x[n] - x[n - 1] - xn1_val + 1)^p | ||
| end | ||
| return r | ||
| end | ||
| return ADNLPModels.ADNLSModel!(F!, x0, n, name = "genbroydentri-nls"; kwargs...) | ||
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.