Skip to content

Commit

Permalink
🤖 Format .jl files (#347)
Browse files Browse the repository at this point in the history
Co-authored-by: tmigot <[email protected]>
  • Loading branch information
github-actions[bot] and tmigot authored Sep 7, 2024
1 parent c724446 commit 2c14b02
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 35 deletions.
14 changes: 7 additions & 7 deletions src/ADNLPProblems/hs201.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export hs201

function hs201(; n::Int=default_nvar, type::Type{T} = Float64, kwargs...) where {T}
f(x) = 4 * (x[1] - 5)^2 + (x[2] - 6)^2
x0 = T[8, 9]
return ADNLPModels.ADNLPModel(f, x0, name="hs201"; kwargs...)
end
export hs201

function hs201(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T}
f(x) = 4 * (x[1] - 5)^2 + (x[2] - 6)^2
x0 = T[8, 9]
return ADNLPModels.ADNLPModel(f, x0, name = "hs201"; kwargs...)
end
4 changes: 2 additions & 2 deletions src/ADNLPProblems/hs211.jl
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
export hs211

function hs211(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T}
f(x) = 100*(x[2] - x[1]^3)^2 + (1 - x[1])^2
x0 = T[-1.2, 1.]
f(x) = 100 * (x[2] - x[1]^3)^2 + (1 - x[1])^2
x0 = T[-1.2, 1.0]
nlp = ADNLPModels.ADNLPModel(f, x0, name = "hs211"; kwargs...)
return nlp
end
50 changes: 25 additions & 25 deletions src/PureJuMP/hs201.jl
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
# Hock and Schittkowski problem number 201.
#
# Source:
# Problem 201 in
# K. Schittkowski,
# More Test Examples for Nonlinear Programming Codes,
# Lectures Notes in Economics and Mathematical Systems 282,
# Springer Verlag, Heidelberg, 1987.
#
export hs201
"HS201 model"
function hs201(args...; n::Int = default_nvar, kwargs...)
model = Model()

#Déclaration des variables
@variable(model, x1)
set_start_value(x1, 8)
@variable(model, x2)
set_start_value(x2, 9)

#Définition de la fonction objectif
@objective(model, Min, 4*(x1-5)^2+(x2-6)^2)

return model
end
# Hock and Schittkowski problem number 201.
#
# Source:
# Problem 201 in
# K. Schittkowski,
# More Test Examples for Nonlinear Programming Codes,
# Lectures Notes in Economics and Mathematical Systems 282,
# Springer Verlag, Heidelberg, 1987.
#
export hs201
"HS201 model"
function hs201(args...; n::Int = default_nvar, kwargs...)
model = Model()

#Déclaration des variables
@variable(model, x1)
set_start_value(x1, 8)
@variable(model, x2)
set_start_value(x2, 9)

#Définition de la fonction objectif
@objective(model, Min, 4 * (x1 - 5)^2 + (x2 - 6)^2)

return model
end
2 changes: 1 addition & 1 deletion src/PureJuMP/hs211.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ function hs211(; n::Int = default_nvar, kwargs...)
@variable(nlp, x1, start = -1.2)
@variable(nlp, x2, start = 1)

@objective(nlp, Min, 100*(x2 - x1^3)^2 + (1 - x1)^2)
@objective(nlp, Min, 100 * (x2 - x1^3)^2 + (1 - x1)^2)
return nlp
end

0 comments on commit 2c14b02

Please sign in to comment.