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

fix: discrepancy in problem names. #357

Merged
merged 1 commit into from
Dec 21, 2024
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
2 changes: 1 addition & 1 deletion src/ADNLPProblems/chnrosnb_mod.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ function chnrosnb_mod(; n::Int = default_nvar, type::Type{T} = Float64, kwargs..
sum((1 - x[i])^2 for i = 2:n)
end
x0 = -ones(T, n)
return ADNLPModels.ADNLPModel(f, x0, name = "chnrosnb"; kwargs...)
return ADNLPModels.ADNLPModel(f, x0, name = "chnrosnb_mod"; kwargs...)
end
4 changes: 2 additions & 2 deletions src/ADNLPProblems/errinros_mod.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function errinros_mod(
1 // 2 * sum((1 - x[i])^2 for i = 2:n)
end
x0 = -ones(T, n)
return ADNLPModels.ADNLPModel(f, x0, name = "errinros"; kwargs...)
return ADNLPModels.ADNLPModel(f, x0, name = "errinros_mod"; kwargs...)
end

function errinros_mod(
Expand All @@ -37,5 +37,5 @@ function errinros_mod(
return r
end
x0 = -ones(T, n)
return ADNLPModels.ADNLSModel!(F!, x0, 2 * (n - 1), name = "errinros-nls"; kwargs...)
return ADNLPModels.ADNLSModel!(F!, x0, 2 * (n - 1), name = "errinros_mod-nls"; kwargs...)
end
2 changes: 1 addition & 1 deletion src/ADNLPProblems/fletcbv3_mod.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ function fletcbv3_mod(; n::Int = default_nvar, type::Type{T} = Float64, kwargs..
p * sum(100 * (1 + (2 / h^2)) * sin(x[i] / 100) + (1 / h^2) * cos(x[i]) for i = 1:n)
end
x0 = T.([(i / (n + 1)) for i = 1:n])
return ADNLPModels.ADNLPModel(f, x0, name = "fletcbv3"; kwargs...)
return ADNLPModels.ADNLPModel(f, x0, name = "fletcbv3_mod"; kwargs...)
end
2 changes: 1 addition & 1 deletion src/ADNLPProblems/genrose.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ function genrose(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) wh
return ADNLPModels.ADNLPModel(f, x0, name = "genrose"; kwargs...)
end

rosenbrock(args...; kwargs...) = genrose(args..., n = 2; delete!(Dict(kwargs), :n)...)
rosenbrock(args...; kwargs...) = genrose(args..., n = 2, name="rosenbrock"; delete!(Dict(kwargs), :n)...)
2 changes: 1 addition & 1 deletion src/ADNLPProblems/indef_mod.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ function indef_mod(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...)
1 // 2 * sum(cos(2 * x[i] - x[n] - x[1]) for i = 2:(n - 1))
end
x0 = T.([(i / (n + 1)) for i = 1:n])
return ADNLPModels.ADNLPModel(f, x0, name = "indef"; kwargs...)
return ADNLPModels.ADNLPModel(f, x0, name = "indef_mod"; kwargs...)
end
2 changes: 2 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ include("test_utils.jl")
eval(Meta.parse("ADNLPProblems.$(prob)(" * simp_backend * ")"))
end

@test nlp_ad.meta.name == pb

if pb in meta[(meta.contype .== :quadratic) .| (meta.contype .== :general), :name]
@testset "Test In-place Nonlinear Constraints for AD-$prob" begin
test_in_place_constraints(prob, nlp_ad)
Expand Down
Loading