diff --git a/docs/src/contributing.md b/docs/src/contributing.md index 219b6724..6cf34a74 100644 --- a/docs/src/contributing.md +++ b/docs/src/contributing.md @@ -35,7 +35,7 @@ The documentation should be added to the file in the `PureJuMP` folder. end ``` -* Problems modeled with `ADNLPModels` should be type-stable, i.e. they should all have keyword argument `type::Val{T} = Val(Float64)` where `T` is the type of the initial guess and the type used by the `NLPModel` API. +* Problems modeled with `ADNLPModels` should be type-stable, i.e. they should all have keyword argument `type::Type{T} = Float64` where `T` is the type of the initial guess and the type used by the `NLPModel` API. ## Templates for the new functions @@ -67,7 +67,7 @@ Next, we describe the `ADNLPProblems` file `function_name.jl`. ``` export function_name -function function_name(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function function_name(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} # define f # define x0 # nlp = ADNLPModels.ADNLPModel(f, x0, name = "function_name"; kwargs...) diff --git a/docs/src/tutorial.md b/docs/src/tutorial.md index ec0cceab..ab7ba9ce 100644 --- a/docs/src/tutorial.md +++ b/docs/src/tutorial.md @@ -60,7 +60,7 @@ nlp_120 = woods(n=120) ``` One of the advantages of these problems is that they are type-stable. Indeed, one can specify the output type with the keyword `type` as follows. ``` @example ex2 -nlp16_12 = woods(n=12, type=Val(Float16)) +nlp16_12 = woods(n=12, type=Float16) ``` Then, all the API will be compatible with the precised type. ``` @example ex2 diff --git a/src/ADNLPProblems/AMPGO02.jl b/src/ADNLPProblems/AMPGO02.jl index 81e16092..20de0afe 100644 --- a/src/ADNLPProblems/AMPGO02.jl +++ b/src/ADNLPProblems/AMPGO02.jl @@ -1,6 +1,6 @@ export AMPGO02 -function AMPGO02(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function AMPGO02(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) return sin(x[1]) + sin(10 // 3 * x[1]) end diff --git a/src/ADNLPProblems/AMPGO03.jl b/src/ADNLPProblems/AMPGO03.jl index 09e90b69..a0202f1a 100644 --- a/src/ADNLPProblems/AMPGO03.jl +++ b/src/ADNLPProblems/AMPGO03.jl @@ -1,6 +1,6 @@ export AMPGO03 -function AMPGO03(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function AMPGO03(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return -( diff --git a/src/ADNLPProblems/AMPGO04.jl b/src/ADNLPProblems/AMPGO04.jl index 84fad47f..dc1bbc91 100644 --- a/src/ADNLPProblems/AMPGO04.jl +++ b/src/ADNLPProblems/AMPGO04.jl @@ -1,6 +1,6 @@ export AMPGO04 -function AMPGO04(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function AMPGO04(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return -(16 * x[1]^2 - 24 * x[1] + 5) * exp(-x[1]) diff --git a/src/ADNLPProblems/AMPGO05.jl b/src/ADNLPProblems/AMPGO05.jl index 1a2a7b10..e1480104 100644 --- a/src/ADNLPProblems/AMPGO05.jl +++ b/src/ADNLPProblems/AMPGO05.jl @@ -1,6 +1,6 @@ export AMPGO05 -function AMPGO05(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function AMPGO05(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return -(14 // 10 - 3 * x[1]) * sin(18 * x[1]) diff --git a/src/ADNLPProblems/AMPGO06.jl b/src/ADNLPProblems/AMPGO06.jl index e62a6293..6aeac9ed 100644 --- a/src/ADNLPProblems/AMPGO06.jl +++ b/src/ADNLPProblems/AMPGO06.jl @@ -1,6 +1,6 @@ export AMPGO06 -function AMPGO06(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function AMPGO06(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return -(x[1] + sin(x[1])) * exp(-x[1]^2) diff --git a/src/ADNLPProblems/AMPGO07.jl b/src/ADNLPProblems/AMPGO07.jl index a373e799..a61bdfdf 100644 --- a/src/ADNLPProblems/AMPGO07.jl +++ b/src/ADNLPProblems/AMPGO07.jl @@ -1,6 +1,6 @@ export AMPGO07 -function AMPGO07(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function AMPGO07(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) return (x[1] <= 0) * convert(eltype(x), Inf) + sin(x[1]) + diff --git a/src/ADNLPProblems/AMPGO08.jl b/src/ADNLPProblems/AMPGO08.jl index de8c89af..1b65eb1f 100644 --- a/src/ADNLPProblems/AMPGO08.jl +++ b/src/ADNLPProblems/AMPGO08.jl @@ -1,6 +1,6 @@ export AMPGO08 -function AMPGO08(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function AMPGO08(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return -( diff --git a/src/ADNLPProblems/AMPGO09.jl b/src/ADNLPProblems/AMPGO09.jl index 35e5eb3f..cba53917 100644 --- a/src/ADNLPProblems/AMPGO09.jl +++ b/src/ADNLPProblems/AMPGO09.jl @@ -1,6 +1,6 @@ export AMPGO09 -function AMPGO09(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function AMPGO09(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) return sin(x[1]) + sin(2 // 3 * x[1]) end diff --git a/src/ADNLPProblems/AMPGO10.jl b/src/ADNLPProblems/AMPGO10.jl index a9827792..8cac52ce 100644 --- a/src/ADNLPProblems/AMPGO10.jl +++ b/src/ADNLPProblems/AMPGO10.jl @@ -1,6 +1,6 @@ export AMPGO10 -function AMPGO10(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function AMPGO10(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return -x[1] * sin(x[1]) diff --git a/src/ADNLPProblems/AMPGO11.jl b/src/ADNLPProblems/AMPGO11.jl index eed53d9c..811710d7 100644 --- a/src/ADNLPProblems/AMPGO11.jl +++ b/src/ADNLPProblems/AMPGO11.jl @@ -1,6 +1,6 @@ export AMPGO11 -function AMPGO11(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function AMPGO11(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return 2 * cos(x[1]) + cos(2 * x[1]) diff --git a/src/ADNLPProblems/AMPGO12.jl b/src/ADNLPProblems/AMPGO12.jl index bd87861f..784f2d13 100644 --- a/src/ADNLPProblems/AMPGO12.jl +++ b/src/ADNLPProblems/AMPGO12.jl @@ -1,6 +1,6 @@ export AMPGO12 -function AMPGO12(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function AMPGO12(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return sin(x[1])^3 + cos(x[1])^3 diff --git a/src/ADNLPProblems/AMPGO13.jl b/src/ADNLPProblems/AMPGO13.jl index 976be535..2979c0e2 100644 --- a/src/ADNLPProblems/AMPGO13.jl +++ b/src/ADNLPProblems/AMPGO13.jl @@ -1,6 +1,6 @@ export AMPGO13 -function AMPGO13(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function AMPGO13(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) # return 0 < x[1] < 1 ? -(x[1]^(2 // 3) + (1 - x[1]^2)^(1 // 3)) : convert(eltype(x), Inf) return (x[1] ≤ 0) * convert(eltype(x), Inf) + (x[1] ≥ 1) * convert(eltype(x), Inf) - diff --git a/src/ADNLPProblems/AMPGO14.jl b/src/ADNLPProblems/AMPGO14.jl index 7fcc1c03..bc817104 100644 --- a/src/ADNLPProblems/AMPGO14.jl +++ b/src/ADNLPProblems/AMPGO14.jl @@ -1,6 +1,6 @@ export AMPGO14 -function AMPGO14(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function AMPGO14(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return -exp(-x[1]) * sin(2 * (pi * x[1])) diff --git a/src/ADNLPProblems/AMPGO15.jl b/src/ADNLPProblems/AMPGO15.jl index e898c875..28abfe5b 100644 --- a/src/ADNLPProblems/AMPGO15.jl +++ b/src/ADNLPProblems/AMPGO15.jl @@ -1,6 +1,6 @@ export AMPGO15 -function AMPGO15(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function AMPGO15(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return (x[1]^2 - 5 * x[1] + 6) / (x[1]^2 + 1) diff --git a/src/ADNLPProblems/AMPGO18.jl b/src/ADNLPProblems/AMPGO18.jl index 0f6cb0c9..c9b98fb0 100644 --- a/src/ADNLPProblems/AMPGO18.jl +++ b/src/ADNLPProblems/AMPGO18.jl @@ -1,6 +1,6 @@ export AMPGO18 -function AMPGO18(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function AMPGO18(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) # return x[1] <= 3 ? (x[1] - 2)^2 : log(x[1] - 2) + log(x[1] - 2) + 1 return (x[1] <= 3) * (x[1] - 2)^2 + (x[1] > 3) * (2 * log(abs(x[1] - 2)) + 1) diff --git a/src/ADNLPProblems/AMPGO20.jl b/src/ADNLPProblems/AMPGO20.jl index 10e1ea19..d4dfb0a3 100644 --- a/src/ADNLPProblems/AMPGO20.jl +++ b/src/ADNLPProblems/AMPGO20.jl @@ -1,6 +1,6 @@ export AMPGO20 -function AMPGO20(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function AMPGO20(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return -(x[1] - sin(x[1])) * exp(-x[1]^2) diff --git a/src/ADNLPProblems/AMPGO21.jl b/src/ADNLPProblems/AMPGO21.jl index 4279b866..1167e95e 100644 --- a/src/ADNLPProblems/AMPGO21.jl +++ b/src/ADNLPProblems/AMPGO21.jl @@ -1,6 +1,6 @@ export AMPGO21 -function AMPGO21(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function AMPGO21(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return (x[1] * sin(x[1])) + (x[1] * cos(2 * x[1])) diff --git a/src/ADNLPProblems/AMPGO22.jl b/src/ADNLPProblems/AMPGO22.jl index 99e19843..c535000a 100644 --- a/src/ADNLPProblems/AMPGO22.jl +++ b/src/ADNLPProblems/AMPGO22.jl @@ -1,6 +1,6 @@ export AMPGO22 -function AMPGO22(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function AMPGO22(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return exp(-3 * x[1]) - sin(x[1])^3 diff --git a/src/ADNLPProblems/BOX2.jl b/src/ADNLPProblems/BOX2.jl index 12dc886f..9e7cd3e8 100644 --- a/src/ADNLPProblems/BOX2.jl +++ b/src/ADNLPProblems/BOX2.jl @@ -3,7 +3,7 @@ export BOX2 function BOX2( args...; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, m::Int = 10, kwargs..., ) where {T} diff --git a/src/ADNLPProblems/BOX3.jl b/src/ADNLPProblems/BOX3.jl index 723af5f3..bcdce6cd 100644 --- a/src/ADNLPProblems/BOX3.jl +++ b/src/ADNLPProblems/BOX3.jl @@ -3,7 +3,7 @@ export BOX3 function BOX3( args...; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, m::Int = 2n, kwargs..., ) where {T} diff --git a/src/ADNLPProblems/Dus2_1.jl b/src/ADNLPProblems/Dus2_1.jl index 2d0a99a3..a17cd2f6 100644 --- a/src/ADNLPProblems/Dus2_1.jl +++ b/src/ADNLPProblems/Dus2_1.jl @@ -1,6 +1,6 @@ export Dus2_1 -function Dus2_1(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function Dus2_1(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return exp(x[1] * (x[1] - 1)) diff --git a/src/ADNLPProblems/Dus2_3.jl b/src/ADNLPProblems/Dus2_3.jl index 8336b3c0..017fe09b 100644 --- a/src/ADNLPProblems/Dus2_3.jl +++ b/src/ADNLPProblems/Dus2_3.jl @@ -1,6 +1,6 @@ export Dus2_3 -function Dus2_3(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function Dus2_3(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return 1 - (1 / (5 * (x[1]^2) - 6 * x[1] + 5)) diff --git a/src/ADNLPProblems/Dus2_9.jl b/src/ADNLPProblems/Dus2_9.jl index ff2b852d..4c21a233 100644 --- a/src/ADNLPProblems/Dus2_9.jl +++ b/src/ADNLPProblems/Dus2_9.jl @@ -1,6 +1,6 @@ export Dus2_9 -function Dus2_9(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function Dus2_9(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return 1 - 12 * x[1] + 15 // 2 * x[1]^2 - x[1]^3 diff --git a/src/ADNLPProblems/Duscube.jl b/src/ADNLPProblems/Duscube.jl index c87e0e74..8cd84427 100644 --- a/src/ADNLPProblems/Duscube.jl +++ b/src/ADNLPProblems/Duscube.jl @@ -1,6 +1,6 @@ export Duscube -function Duscube(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function Duscube(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return x[1]^3 - (x[1] - 4)^2 - 100 * x[1] diff --git a/src/ADNLPProblems/NZF1.jl b/src/ADNLPProblems/NZF1.jl index d0ca61a8..5d55ca9c 100644 --- a/src/ADNLPProblems/NZF1.jl +++ b/src/ADNLPProblems/NZF1.jl @@ -1,6 +1,6 @@ export NZF1 -function NZF1(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function NZF1(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} nbis = max(2, div(n, 13)) n = 13 * nbis function f(x; nbis = nbis, n = n) diff --git a/src/ADNLPProblems/aircrfta.jl b/src/ADNLPProblems/aircrfta.jl index 27fd845e..744888ef 100644 --- a/src/ADNLPProblems/aircrfta.jl +++ b/src/ADNLPProblems/aircrfta.jl @@ -1,6 +1,6 @@ export aircrfta -function aircrfta(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function aircrfta(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) return zero(eltype(x)) end diff --git a/src/ADNLPProblems/allinit.jl b/src/ADNLPProblems/allinit.jl index 0bd83808..62c00512 100644 --- a/src/ADNLPProblems/allinit.jl +++ b/src/ADNLPProblems/allinit.jl @@ -1,6 +1,6 @@ export allinit -function allinit(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function allinit(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) return x[3] - 1 + x[1]^2 + x[2]^2 + (x[3] + x[4])^2 + sin(x[3])^2 + x[1]^2 * x[2]^2 + x[4] - 3 + sin(x[3])^2 + diff --git a/src/ADNLPProblems/allinitc.jl b/src/ADNLPProblems/allinitc.jl index c36ca6d3..d48cae5d 100644 --- a/src/ADNLPProblems/allinitc.jl +++ b/src/ADNLPProblems/allinitc.jl @@ -1,6 +1,6 @@ export allinitc -function allinitc(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function allinitc(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) return x[3] - 1 + x[1]^2 + x[2]^2 + (x[3] + x[4])^2 + sin(x[3])^2 + x[1]^2 * x[2]^2 + x[4] - 3 + sin(x[3])^2 + diff --git a/src/ADNLPProblems/allinitu.jl b/src/ADNLPProblems/allinitu.jl index 72918cfe..730e1044 100644 --- a/src/ADNLPProblems/allinitu.jl +++ b/src/ADNLPProblems/allinitu.jl @@ -1,6 +1,6 @@ export allinitu -function allinitu(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function allinitu(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) return x[3] - 1 + x[1]^2 + x[2]^2 + (x[3] + x[4])^2 + sin(x[3])^2 + x[1]^2 * x[2]^2 + x[4] - 3 + sin(x[3])^2 + diff --git a/src/ADNLPProblems/alsotame.jl b/src/ADNLPProblems/alsotame.jl index 5c7a19af..e4124535 100644 --- a/src/ADNLPProblems/alsotame.jl +++ b/src/ADNLPProblems/alsotame.jl @@ -1,6 +1,6 @@ export alsotame -function alsotame(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function alsotame(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) x, y = x[1], x[2] return exp(x - 2 * y) diff --git a/src/ADNLPProblems/argauss.jl b/src/ADNLPProblems/argauss.jl index 66aefe2f..14ddfe7e 100644 --- a/src/ADNLPProblems/argauss.jl +++ b/src/ADNLPProblems/argauss.jl @@ -1,6 +1,6 @@ export argauss -function argauss(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function argauss(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} xinit = T[ 0.4 1.0 diff --git a/src/ADNLPProblems/arglina.jl b/src/ADNLPProblems/arglina.jl index 8710eca7..64bd5c20 100644 --- a/src/ADNLPProblems/arglina.jl +++ b/src/ADNLPProblems/arglina.jl @@ -8,7 +8,7 @@ end function arglina( ::Val{:nlp}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} function f(x; n = length(x)) @@ -24,7 +24,7 @@ end function arglina( ::Val{:nls}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} function F!(r, x) diff --git a/src/ADNLPProblems/arglinb.jl b/src/ADNLPProblems/arglinb.jl index 9f172b86..10deffad 100644 --- a/src/ADNLPProblems/arglinb.jl +++ b/src/ADNLPProblems/arglinb.jl @@ -8,7 +8,7 @@ end function arglinb( ::Val{:nlp}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} function f(x; n = length(x)) @@ -23,7 +23,7 @@ end function arglinb( ::Val{:nls}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} function F!(r, x; n = length(x)) diff --git a/src/ADNLPProblems/arglinc.jl b/src/ADNLPProblems/arglinc.jl index ee72e1b3..31eb48d0 100644 --- a/src/ADNLPProblems/arglinc.jl +++ b/src/ADNLPProblems/arglinc.jl @@ -1,6 +1,6 @@ export arglinc -function arglinc(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function arglinc(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x; n = length(x)) m = 2 * n sj = sum(j * x[j] for j = 2:(n - 1)) diff --git a/src/ADNLPProblems/argtrig.jl b/src/ADNLPProblems/argtrig.jl index ece341f4..4593bf9e 100644 --- a/src/ADNLPProblems/argtrig.jl +++ b/src/ADNLPProblems/argtrig.jl @@ -1,6 +1,6 @@ export argtrig -function argtrig(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function argtrig(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x; n = length(x)) return n - sum(cos(x[j]) + j * (1 - cos(x[j])) - sin(x[j]) for j = 1:n) end diff --git a/src/ADNLPProblems/arwhead.jl b/src/ADNLPProblems/arwhead.jl index ceb1728d..5ea9f6e3 100644 --- a/src/ADNLPProblems/arwhead.jl +++ b/src/ADNLPProblems/arwhead.jl @@ -1,6 +1,6 @@ export arwhead -function arwhead(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function arwhead(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} n < 2 && @warn("arwhead: number of variables must be ≥ 2") n = max(2, n) function f(x; n = length(x)) diff --git a/src/ADNLPProblems/avion2.jl b/src/ADNLPProblems/avion2.jl index e1157cab..343491b1 100644 --- a/src/ADNLPProblems/avion2.jl +++ b/src/ADNLPProblems/avion2.jl @@ -1,6 +1,6 @@ export avion2 -function avion2(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function avion2(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) SR, LR, diff --git a/src/ADNLPProblems/bard.jl b/src/ADNLPProblems/bard.jl index 2d331efe..3fa0ee76 100644 --- a/src/ADNLPProblems/bard.jl +++ b/src/ADNLPProblems/bard.jl @@ -5,7 +5,7 @@ function bard(; use_nls::Bool = false, kwargs...) return bard(Val(model); kwargs...) end -function bard(::Val{:nlp}; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function bard(::Val{:nlp}; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} y = Rational{Int}[0.14 0.18 0.22 0.25 0.29 0.32 0.35 0.39 0.37 0.58 0.73 0.16 1.34 2.10 4.39] function f(x) return 1 // 2 * sum(y[i] - (x[1] + i / ((16 - i) * x[2] + min(i, 16 - i) * x[3])) for i = 1:15) @@ -14,7 +14,7 @@ function bard(::Val{:nlp}; n::Int = default_nvar, type::Val{T} = Val(Float64), k return ADNLPModels.ADNLPModel(f, x0, name = "bard"; kwargs...) end -function bard(::Val{:nls}; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function bard(::Val{:nls}; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} y = Rational{Int}[0.14 0.18 0.22 0.25 0.29 0.32 0.35 0.39 0.37 0.58 0.73 0.16 1.34 2.10 4.39] function F!(r, x, y = y) for i = 1:15 diff --git a/src/ADNLPProblems/bdqrtic.jl b/src/ADNLPProblems/bdqrtic.jl index 58d17a9c..c9f87259 100644 --- a/src/ADNLPProblems/bdqrtic.jl +++ b/src/ADNLPProblems/bdqrtic.jl @@ -8,7 +8,7 @@ end function bdqrtic( ::Val{:nlp}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} n < 5 && @warn("bdqrtic: number of variables must be ≥ 5") @@ -26,7 +26,7 @@ end function bdqrtic( ::Val{:nls}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} n < 5 && @warn("bdqrtic: number of variables must be ≥ 5") diff --git a/src/ADNLPProblems/beale.jl b/src/ADNLPProblems/beale.jl index 7eba0665..292151f6 100644 --- a/src/ADNLPProblems/beale.jl +++ b/src/ADNLPProblems/beale.jl @@ -5,7 +5,7 @@ function beale(; use_nls::Bool = false, kwargs...) return beale(Val(model); kwargs...) end -function beale(::Val{:nlp}; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function beale(::Val{:nlp}; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) return 1 // 2 * (15 // 10 - x[1] * (1 - x[2]))^2 + 1 // 2 * (225 // 100 - x[1] * (1 - x[2]^2))^2 + @@ -15,7 +15,7 @@ function beale(::Val{:nlp}; n::Int = default_nvar, type::Val{T} = Val(Float64), return ADNLPModels.ADNLPModel(f, x0, name = "beale"; kwargs...) end -function beale(::Val{:nls}; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function beale(::Val{:nls}; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function F!(r, x) r[1] = 15 // 10 - x[1] * (1 - x[2]) r[2] = 225 // 100 - x[1] * (1 - x[2]^2) diff --git a/src/ADNLPProblems/bearing.jl b/src/ADNLPProblems/bearing.jl index 12e9364b..40ab56ca 100644 --- a/src/ADNLPProblems/bearing.jl +++ b/src/ADNLPProblems/bearing.jl @@ -4,7 +4,7 @@ function bearing(; n::Int = default_nvar, nx::Int = Int(round(sqrt(max(n, 1)))) - 2, ny::Int = Int(round(sqrt(max(n, 1)))) - 2, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} # nx > 0 # grid points in 1st direction diff --git a/src/ADNLPProblems/bennett5.jl b/src/ADNLPProblems/bennett5.jl index c71e6505..45b15c15 100644 --- a/src/ADNLPProblems/bennett5.jl +++ b/src/ADNLPProblems/bennett5.jl @@ -8,7 +8,7 @@ end function bennett5( ::Val{:nlp}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} y = Rational{Int}[ @@ -178,7 +178,7 @@ end function bennett5( ::Val{:nls}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} y = Rational{Int}[ diff --git a/src/ADNLPProblems/biggs5.jl b/src/ADNLPProblems/biggs5.jl index 36eda8e2..7583dff6 100644 --- a/src/ADNLPProblems/biggs5.jl +++ b/src/ADNLPProblems/biggs5.jl @@ -2,7 +2,7 @@ export biggs5 function biggs5(; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, m::Int = 13, kwargs..., ) where {T} diff --git a/src/ADNLPProblems/biggs6.jl b/src/ADNLPProblems/biggs6.jl index 8acc1163..f8e22e26 100644 --- a/src/ADNLPProblems/biggs6.jl +++ b/src/ADNLPProblems/biggs6.jl @@ -2,7 +2,7 @@ export biggs6 function biggs6(; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, m::Int = 13, kwargs..., ) where {T} diff --git a/src/ADNLPProblems/booth.jl b/src/ADNLPProblems/booth.jl index 33f23cf1..b81d8e67 100644 --- a/src/ADNLPProblems/booth.jl +++ b/src/ADNLPProblems/booth.jl @@ -1,6 +1,6 @@ export booth -function booth(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function booth(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) return zero(eltype(x)) end diff --git a/src/ADNLPProblems/boxbod.jl b/src/ADNLPProblems/boxbod.jl index 46d081fc..b420eebf 100644 --- a/src/ADNLPProblems/boxbod.jl +++ b/src/ADNLPProblems/boxbod.jl @@ -8,7 +8,7 @@ end function boxbod( ::Val{:nlp}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} y = Rational{Int}[ @@ -30,7 +30,7 @@ end function boxbod( ::Val{:nls}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} y = Rational{Int}[ diff --git a/src/ADNLPProblems/bqp1var.jl b/src/ADNLPProblems/bqp1var.jl index 085e5cde..2c315737 100644 --- a/src/ADNLPProblems/bqp1var.jl +++ b/src/ADNLPProblems/bqp1var.jl @@ -1,6 +1,6 @@ export bqp1var -function bqp1var(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function bqp1var(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) return x[1] + x[1]^2 end diff --git a/src/ADNLPProblems/britgas.jl b/src/ADNLPProblems/britgas.jl index 9453a63d..8ade774a 100644 --- a/src/ADNLPProblems/britgas.jl +++ b/src/ADNLPProblems/britgas.jl @@ -1,6 +1,6 @@ export britgas -function britgas(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function britgas(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} hours = T(8) nodes = T(23) theta = T(0.75) diff --git a/src/ADNLPProblems/brownal.jl b/src/ADNLPProblems/brownal.jl index 2fefab48..cad75216 100644 --- a/src/ADNLPProblems/brownal.jl +++ b/src/ADNLPProblems/brownal.jl @@ -8,7 +8,7 @@ end function brownal( ::Val{:nlp}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} function f(x; n = length(x)) @@ -23,7 +23,7 @@ end function brownal( ::Val{:nls}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} function F!(r, x; n = length(x)) diff --git a/src/ADNLPProblems/brownbs.jl b/src/ADNLPProblems/brownbs.jl index e71ef325..c68e9b86 100644 --- a/src/ADNLPProblems/brownbs.jl +++ b/src/ADNLPProblems/brownbs.jl @@ -8,7 +8,7 @@ end function brownbs( ::Val{:nlp}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} function f(x) @@ -23,7 +23,7 @@ end function brownbs( ::Val{:nls}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} function F!(r, x) diff --git a/src/ADNLPProblems/brownden.jl b/src/ADNLPProblems/brownden.jl index 3ea960a3..79a5941c 100644 --- a/src/ADNLPProblems/brownden.jl +++ b/src/ADNLPProblems/brownden.jl @@ -8,7 +8,7 @@ end function brownden( ::Val{:nlp}; m::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} m < 4 && @warn("brownden: must have m ≥ 4") @@ -30,7 +30,7 @@ end function brownden( ::Val{:nls}; m::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} m < 4 && @warn("brownden: must have m ≥ 4") diff --git a/src/ADNLPProblems/broyden3d.jl b/src/ADNLPProblems/broyden3d.jl index e6ab1fb0..07bc9d97 100644 --- a/src/ADNLPProblems/broyden3d.jl +++ b/src/ADNLPProblems/broyden3d.jl @@ -8,7 +8,7 @@ end function broyden3d( ::Val{:nlp}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} function f(x; n = length(x)) @@ -23,7 +23,7 @@ end function broyden3d( ::Val{:nls}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} function F!(r, x; n = length(x)) diff --git a/src/ADNLPProblems/broydn7d.jl b/src/ADNLPProblems/broydn7d.jl index 8b1baecc..0ca69b21 100644 --- a/src/ADNLPProblems/broydn7d.jl +++ b/src/ADNLPProblems/broydn7d.jl @@ -1,6 +1,6 @@ export broydn7d -function broydn7d(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function broydn7d(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} mod(n, 2) > 0 && @warn("broydn7d: number of variables adjusted to be even") n2 = max(1, div(n, 2)) n = 2 * n2 diff --git a/src/ADNLPProblems/brybnd.jl b/src/ADNLPProblems/brybnd.jl index 9f055c57..4b743964 100644 --- a/src/ADNLPProblems/brybnd.jl +++ b/src/ADNLPProblems/brybnd.jl @@ -8,7 +8,7 @@ end function brybnd( ::Val{:nlp}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} function f(x; n = length(x)) @@ -28,7 +28,7 @@ end function brybnd( ::Val{:nls}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} function F!(r, x; n = length(x)) diff --git a/src/ADNLPProblems/bt1.jl b/src/ADNLPProblems/bt1.jl index 32d98242..a329b2aa 100644 --- a/src/ADNLPProblems/bt1.jl +++ b/src/ADNLPProblems/bt1.jl @@ -1,6 +1,6 @@ export bt1 -function bt1(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function bt1(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return 100 * x[1]^2 + 100 * x[2]^2 - x[1] - 100 diff --git a/src/ADNLPProblems/camshape.jl b/src/ADNLPProblems/camshape.jl index c57a10e4..e16a5cbb 100644 --- a/src/ADNLPProblems/camshape.jl +++ b/src/ADNLPProblems/camshape.jl @@ -1,6 +1,6 @@ export camshape -function camshape(args...; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function camshape(args...; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} R_min = 1 R_max = 2 R_v = 1 diff --git a/src/ADNLPProblems/catenary.jl b/src/ADNLPProblems/catenary.jl index e2d953b1..bcf82223 100644 --- a/src/ADNLPProblems/catenary.jl +++ b/src/ADNLPProblems/catenary.jl @@ -1,6 +1,6 @@ export catenary -function catenary(args...; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function catenary(args...; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} (n % 3 == 0) || @warn("catenary: number of variables adjusted to be a multiple of 3") n = 3 * max(1, div(n, 3)) (n < 6) || @warn("catenary: number of variables adjusted to be greater or equal to 6") diff --git a/src/ADNLPProblems/chain.jl b/src/ADNLPProblems/chain.jl index d511f14a..f92a5920 100644 --- a/src/ADNLPProblems/chain.jl +++ b/src/ADNLPProblems/chain.jl @@ -1,6 +1,6 @@ export chain -function chain(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function chain(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} nh = max(2, div(n - 4, 4)) L = 4 diff --git a/src/ADNLPProblems/chainwoo.jl b/src/ADNLPProblems/chainwoo.jl index 15189bb8..e7d93586 100644 --- a/src/ADNLPProblems/chainwoo.jl +++ b/src/ADNLPProblems/chainwoo.jl @@ -1,6 +1,6 @@ export chainwoo -function chainwoo(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function chainwoo(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} (n % 4 == 0) || @warn("chainwoo: number of variables adjusted to be a multiple of 4") n = 4 * max(1, div(n, 4)) function f(x; n = length(x)) diff --git a/src/ADNLPProblems/channel.jl b/src/ADNLPProblems/channel.jl index 0b323fcf..154f6ebd 100644 --- a/src/ADNLPProblems/channel.jl +++ b/src/ADNLPProblems/channel.jl @@ -1,6 +1,6 @@ export channel -function channel(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function channel(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} nh = max(2, div(n, 8)) nc = 4 diff --git a/src/ADNLPProblems/chnrosnb_mod.jl b/src/ADNLPProblems/chnrosnb_mod.jl index d0b2f107..fc4b9c19 100644 --- a/src/ADNLPProblems/chnrosnb_mod.jl +++ b/src/ADNLPProblems/chnrosnb_mod.jl @@ -1,6 +1,6 @@ export chnrosnb_mod -function chnrosnb_mod(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function chnrosnb_mod(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} n < 2 && @warn("chnrosnb: number of variables must be ≥ 2") n = max(2, n) function f(x; n = length(x)) diff --git a/src/ADNLPProblems/chwirut1.jl b/src/ADNLPProblems/chwirut1.jl index c4d90b9e..2d638f6f 100644 --- a/src/ADNLPProblems/chwirut1.jl +++ b/src/ADNLPProblems/chwirut1.jl @@ -8,7 +8,7 @@ end function chwirut1( ::Val{:nlp}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} y = Rational{Int}[ @@ -238,7 +238,7 @@ end function chwirut1( ::Val{:nls}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} y = Rational{Int}[ diff --git a/src/ADNLPProblems/chwirut2.jl b/src/ADNLPProblems/chwirut2.jl index fd6ab3bf..e4af681e 100644 --- a/src/ADNLPProblems/chwirut2.jl +++ b/src/ADNLPProblems/chwirut2.jl @@ -8,7 +8,7 @@ end function chwirut2( ::Val{:nlp}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} y = Rational{Int}[ @@ -78,7 +78,7 @@ end function chwirut2( ::Val{:nls}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} y = Rational{Int}[ diff --git a/src/ADNLPProblems/cliff.jl b/src/ADNLPProblems/cliff.jl index 474af737..aa30347d 100644 --- a/src/ADNLPProblems/cliff.jl +++ b/src/ADNLPProblems/cliff.jl @@ -1,6 +1,6 @@ export cliff -function cliff(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function cliff(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) return (1 // 100 * x[1] - 3 // 100)^2 - x[1] + x[2] + exp(20 * (x[1] - x[2])) end diff --git a/src/ADNLPProblems/clnlbeam.jl b/src/ADNLPProblems/clnlbeam.jl index 946f9c5a..fc46d8e9 100644 --- a/src/ADNLPProblems/clnlbeam.jl +++ b/src/ADNLPProblems/clnlbeam.jl @@ -1,6 +1,6 @@ export clnlbeam -function clnlbeam(args...; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function clnlbeam(args...; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} N = div(n - 3, 3) h = 1 // N alpha = 350 diff --git a/src/ADNLPProblems/clplatea.jl b/src/ADNLPProblems/clplatea.jl index 78dc8a9b..a9ba039e 100644 --- a/src/ADNLPProblems/clplatea.jl +++ b/src/ADNLPProblems/clplatea.jl @@ -2,7 +2,7 @@ export clplatea function clplatea(; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, wght = -0.1, kwargs..., ) where {T} diff --git a/src/ADNLPProblems/clplateb.jl b/src/ADNLPProblems/clplateb.jl index 51c6d8be..ecc12dea 100644 --- a/src/ADNLPProblems/clplateb.jl +++ b/src/ADNLPProblems/clplateb.jl @@ -2,7 +2,7 @@ export clplateb function clplateb(; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, wght = -0.1, kwargs..., ) where {T} diff --git a/src/ADNLPProblems/clplatec.jl b/src/ADNLPProblems/clplatec.jl index 373ec8fd..a72a7738 100644 --- a/src/ADNLPProblems/clplatec.jl +++ b/src/ADNLPProblems/clplatec.jl @@ -2,7 +2,7 @@ export clplatec function clplatec(; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, wght = -0.1, r = 0.99, l = 0.01, diff --git a/src/ADNLPProblems/controlinvestment.jl b/src/ADNLPProblems/controlinvestment.jl index c5112b67..bf711c7a 100644 --- a/src/ADNLPProblems/controlinvestment.jl +++ b/src/ADNLPProblems/controlinvestment.jl @@ -3,7 +3,7 @@ export controlinvestment function controlinvestment( args...; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} N = div(n, 2) diff --git a/src/ADNLPProblems/cosine.jl b/src/ADNLPProblems/cosine.jl index 70a6b46a..ace52d67 100644 --- a/src/ADNLPProblems/cosine.jl +++ b/src/ADNLPProblems/cosine.jl @@ -1,6 +1,6 @@ export cosine -function cosine(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function cosine(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} n < 2 && @warn("cosine: number of variables must be ≥ 2") n = max(2, n) function f(x; n = length(x)) diff --git a/src/ADNLPProblems/cragglvy.jl b/src/ADNLPProblems/cragglvy.jl index 6a36721b..239b5089 100644 --- a/src/ADNLPProblems/cragglvy.jl +++ b/src/ADNLPProblems/cragglvy.jl @@ -1,6 +1,6 @@ export cragglvy -function cragglvy(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function cragglvy(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} n < 2 && @warn("cragglvy: number of variables must be ≥ 2") n = max(2, n) function f(x; n = length(x)) diff --git a/src/ADNLPProblems/cragglvy2.jl b/src/ADNLPProblems/cragglvy2.jl index 897ec3f9..0411752d 100644 --- a/src/ADNLPProblems/cragglvy2.jl +++ b/src/ADNLPProblems/cragglvy2.jl @@ -1,6 +1,6 @@ export cragglvy2 -function cragglvy2(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function cragglvy2(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} n < 2 && @warn("cragglvy2: number of variables must be ≥ 2") n = max(2, n) function f(x; n = length(x)) diff --git a/src/ADNLPProblems/curly.jl b/src/ADNLPProblems/curly.jl index 38357b54..7fd730ca 100644 --- a/src/ADNLPProblems/curly.jl +++ b/src/ADNLPProblems/curly.jl @@ -2,7 +2,7 @@ export curly function curly(; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, b::Int = 10, kwargs..., ) where {T} diff --git a/src/ADNLPProblems/curly10.jl b/src/ADNLPProblems/curly10.jl index 09449c48..70ecd81c 100644 --- a/src/ADNLPProblems/curly10.jl +++ b/src/ADNLPProblems/curly10.jl @@ -1,6 +1,6 @@ export curly10 -function curly10(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function curly10(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} n < 2 && @warn("curly: number of variables must be ≥ 2") n = max(2, n) b = 10 diff --git a/src/ADNLPProblems/curly20.jl b/src/ADNLPProblems/curly20.jl index 2b69dbc7..756cd5d6 100644 --- a/src/ADNLPProblems/curly20.jl +++ b/src/ADNLPProblems/curly20.jl @@ -1,6 +1,6 @@ export curly20 -function curly20(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function curly20(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} n < 2 && @warn("curly: number of variables must be ≥ 2") n = max(2, n) b = 20 diff --git a/src/ADNLPProblems/curly30.jl b/src/ADNLPProblems/curly30.jl index 084a8ef7..3d7cc6bf 100644 --- a/src/ADNLPProblems/curly30.jl +++ b/src/ADNLPProblems/curly30.jl @@ -1,6 +1,6 @@ export curly30 -function curly30(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function curly30(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} n < 2 && @warn("curly: number of variables must be ≥ 2") n = max(2, n) b = 30 diff --git a/src/ADNLPProblems/danwood.jl b/src/ADNLPProblems/danwood.jl index 999dac9c..ebdc7be4 100644 --- a/src/ADNLPProblems/danwood.jl +++ b/src/ADNLPProblems/danwood.jl @@ -8,7 +8,7 @@ end function danwood( ::Val{:nlp}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} y = Rational{Int}[ @@ -30,7 +30,7 @@ end function danwood( ::Val{:nls}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} y = Rational{Int}[ diff --git a/src/ADNLPProblems/dixmaan_efgh.jl b/src/ADNLPProblems/dixmaan_efgh.jl index eb73da5e..325a3c08 100644 --- a/src/ADNLPProblems/dixmaan_efgh.jl +++ b/src/ADNLPProblems/dixmaan_efgh.jl @@ -2,7 +2,7 @@ export dixmaane, dixmaanf, dixmaang, dixmaanh function dixmaane(; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, α = 1, β = 0, γ = 125 // 1000, @@ -23,7 +23,7 @@ function dixmaane(; return ADNLPModels.ADNLPModel(f, x0, name = "dixmaane"; kwargs...) end -dixmaanf(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} = dixmaane( +dixmaanf(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} = dixmaane( n = n, type = type, α = 1, @@ -34,7 +34,7 @@ dixmaanf(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where kwargs..., ) -dixmaang(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} = dixmaane( +dixmaang(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} = dixmaane( n = n, type = type, α = 1, @@ -45,7 +45,7 @@ dixmaang(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where kwargs..., ) -dixmaanh(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} = dixmaane( +dixmaanh(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} = dixmaane( n = n, type = type, α = 1, diff --git a/src/ADNLPProblems/dixmaan_ijkl.jl b/src/ADNLPProblems/dixmaan_ijkl.jl index 0a270d75..f1d86948 100644 --- a/src/ADNLPProblems/dixmaan_ijkl.jl +++ b/src/ADNLPProblems/dixmaan_ijkl.jl @@ -2,7 +2,7 @@ export dixmaani, dixmaanj, dixmaank, dixmaanl function dixmaani(; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, α = 1, β = 0, γ = 125 // 1000, @@ -23,7 +23,7 @@ function dixmaani(; return ADNLPModels.ADNLPModel(f, x0, name = "dixmaani"; kwargs...) end -dixmaanj(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} = dixmaani( +dixmaanj(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} = dixmaani( n = n, type = type, α = 1, @@ -34,7 +34,7 @@ dixmaanj(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where kwargs..., ) -dixmaank(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} = dixmaani( +dixmaank(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} = dixmaani( n = n, type = type, α = 1, @@ -45,7 +45,7 @@ dixmaank(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where kwargs..., ) -dixmaanl(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} = dixmaani( +dixmaanl(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} = dixmaani( n = n, type = type, α = 1, diff --git a/src/ADNLPProblems/dixmaan_mnop.jl b/src/ADNLPProblems/dixmaan_mnop.jl index 916da4be..e62e449e 100644 --- a/src/ADNLPProblems/dixmaan_mnop.jl +++ b/src/ADNLPProblems/dixmaan_mnop.jl @@ -2,7 +2,7 @@ export dixmaanm, dixmaann, dixmaano, dixmaanp function dixmaanm(; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, α = 1, β = 0, γ = 125 // 1000, @@ -23,7 +23,7 @@ function dixmaanm(; return ADNLPModels.ADNLPModel(f, x0, name = "dixmaanm"; kwargs...) end -dixmaann(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} = dixmaanm( +dixmaann(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} = dixmaanm( n = n, type = type, α = 1, @@ -34,7 +34,7 @@ dixmaann(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where kwargs..., ) -dixmaano(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} = dixmaanm( +dixmaano(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} = dixmaanm( n = n, type = type, α = 1, @@ -45,7 +45,7 @@ dixmaano(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where kwargs..., ) -dixmaanp(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} = dixmaanm( +dixmaanp(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} = dixmaanm( n = n, type = type, α = 1, diff --git a/src/ADNLPProblems/dixon3dq.jl b/src/ADNLPProblems/dixon3dq.jl index 8f80bb30..f1d575b4 100644 --- a/src/ADNLPProblems/dixon3dq.jl +++ b/src/ADNLPProblems/dixon3dq.jl @@ -8,7 +8,7 @@ end function dixon3dq( ::Val{:nlp}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} function f(x; n = length(x)) @@ -23,7 +23,7 @@ end function dixon3dq( ::Val{:nls}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} function F!(r, x; n = length(x)) diff --git a/src/ADNLPProblems/dqdrtic.jl b/src/ADNLPProblems/dqdrtic.jl index d44c53d3..e4110abd 100644 --- a/src/ADNLPProblems/dqdrtic.jl +++ b/src/ADNLPProblems/dqdrtic.jl @@ -1,6 +1,6 @@ export dqdrtic -function dqdrtic(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function dqdrtic(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x; n = length(x)) return sum(x[i]^2 + 100 * (x[i + 1]^2 + x[i + 2]^2) for i = 1:(n - 2)) end diff --git a/src/ADNLPProblems/dqrtic.jl b/src/ADNLPProblems/dqrtic.jl index 86090d08..4747d5c1 100644 --- a/src/ADNLPProblems/dqrtic.jl +++ b/src/ADNLPProblems/dqrtic.jl @@ -1,6 +1,6 @@ export dqrtic -function dqrtic(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function dqrtic(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x; n = length(x)) return sum((x[i] - i)^4 for i = 1:n) end diff --git a/src/ADNLPProblems/eckerle4.jl b/src/ADNLPProblems/eckerle4.jl index 7010d6c3..cedcf6e3 100644 --- a/src/ADNLPProblems/eckerle4.jl +++ b/src/ADNLPProblems/eckerle4.jl @@ -8,7 +8,7 @@ end function eckerle4( ::Val{:nlp}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} y = Rational{Int}[ @@ -61,7 +61,7 @@ end function eckerle4( ::Val{:nls}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} y = Rational{Int}[ diff --git a/src/ADNLPProblems/edensch.jl b/src/ADNLPProblems/edensch.jl index 9196e791..f28be1e7 100644 --- a/src/ADNLPProblems/edensch.jl +++ b/src/ADNLPProblems/edensch.jl @@ -1,6 +1,6 @@ export edensch -function edensch(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function edensch(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} n < 2 && @warn("edensch: number of variables must be ≥ 2") n = max(2, n) function f(x; n = length(x)) diff --git a/src/ADNLPProblems/eg2.jl b/src/ADNLPProblems/eg2.jl index 969d53fb..0753139a 100644 --- a/src/ADNLPProblems/eg2.jl +++ b/src/ADNLPProblems/eg2.jl @@ -1,6 +1,6 @@ export eg2 -function eg2(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function eg2(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} n < 2 && @warn("eg2: number of variables must be ≥ 2") n = max(2, n) function f(x; n = length(x)) diff --git a/src/ADNLPProblems/elec.jl b/src/ADNLPProblems/elec.jl index dcb55198..054c2659 100644 --- a/src/ADNLPProblems/elec.jl +++ b/src/ADNLPProblems/elec.jl @@ -1,6 +1,6 @@ export elec -function elec(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function elec(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} n = max(2, div(n, 3)) # Define the objective function to minimize function f(x; n = n) diff --git a/src/ADNLPProblems/engval1.jl b/src/ADNLPProblems/engval1.jl index 48b388b6..19b67b15 100644 --- a/src/ADNLPProblems/engval1.jl +++ b/src/ADNLPProblems/engval1.jl @@ -1,6 +1,6 @@ export engval1 -function engval1(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function engval1(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} n < 2 && @warn("engval1: number of variables must be ≥ 2") n = max(2, n) function f(x; n = length(x)) diff --git a/src/ADNLPProblems/enso.jl b/src/ADNLPProblems/enso.jl index d5d4b631..2e65788b 100644 --- a/src/ADNLPProblems/enso.jl +++ b/src/ADNLPProblems/enso.jl @@ -5,7 +5,7 @@ function enso(; use_nls::Bool = false, kwargs...) return enso(Val(model); kwargs...) end -function enso(::Val{:nlp}; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function enso(::Val{:nlp}; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} y = Rational{Int}[ 12.90000 1.000000 11.30000 2.000000 @@ -195,7 +195,7 @@ function enso(::Val{:nlp}; n::Int = default_nvar, type::Val{T} = Val(Float64), k return ADNLPModels.ADNLPModel(f, x0, name = "enso"; kwargs...) end -function enso(::Val{:nls}; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function enso(::Val{:nls}; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} y = Rational{Int}[ 12.90000 1.000000 11.30000 2.000000 diff --git a/src/ADNLPProblems/errinros_mod.jl b/src/ADNLPProblems/errinros_mod.jl index f9d08dd6..c536dcc7 100644 --- a/src/ADNLPProblems/errinros_mod.jl +++ b/src/ADNLPProblems/errinros_mod.jl @@ -8,7 +8,7 @@ end function errinros_mod( ::Val{:nlp}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} n < 2 && @warn("errinros_mod: number of variables must be ≥ 2") @@ -24,7 +24,7 @@ end function errinros_mod( ::Val{:nls}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} n < 2 && @warn("errinros_mod: number of variables must be ≥ 2") diff --git a/src/ADNLPProblems/extrosnb.jl b/src/ADNLPProblems/extrosnb.jl index b791d22f..b92ac60b 100644 --- a/src/ADNLPProblems/extrosnb.jl +++ b/src/ADNLPProblems/extrosnb.jl @@ -1,6 +1,6 @@ export extrosnb -function extrosnb(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function extrosnb(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} n < 2 && @warn("extrosnb: number of variables must be ≥ 2") n = max(2, n) function f(x; n = length(x)) diff --git a/src/ADNLPProblems/fletcbv2.jl b/src/ADNLPProblems/fletcbv2.jl index 861aa8e6..f7a1991c 100644 --- a/src/ADNLPProblems/fletcbv2.jl +++ b/src/ADNLPProblems/fletcbv2.jl @@ -1,6 +1,6 @@ export fletcbv2 -function fletcbv2(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function fletcbv2(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} n < 2 && @warn("fletchbv2: number of variables must be ≥ 2") n = max(2, n) function f(x; n = length(x)) diff --git a/src/ADNLPProblems/fletcbv3_mod.jl b/src/ADNLPProblems/fletcbv3_mod.jl index 7a87f161..830d8c44 100644 --- a/src/ADNLPProblems/fletcbv3_mod.jl +++ b/src/ADNLPProblems/fletcbv3_mod.jl @@ -1,6 +1,6 @@ export fletcbv3_mod -function fletcbv3_mod(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function fletcbv3_mod(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} n < 2 && @warn("fletchbv3_mod: number of variables must be ≥ 2") n = max(2, n) function f(x; n = length(x)) diff --git a/src/ADNLPProblems/fletchcr.jl b/src/ADNLPProblems/fletchcr.jl index 084f9af3..b33fc449 100644 --- a/src/ADNLPProblems/fletchcr.jl +++ b/src/ADNLPProblems/fletchcr.jl @@ -1,6 +1,6 @@ export fletchcr -function fletchcr(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function fletchcr(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} n < 2 && @warn("fletchcr: number of variables must be ≥ 2") n = max(2, n) function f(x; n = length(x)) diff --git a/src/ADNLPProblems/fminsrf2.jl b/src/ADNLPProblems/fminsrf2.jl index cef8f834..c7fe806e 100644 --- a/src/ADNLPProblems/fminsrf2.jl +++ b/src/ADNLPProblems/fminsrf2.jl @@ -1,6 +1,6 @@ export fminsrf2 -function fminsrf2(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function fminsrf2(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} n < 4 && @warn("fminsrf2: number of variables must be ≥ 4") n = max(4, n) diff --git a/src/ADNLPProblems/freuroth.jl b/src/ADNLPProblems/freuroth.jl index 0c9827ee..1bb34766 100644 --- a/src/ADNLPProblems/freuroth.jl +++ b/src/ADNLPProblems/freuroth.jl @@ -8,7 +8,7 @@ end function freuroth( ::Val{:nlp}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} n < 2 && @warn("freuroth: number of variables must be ≥ 2") @@ -29,7 +29,7 @@ end function freuroth( ::Val{:nls}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} n < 2 && @warn("freuroth: number of variables must be ≥ 2") diff --git a/src/ADNLPProblems/gauss1.jl b/src/ADNLPProblems/gauss1.jl index d61e2073..aa4abd17 100644 --- a/src/ADNLPProblems/gauss1.jl +++ b/src/ADNLPProblems/gauss1.jl @@ -8,7 +8,7 @@ end function gauss1( ::Val{:nlp}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} y = Rational{Int}[ @@ -281,7 +281,7 @@ end function gauss1( ::Val{:nls}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} y = Rational{Int}[ diff --git a/src/ADNLPProblems/gauss2.jl b/src/ADNLPProblems/gauss2.jl index 45efdd73..1e22b5c3 100644 --- a/src/ADNLPProblems/gauss2.jl +++ b/src/ADNLPProblems/gauss2.jl @@ -8,7 +8,7 @@ end function gauss2( ::Val{:nlp}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} y = Rational{Int}[ @@ -281,7 +281,7 @@ end function gauss2( ::Val{:nls}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} y = Rational{Int}[ diff --git a/src/ADNLPProblems/gauss3.jl b/src/ADNLPProblems/gauss3.jl index c4baa767..e5e1a78d 100644 --- a/src/ADNLPProblems/gauss3.jl +++ b/src/ADNLPProblems/gauss3.jl @@ -8,7 +8,7 @@ end function gauss3( ::Val{:nlp}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} y = Rational{Int}[ @@ -281,7 +281,7 @@ end function gauss3( ::Val{:nls}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} y = Rational{Int}[ diff --git a/src/ADNLPProblems/gaussian.jl b/src/ADNLPProblems/gaussian.jl index da52a433..3c485d04 100644 --- a/src/ADNLPProblems/gaussian.jl +++ b/src/ADNLPProblems/gaussian.jl @@ -8,7 +8,7 @@ end function gaussian( ::Val{:nlp}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} y = [ @@ -38,7 +38,7 @@ end function gaussian( ::Val{:nls}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} y = [ diff --git a/src/ADNLPProblems/genhumps.jl b/src/ADNLPProblems/genhumps.jl index 0c9349ad..6d5de425 100644 --- a/src/ADNLPProblems/genhumps.jl +++ b/src/ADNLPProblems/genhumps.jl @@ -1,6 +1,6 @@ export genhumps -function genhumps(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function genhumps(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x; n = length(x)) ζ = 20 return sum( diff --git a/src/ADNLPProblems/genrose.jl b/src/ADNLPProblems/genrose.jl index 8056b464..6ff000d6 100644 --- a/src/ADNLPProblems/genrose.jl +++ b/src/ADNLPProblems/genrose.jl @@ -1,6 +1,6 @@ export genrose, rosenbrock -function genrose(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function genrose(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} n < 2 && @warn("genrose: number of variables must be ≥ 2") n = max(2, n) function f(x; n = length(x)) diff --git a/src/ADNLPProblems/genrose_nash.jl b/src/ADNLPProblems/genrose_nash.jl index f327364a..4234c0b9 100644 --- a/src/ADNLPProblems/genrose_nash.jl +++ b/src/ADNLPProblems/genrose_nash.jl @@ -1,6 +1,6 @@ export genrose_nash -function genrose_nash(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function genrose_nash(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} n < 2 && @warn("genrose_nash: number of variables must be ≥ 2") n = max(2, n) function f(x; n = length(x)) diff --git a/src/ADNLPProblems/gulf.jl b/src/ADNLPProblems/gulf.jl index 87ec45a6..a7c46954 100644 --- a/src/ADNLPProblems/gulf.jl +++ b/src/ADNLPProblems/gulf.jl @@ -8,7 +8,7 @@ end function gulf( ::Val{:nlp}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, m::Int = 100, kwargs..., ) where {T} @@ -28,7 +28,7 @@ end function gulf( ::Val{:nls}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, m::Int = 100, kwargs..., ) where {T} diff --git a/src/ADNLPProblems/hahn1.jl b/src/ADNLPProblems/hahn1.jl index 08f1ea65..6c1a735a 100644 --- a/src/ADNLPProblems/hahn1.jl +++ b/src/ADNLPProblems/hahn1.jl @@ -5,7 +5,7 @@ function hahn1(; use_nls::Bool = false, kwargs...) return hahn1(Val(model); kwargs...) end -function hahn1(::Val{:nlp}; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hahn1(::Val{:nlp}; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} y = Rational{Int}[ 591//1000 24410//1000 1547//1000 34820//1000 @@ -257,7 +257,7 @@ function hahn1(::Val{:nlp}; n::Int = default_nvar, type::Val{T} = Val(Float64), return ADNLPModels.ADNLPModel(f, x0, name = "hahn1"; kwargs...) end -function hahn1(::Val{:nls}; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hahn1(::Val{:nls}; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} y = Rational{Int}[ 591//1000 24410//1000 1547//1000 34820//1000 diff --git a/src/ADNLPProblems/helical.jl b/src/ADNLPProblems/helical.jl index 3fec8a5e..d83c4bf9 100644 --- a/src/ADNLPProblems/helical.jl +++ b/src/ADNLPProblems/helical.jl @@ -1,6 +1,6 @@ export helical -function helical(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function helical(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) return ( 10 * ( diff --git a/src/ADNLPProblems/hovercraft1d.jl b/src/ADNLPProblems/hovercraft1d.jl index 4fed5add..e2e1f30c 100644 --- a/src/ADNLPProblems/hovercraft1d.jl +++ b/src/ADNLPProblems/hovercraft1d.jl @@ -8,7 +8,7 @@ end function hovercraft1d( ::Val{:nlp}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} N = div(n, 3) @@ -69,7 +69,7 @@ end function hovercraft1d( ::Val{:nls}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} N = div(n, 3) diff --git a/src/ADNLPProblems/hs1.jl b/src/ADNLPProblems/hs1.jl index ece17e89..6f4905db 100644 --- a/src/ADNLPProblems/hs1.jl +++ b/src/ADNLPProblems/hs1.jl @@ -1,6 +1,6 @@ export hs1 -function hs1(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs1(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return 100 * (x[2] - x[1]^2)^2 + (1 - x[1])^2 diff --git a/src/ADNLPProblems/hs10.jl b/src/ADNLPProblems/hs10.jl index 39ed0c6a..80e5394a 100644 --- a/src/ADNLPProblems/hs10.jl +++ b/src/ADNLPProblems/hs10.jl @@ -1,6 +1,6 @@ export hs10 -function hs10(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs10(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} x0 = T[-10; 10] f(x) = x[1] - x[2] function c!(cx, x) diff --git a/src/ADNLPProblems/hs100.jl b/src/ADNLPProblems/hs100.jl index d39ffcee..51552a72 100644 --- a/src/ADNLPProblems/hs100.jl +++ b/src/ADNLPProblems/hs100.jl @@ -1,6 +1,6 @@ export hs100 -function hs100(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs100(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return (x[1] - 10)^2 + diff --git a/src/ADNLPProblems/hs101.jl b/src/ADNLPProblems/hs101.jl index b928eb86..4912ad8a 100644 --- a/src/ADNLPProblems/hs101.jl +++ b/src/ADNLPProblems/hs101.jl @@ -1,6 +1,6 @@ export hs101 -function hs101(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs101(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} a = -25 // 100 exposant_f = Array{Rational{Int}}(undef, 4, 7) exposant_f[1, :] = [1, -1, 0, 2, 0, -3, a] diff --git a/src/ADNLPProblems/hs102.jl b/src/ADNLPProblems/hs102.jl index 3b240d15..91ff0986 100644 --- a/src/ADNLPProblems/hs102.jl +++ b/src/ADNLPProblems/hs102.jl @@ -1,6 +1,6 @@ export hs102 -function hs102(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs102(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} a = 125 // 1000 exposant_f = Array{Rational{Int}}(undef, 4, 7) exposant_f[1, :] = [1, -1, 0, 2, 0, -3, a] diff --git a/src/ADNLPProblems/hs103.jl b/src/ADNLPProblems/hs103.jl index 8e455745..2c1e587b 100644 --- a/src/ADNLPProblems/hs103.jl +++ b/src/ADNLPProblems/hs103.jl @@ -1,6 +1,6 @@ export hs103 -function hs103(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs103(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} a = 1 // 2 exposant_f = Array{Rational{Int}}(undef, 4, 7) exposant_f[1, :] = [1, -1, 0, 2, 0, -3, a] diff --git a/src/ADNLPProblems/hs104.jl b/src/ADNLPProblems/hs104.jl index a1651ee6..5baed709 100644 --- a/src/ADNLPProblems/hs104.jl +++ b/src/ADNLPProblems/hs104.jl @@ -1,6 +1,6 @@ export hs104 -function hs104(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs104(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return 4 // 10 * (x[1] / x[7])^(67 // 100) + 4 // 10 * (x[2] / x[8])^(67 // 100) + 10 - x[1] - diff --git a/src/ADNLPProblems/hs105.jl b/src/ADNLPProblems/hs105.jl index 838741ed..8cabe692 100644 --- a/src/ADNLPProblems/hs105.jl +++ b/src/ADNLPProblems/hs105.jl @@ -1,6 +1,6 @@ export hs105 -function hs105(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs105(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} y = Array{Int}(undef, 235) y[1] = 95 y[2] = 105 diff --git a/src/ADNLPProblems/hs106.jl b/src/ADNLPProblems/hs106.jl index cde7b1b1..6554ef09 100644 --- a/src/ADNLPProblems/hs106.jl +++ b/src/ADNLPProblems/hs106.jl @@ -1,6 +1,6 @@ export hs106 -function hs106(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs106(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return x[1] + x[2] + x[3] diff --git a/src/ADNLPProblems/hs107.jl b/src/ADNLPProblems/hs107.jl index c5fa2d4b..5a16ae9e 100644 --- a/src/ADNLPProblems/hs107.jl +++ b/src/ADNLPProblems/hs107.jl @@ -1,6 +1,6 @@ export hs107 -function hs107(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs107(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} ci = T((48.4 / 50.176) * sin(0.25)) d = T((48.4 / 50.176) * cos(0.25)) function f(x) diff --git a/src/ADNLPProblems/hs108.jl b/src/ADNLPProblems/hs108.jl index c11c1505..d6bf91b4 100644 --- a/src/ADNLPProblems/hs108.jl +++ b/src/ADNLPProblems/hs108.jl @@ -1,6 +1,6 @@ export hs108 -function hs108(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs108(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return -1 // 2 * diff --git a/src/ADNLPProblems/hs109.jl b/src/ADNLPProblems/hs109.jl index e7dd3bc8..fe503850 100644 --- a/src/ADNLPProblems/hs109.jl +++ b/src/ADNLPProblems/hs109.jl @@ -1,6 +1,6 @@ export hs109 -function hs109(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs109(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return 3 * x[1] + 1 // 1000000 * x[1]^3 + 2 * x[2] + eltype(x)(0.522074e-6) * x[2]^3 diff --git a/src/ADNLPProblems/hs11.jl b/src/ADNLPProblems/hs11.jl index 07f1e485..d393b873 100644 --- a/src/ADNLPProblems/hs11.jl +++ b/src/ADNLPProblems/hs11.jl @@ -1,6 +1,6 @@ export hs11 -function hs11(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs11(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} x0 = T[4.9; 0.1] f(x) = (x[1] - 5)^2 + x[2]^2 - 25 function c!(cx, x) diff --git a/src/ADNLPProblems/hs110.jl b/src/ADNLPProblems/hs110.jl index 3fc41c2d..b26662c2 100644 --- a/src/ADNLPProblems/hs110.jl +++ b/src/ADNLPProblems/hs110.jl @@ -1,6 +1,6 @@ export hs110 -function hs110(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs110(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return sum(log(x[i] - 2)^2 + log(10 - x[i])^2 for i = 1:10) - prod(x[i] for i = 1:10)^(2 // 10) diff --git a/src/ADNLPProblems/hs111.jl b/src/ADNLPProblems/hs111.jl index 1f47bacb..d11ecf65 100644 --- a/src/ADNLPProblems/hs111.jl +++ b/src/ADNLPProblems/hs111.jl @@ -1,6 +1,6 @@ export hs111 -function hs111(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs111(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} ci = [ -6089 // 1000, -17164 // 1000, diff --git a/src/ADNLPProblems/hs112.jl b/src/ADNLPProblems/hs112.jl index 58712a1f..36dc419c 100644 --- a/src/ADNLPProblems/hs112.jl +++ b/src/ADNLPProblems/hs112.jl @@ -1,6 +1,6 @@ export hs112 -function hs112(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs112(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} ci = [ -6089 // 1000, -17164 // 1000, diff --git a/src/ADNLPProblems/hs113.jl b/src/ADNLPProblems/hs113.jl index 3b1f4bf4..3d31ef7d 100644 --- a/src/ADNLPProblems/hs113.jl +++ b/src/ADNLPProblems/hs113.jl @@ -1,6 +1,6 @@ export hs113 -function hs113(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs113(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return x[1]^2 + x[2]^2 + x[1] * x[2] - 14 * x[1] - 16 * x[2] + diff --git a/src/ADNLPProblems/hs114.jl b/src/ADNLPProblems/hs114.jl index 723316ee..7766803e 100644 --- a/src/ADNLPProblems/hs114.jl +++ b/src/ADNLPProblems/hs114.jl @@ -1,6 +1,6 @@ export hs114 -function hs114(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs114(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} a = T(0.99) b = T(0.9) function f(x) diff --git a/src/ADNLPProblems/hs116.jl b/src/ADNLPProblems/hs116.jl index 2265f558..d3728fdc 100644 --- a/src/ADNLPProblems/hs116.jl +++ b/src/ADNLPProblems/hs116.jl @@ -1,6 +1,6 @@ export hs116 -function hs116(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs116(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} a = 0.002 b = 1.262626 ci = 1.231059 diff --git a/src/ADNLPProblems/hs117.jl b/src/ADNLPProblems/hs117.jl index d620df3e..e7f32849 100644 --- a/src/ADNLPProblems/hs117.jl +++ b/src/ADNLPProblems/hs117.jl @@ -1,6 +1,6 @@ export hs117 -function hs117(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs117(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} a = Array{Rational{Int}}(undef, 10, 5) a[1, :] = [-16, 2, 0, 1, 0] a[2, :] = [0, -2, 0, 4, 2] diff --git a/src/ADNLPProblems/hs118.jl b/src/ADNLPProblems/hs118.jl index 429b433d..e938a77f 100644 --- a/src/ADNLPProblems/hs118.jl +++ b/src/ADNLPProblems/hs118.jl @@ -1,6 +1,6 @@ export hs118 -function hs118(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs118(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} x0 = T[20, 55, 15, 20, 60, 20, 20, 60, 20, 20, 60, 20, 20, 60, 20] lvar = T[8, 43, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] uvar = T[21, 57, 16, 90, 120, 60, 90, 120, 60, 90, 120, 60, 90, 120, 60] diff --git a/src/ADNLPProblems/hs119.jl b/src/ADNLPProblems/hs119.jl index e17a12cb..e1f687ec 100644 --- a/src/ADNLPProblems/hs119.jl +++ b/src/ADNLPProblems/hs119.jl @@ -1,6 +1,6 @@ export hs119 -function hs119(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs119(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} ci = T[2.5, 1.1, -3.1, -3.5, 1.3, 2.1, 2.3, -1.5] a = Array{Int}(undef, 16, 16) diff --git a/src/ADNLPProblems/hs12.jl b/src/ADNLPProblems/hs12.jl index 7c504b86..07ac3250 100644 --- a/src/ADNLPProblems/hs12.jl +++ b/src/ADNLPProblems/hs12.jl @@ -1,6 +1,6 @@ export hs12 -function hs12(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs12(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return x[1]^2 / 2 + x[2]^2 - x[1] * x[2] - 7 * x[1] - 7 * x[2] diff --git a/src/ADNLPProblems/hs13.jl b/src/ADNLPProblems/hs13.jl index 74563aae..0dafe055 100644 --- a/src/ADNLPProblems/hs13.jl +++ b/src/ADNLPProblems/hs13.jl @@ -5,7 +5,7 @@ function hs13(; use_nls::Bool = false, kwargs...) return hs13(Val(model); kwargs...) end -function hs13(::Val{:nlp}; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs13(::Val{:nlp}; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return 1 // 2 * (x[1] - 2)^2 + 1 // 2 * x[2]^2 @@ -22,7 +22,7 @@ function hs13(::Val{:nlp}; n::Int = default_nvar, type::Val{T} = Val(Float64), k return ADNLPModels.ADNLPModel!(f, x0, lvar, uvar, c!, lcon, ucon, name = "hs13"; kwargs...) end -function hs13(::Val{:nls}; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs13(::Val{:nls}; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function F!(r, x) r[1] = x[1] - 2 r[2] = x[2] diff --git a/src/ADNLPProblems/hs14.jl b/src/ADNLPProblems/hs14.jl index 5aa75eeb..2f064aa5 100644 --- a/src/ADNLPProblems/hs14.jl +++ b/src/ADNLPProblems/hs14.jl @@ -5,7 +5,7 @@ function hs14(; use_nls::Bool = false, kwargs...) return hs14(Val(model); kwargs...) end -function hs14(::Val{:nlp}; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs14(::Val{:nlp}; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} x0 = T[2; 2] f(x) = 1 // 2 * (x[1] - 2)^2 + 1 // 2 * (x[2] - 1)^2 function c!(cx, x) @@ -29,7 +29,7 @@ function hs14(::Val{:nlp}; n::Int = default_nvar, type::Val{T} = Val(Float64), k ) end -function hs14(::Val{:nls}; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs14(::Val{:nls}; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} x0 = T[2; 2] function F!(r, x) r[1] = x[1] - 2 diff --git a/src/ADNLPProblems/hs15.jl b/src/ADNLPProblems/hs15.jl index c79af027..ff8d34b8 100644 --- a/src/ADNLPProblems/hs15.jl +++ b/src/ADNLPProblems/hs15.jl @@ -1,6 +1,6 @@ export hs15 -function hs15(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs15(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return 100 * (x[2] - x[1]^2)^2 + (1 - x[1])^2 diff --git a/src/ADNLPProblems/hs16.jl b/src/ADNLPProblems/hs16.jl index 666fccd2..0dd36426 100644 --- a/src/ADNLPProblems/hs16.jl +++ b/src/ADNLPProblems/hs16.jl @@ -1,6 +1,6 @@ export hs16 -function hs16(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs16(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return 100 * (x[2] - x[1]^2)^2 + (1 - x[1])^2 diff --git a/src/ADNLPProblems/hs17.jl b/src/ADNLPProblems/hs17.jl index 66d42ddc..09892256 100644 --- a/src/ADNLPProblems/hs17.jl +++ b/src/ADNLPProblems/hs17.jl @@ -1,6 +1,6 @@ export hs17 -function hs17(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs17(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return 100 * (x[2] - x[1]^2)^2 + (1 - x[1])^2 diff --git a/src/ADNLPProblems/hs18.jl b/src/ADNLPProblems/hs18.jl index 7f8f3f78..b4efdf35 100644 --- a/src/ADNLPProblems/hs18.jl +++ b/src/ADNLPProblems/hs18.jl @@ -1,6 +1,6 @@ export hs18 -function hs18(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs18(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return x[1]^2 / 100 + x[2]^2 diff --git a/src/ADNLPProblems/hs19.jl b/src/ADNLPProblems/hs19.jl index f7686f94..026ffd7e 100644 --- a/src/ADNLPProblems/hs19.jl +++ b/src/ADNLPProblems/hs19.jl @@ -1,6 +1,6 @@ export hs19 -function hs19(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs19(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return (x[1] - 10)^3 + (x[2] - 20)^3 diff --git a/src/ADNLPProblems/hs2.jl b/src/ADNLPProblems/hs2.jl index ec21a7ca..89eca1b6 100644 --- a/src/ADNLPProblems/hs2.jl +++ b/src/ADNLPProblems/hs2.jl @@ -1,6 +1,6 @@ export hs2 -function hs2(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs2(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return 100 * (x[2] - x[1]^2)^2 + (1 - x[1])^2 diff --git a/src/ADNLPProblems/hs20.jl b/src/ADNLPProblems/hs20.jl index dcc7f5cb..86b65986 100644 --- a/src/ADNLPProblems/hs20.jl +++ b/src/ADNLPProblems/hs20.jl @@ -1,6 +1,6 @@ export hs20 -function hs20(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs20(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return 100 * (x[2] - x[1]^2)^2 + (1 - x[1])^2 diff --git a/src/ADNLPProblems/hs21.jl b/src/ADNLPProblems/hs21.jl index 25ebb37a..2b67fbc5 100644 --- a/src/ADNLPProblems/hs21.jl +++ b/src/ADNLPProblems/hs21.jl @@ -1,6 +1,6 @@ export hs21 -function hs21(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs21(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return 1 // 100 * x[1]^2 + x[2]^2 - 100 diff --git a/src/ADNLPProblems/hs219.jl b/src/ADNLPProblems/hs219.jl index 5e727564..bc70214c 100644 --- a/src/ADNLPProblems/hs219.jl +++ b/src/ADNLPProblems/hs219.jl @@ -1,6 +1,6 @@ export hs219 -function hs219(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs219(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) return -x[1] end diff --git a/src/ADNLPProblems/hs22.jl b/src/ADNLPProblems/hs22.jl index 0a2f00f1..4b49be46 100644 --- a/src/ADNLPProblems/hs22.jl +++ b/src/ADNLPProblems/hs22.jl @@ -5,7 +5,7 @@ function hs22(; use_nls::Bool = false, kwargs...) return hs22(Val(model); kwargs...) end -function hs22(::Val{:nlp}; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs22(::Val{:nlp}; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return 1 // 2 * (x[1] - 2)^2 + 1 // 2 * (x[2] - 1)^2 @@ -31,7 +31,7 @@ function hs22(::Val{:nlp}; n::Int = default_nvar, type::Val{T} = Val(Float64), k ) end -function hs22(::Val{:nls}; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs22(::Val{:nls}; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function F!(r, x) r[1] = x[1] - 2 r[2] = x[2] - 1 diff --git a/src/ADNLPProblems/hs220.jl b/src/ADNLPProblems/hs220.jl index d942cdf6..49c15d06 100644 --- a/src/ADNLPProblems/hs220.jl +++ b/src/ADNLPProblems/hs220.jl @@ -1,6 +1,6 @@ export hs220 -function hs220(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs220(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) return x[1] end diff --git a/src/ADNLPProblems/hs221.jl b/src/ADNLPProblems/hs221.jl index 4448cd1f..80f82faf 100644 --- a/src/ADNLPProblems/hs221.jl +++ b/src/ADNLPProblems/hs221.jl @@ -1,6 +1,6 @@ export hs221 -function hs221(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs221(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) return -x[1] end diff --git a/src/ADNLPProblems/hs222.jl b/src/ADNLPProblems/hs222.jl index 474c969f..8132e504 100644 --- a/src/ADNLPProblems/hs222.jl +++ b/src/ADNLPProblems/hs222.jl @@ -1,6 +1,6 @@ export hs222 -function hs222(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs222(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return -x[1] diff --git a/src/ADNLPProblems/hs223.jl b/src/ADNLPProblems/hs223.jl index b191f323..b672ab88 100644 --- a/src/ADNLPProblems/hs223.jl +++ b/src/ADNLPProblems/hs223.jl @@ -1,6 +1,6 @@ export hs223 -function hs223(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs223(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return -x[1] diff --git a/src/ADNLPProblems/hs224.jl b/src/ADNLPProblems/hs224.jl index 609bc84f..1646eb0f 100644 --- a/src/ADNLPProblems/hs224.jl +++ b/src/ADNLPProblems/hs224.jl @@ -1,6 +1,6 @@ export hs224 -function hs224(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs224(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return 2 * x[1]^2 + x[2]^2 - 48 * x[1] - 40 * x[2] diff --git a/src/ADNLPProblems/hs225.jl b/src/ADNLPProblems/hs225.jl index b8ec517b..9dead159 100644 --- a/src/ADNLPProblems/hs225.jl +++ b/src/ADNLPProblems/hs225.jl @@ -1,6 +1,6 @@ export hs225 -function hs225(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs225(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) return x[1]^2 + x[2]^2 end diff --git a/src/ADNLPProblems/hs226.jl b/src/ADNLPProblems/hs226.jl index a258c86d..6aa3e700 100644 --- a/src/ADNLPProblems/hs226.jl +++ b/src/ADNLPProblems/hs226.jl @@ -1,6 +1,6 @@ export hs226 -function hs226(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs226(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return -x[1] * x[2] diff --git a/src/ADNLPProblems/hs227.jl b/src/ADNLPProblems/hs227.jl index 4f3f83a7..a125612b 100644 --- a/src/ADNLPProblems/hs227.jl +++ b/src/ADNLPProblems/hs227.jl @@ -1,6 +1,6 @@ export hs227 -function hs227(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs227(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return (x[1] - 2)^2 + (x[2] - 1)^2 diff --git a/src/ADNLPProblems/hs228.jl b/src/ADNLPProblems/hs228.jl index bbe1fc54..5ad7d54c 100644 --- a/src/ADNLPProblems/hs228.jl +++ b/src/ADNLPProblems/hs228.jl @@ -1,6 +1,6 @@ export hs228 -function hs228(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs228(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return x[1]^2 + x[2] diff --git a/src/ADNLPProblems/hs229.jl b/src/ADNLPProblems/hs229.jl index 888971ee..034c8194 100644 --- a/src/ADNLPProblems/hs229.jl +++ b/src/ADNLPProblems/hs229.jl @@ -1,6 +1,6 @@ export hs229 -function hs229(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs229(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return 100 * (x[2] - x[1]^2)^2 + (1 - x[1])^2 diff --git a/src/ADNLPProblems/hs23.jl b/src/ADNLPProblems/hs23.jl index ad669c77..f8a513d4 100644 --- a/src/ADNLPProblems/hs23.jl +++ b/src/ADNLPProblems/hs23.jl @@ -5,7 +5,7 @@ function hs23(; use_nls::Bool = false, kwargs...) return hs23(Val(model); kwargs...) end -function hs23(::Val{:nlp}; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs23(::Val{:nlp}; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return 1 // 2 * x[1]^2 + 1 // 2 * x[2]^2 @@ -38,7 +38,7 @@ function hs23(::Val{:nlp}; n::Int = default_nvar, type::Val{T} = Val(Float64), k ) end -function hs23(::Val{:nls}; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs23(::Val{:nls}; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function F!(r, x) r[1] = x[1] r[2] = x[2] diff --git a/src/ADNLPProblems/hs230.jl b/src/ADNLPProblems/hs230.jl index 15653266..f80e0702 100644 --- a/src/ADNLPProblems/hs230.jl +++ b/src/ADNLPProblems/hs230.jl @@ -1,6 +1,6 @@ export hs230 -function hs230(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs230(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) return x[2] end diff --git a/src/ADNLPProblems/hs231.jl b/src/ADNLPProblems/hs231.jl index 4bdc2f35..a546c5c5 100644 --- a/src/ADNLPProblems/hs231.jl +++ b/src/ADNLPProblems/hs231.jl @@ -1,6 +1,6 @@ export hs231 -function hs231(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs231(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) return 100 * (x[2] - x[1]^2)^2 + (1 - x[1])^2 end diff --git a/src/ADNLPProblems/hs232.jl b/src/ADNLPProblems/hs232.jl index d58bed9c..1024aff4 100644 --- a/src/ADNLPProblems/hs232.jl +++ b/src/ADNLPProblems/hs232.jl @@ -1,6 +1,6 @@ export hs232 -function hs232(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs232(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x::AbstractVector{Ti}) where {Ti} return -(9 - (x[1] - 3)^2) * x[2]^3 / Ti(27 * sqrt(3)) end diff --git a/src/ADNLPProblems/hs233.jl b/src/ADNLPProblems/hs233.jl index d94f84a4..7966a57a 100644 --- a/src/ADNLPProblems/hs233.jl +++ b/src/ADNLPProblems/hs233.jl @@ -1,6 +1,6 @@ export hs233 -function hs233(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs233(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) return 100 * (x[2] - x[1]^2)^2 + (1 - x[1])^2 end diff --git a/src/ADNLPProblems/hs234.jl b/src/ADNLPProblems/hs234.jl index 86038cde..b0001e34 100644 --- a/src/ADNLPProblems/hs234.jl +++ b/src/ADNLPProblems/hs234.jl @@ -1,6 +1,6 @@ export hs234 -function hs234(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs234(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) return (x[2] - x[1])^4 - (1 - x[1]) end diff --git a/src/ADNLPProblems/hs235.jl b/src/ADNLPProblems/hs235.jl index 0dbac242..c5c8159e 100644 --- a/src/ADNLPProblems/hs235.jl +++ b/src/ADNLPProblems/hs235.jl @@ -1,6 +1,6 @@ export hs235 -function hs235(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs235(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) return 1 // 100 * (x[1] - 1)^2 + (x[2] - x[1]^2)^2 end diff --git a/src/ADNLPProblems/hs236.jl b/src/ADNLPProblems/hs236.jl index b4a8fb66..fbf57a24 100644 --- a/src/ADNLPProblems/hs236.jl +++ b/src/ADNLPProblems/hs236.jl @@ -1,6 +1,6 @@ export hs236 -function hs236(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs236(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} B = [ 75.1963666677 -3.8112755343 diff --git a/src/ADNLPProblems/hs237.jl b/src/ADNLPProblems/hs237.jl index 909c1c1a..2babcafb 100644 --- a/src/ADNLPProblems/hs237.jl +++ b/src/ADNLPProblems/hs237.jl @@ -1,6 +1,6 @@ export hs237 -function hs237(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs237(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} B = [ 75.1963666677 -3.8112755343 diff --git a/src/ADNLPProblems/hs238.jl b/src/ADNLPProblems/hs238.jl index a7970dfa..ef97e1a7 100644 --- a/src/ADNLPProblems/hs238.jl +++ b/src/ADNLPProblems/hs238.jl @@ -1,6 +1,6 @@ export hs238 -function hs238(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs238(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} B = [ 75.1963666677 -3.8112755343 diff --git a/src/ADNLPProblems/hs239.jl b/src/ADNLPProblems/hs239.jl index 14db668d..c773c0f0 100644 --- a/src/ADNLPProblems/hs239.jl +++ b/src/ADNLPProblems/hs239.jl @@ -1,6 +1,6 @@ export hs239 -function hs239(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs239(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} B = [ 75.1963666677 -3.8112755343 diff --git a/src/ADNLPProblems/hs24.jl b/src/ADNLPProblems/hs24.jl index d20af4e3..25e98d08 100644 --- a/src/ADNLPProblems/hs24.jl +++ b/src/ADNLPProblems/hs24.jl @@ -1,6 +1,6 @@ export hs24 -function hs24(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs24(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return 1 / (27 * eltype(x)(sqrt(3))) * ((x[1] - 3)^2 - 9) * x[2]^3 diff --git a/src/ADNLPProblems/hs240.jl b/src/ADNLPProblems/hs240.jl index e84e7f07..93c41e09 100644 --- a/src/ADNLPProblems/hs240.jl +++ b/src/ADNLPProblems/hs240.jl @@ -1,6 +1,6 @@ export hs240 -function hs240(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs240(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) return (x[1] - x[2] + x[3])^2 + (-x[1] + x[2] + x[3])^2 + (x[1] + x[2] - x[3])^2 end diff --git a/src/ADNLPProblems/hs241.jl b/src/ADNLPProblems/hs241.jl index 8eceb5a7..8e7aa219 100644 --- a/src/ADNLPProblems/hs241.jl +++ b/src/ADNLPProblems/hs241.jl @@ -1,6 +1,6 @@ export hs241 -function hs241(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs241(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) return (x[1]^2 + x[2]^2 + x[3]^2 - 1)^2 + (x[1]^2 + x[2]^2 + (x[3] - 2)^2 - 1)^2 + diff --git a/src/ADNLPProblems/hs242.jl b/src/ADNLPProblems/hs242.jl index ce16ab74..fbad1f13 100644 --- a/src/ADNLPProblems/hs242.jl +++ b/src/ADNLPProblems/hs242.jl @@ -1,6 +1,6 @@ export hs242 -function hs242(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs242(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} t = [(10 + i) // 100 for i = 1:10] function f(x::AbstractVector{Ti}; t = Ti.(t)) where {Ti} return sum( diff --git a/src/ADNLPProblems/hs243.jl b/src/ADNLPProblems/hs243.jl index 2f3d0b59..da353bec 100644 --- a/src/ADNLPProblems/hs243.jl +++ b/src/ADNLPProblems/hs243.jl @@ -1,6 +1,6 @@ export hs243 -function hs243(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs243(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} A = Rational{Int}[0.14272; -0.184918; -0.521869; -0.685306] B = Rational{Int}[ 2.95137 4.87407 -2.0506 diff --git a/src/ADNLPProblems/hs244.jl b/src/ADNLPProblems/hs244.jl index dc85da12..4eaa4e21 100644 --- a/src/ADNLPProblems/hs244.jl +++ b/src/ADNLPProblems/hs244.jl @@ -1,6 +1,6 @@ export hs244 -function hs244(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs244(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) return sum( ( diff --git a/src/ADNLPProblems/hs245.jl b/src/ADNLPProblems/hs245.jl index cb298201..150716b7 100644 --- a/src/ADNLPProblems/hs245.jl +++ b/src/ADNLPProblems/hs245.jl @@ -1,6 +1,6 @@ export hs245 -function hs245(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs245(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) return sum( ( diff --git a/src/ADNLPProblems/hs246.jl b/src/ADNLPProblems/hs246.jl index e46e0858..377e5e5d 100644 --- a/src/ADNLPProblems/hs246.jl +++ b/src/ADNLPProblems/hs246.jl @@ -1,6 +1,6 @@ export hs246 -function hs246(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs246(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) return 100 * (x[3] - ((x[1] + x[2]) / 2)^2)^2 + (1 - x[1])^2 + (1 - x[2])^2 end diff --git a/src/ADNLPProblems/hs248.jl b/src/ADNLPProblems/hs248.jl index 70c2d446..27016ed2 100644 --- a/src/ADNLPProblems/hs248.jl +++ b/src/ADNLPProblems/hs248.jl @@ -1,6 +1,6 @@ export hs248 -function hs248(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs248(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) return -x[2] end diff --git a/src/ADNLPProblems/hs249.jl b/src/ADNLPProblems/hs249.jl index 78b4b97c..b390e3c7 100644 --- a/src/ADNLPProblems/hs249.jl +++ b/src/ADNLPProblems/hs249.jl @@ -1,6 +1,6 @@ export hs249 -function hs249(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs249(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) return x[1]^2 + x[2]^2 + x[3]^2 end diff --git a/src/ADNLPProblems/hs25.jl b/src/ADNLPProblems/hs25.jl index b030fbf4..3fc0c429 100644 --- a/src/ADNLPProblems/hs25.jl +++ b/src/ADNLPProblems/hs25.jl @@ -1,6 +1,6 @@ export hs25 -function hs25(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs25(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} u = [25 + (-50 * log(T(1) / 100 * i))^(2 // 3) for i = 1:99] function f(x; u = u) return sum((-1 // 100 * i + exp(-1 / x[1] * (u[i] - x[2])^x[3]))^2 for i = 1:99) diff --git a/src/ADNLPProblems/hs250.jl b/src/ADNLPProblems/hs250.jl index ff42d4c4..4488df1f 100644 --- a/src/ADNLPProblems/hs250.jl +++ b/src/ADNLPProblems/hs250.jl @@ -1,6 +1,6 @@ export hs250 -function hs250(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs250(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return -x[1] * x[2] * x[3] diff --git a/src/ADNLPProblems/hs251.jl b/src/ADNLPProblems/hs251.jl index 723d5953..d6a5338d 100644 --- a/src/ADNLPProblems/hs251.jl +++ b/src/ADNLPProblems/hs251.jl @@ -1,6 +1,6 @@ export hs251 -function hs251(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs251(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return -x[1] * x[2] * x[3] diff --git a/src/ADNLPProblems/hs252.jl b/src/ADNLPProblems/hs252.jl index e3774918..66d2d5d0 100644 --- a/src/ADNLPProblems/hs252.jl +++ b/src/ADNLPProblems/hs252.jl @@ -1,6 +1,6 @@ export hs252 -function hs252(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs252(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) return 1 // 100 * (x[1] - 1)^2 + (x[2] - x[1]^2)^2 end diff --git a/src/ADNLPProblems/hs253.jl b/src/ADNLPProblems/hs253.jl index ac014685..08ccef88 100644 --- a/src/ADNLPProblems/hs253.jl +++ b/src/ADNLPProblems/hs253.jl @@ -1,6 +1,6 @@ export hs253 -function hs253(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs253(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} c = ones(Int, 8) a1 = [0; 10; 10; 0; 0; 10; 10; 0] a2 = [0; 0; 10; 10; 0; 0; 10; 10] diff --git a/src/ADNLPProblems/hs254.jl b/src/ADNLPProblems/hs254.jl index 237abc0a..6a1b6a27 100644 --- a/src/ADNLPProblems/hs254.jl +++ b/src/ADNLPProblems/hs254.jl @@ -1,6 +1,6 @@ export hs254 -function hs254(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs254(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return log(x[3]) - x[2] diff --git a/src/ADNLPProblems/hs255.jl b/src/ADNLPProblems/hs255.jl index b3989f94..4cea7907 100644 --- a/src/ADNLPProblems/hs255.jl +++ b/src/ADNLPProblems/hs255.jl @@ -1,6 +1,6 @@ export hs255 -function hs255(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs255(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) return 100 * (x[2] - x[1]^2) + (1 - x[1])^2 + diff --git a/src/ADNLPProblems/hs256.jl b/src/ADNLPProblems/hs256.jl index e6f6455a..bdda01d5 100644 --- a/src/ADNLPProblems/hs256.jl +++ b/src/ADNLPProblems/hs256.jl @@ -1,6 +1,6 @@ export hs256 -function hs256(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs256(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) return (x[1] + 10 * x[2])^2 + 5 * (x[3] - x[4])^2 + (x[2] - 2 * x[3])^4 + 10 * (x[1] - x[4])^4 end diff --git a/src/ADNLPProblems/hs257.jl b/src/ADNLPProblems/hs257.jl index 6c824ea7..18e2ea11 100644 --- a/src/ADNLPProblems/hs257.jl +++ b/src/ADNLPProblems/hs257.jl @@ -1,6 +1,6 @@ export hs257 -function hs257(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs257(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return 100 * (x[2] - x[1]^2)^2 + diff --git a/src/ADNLPProblems/hs258.jl b/src/ADNLPProblems/hs258.jl index 5ba39bc1..3eeeffed 100644 --- a/src/ADNLPProblems/hs258.jl +++ b/src/ADNLPProblems/hs258.jl @@ -1,6 +1,6 @@ export hs258 -function hs258(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs258(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return 100 * (x[2] - x[1]^2)^2 + diff --git a/src/ADNLPProblems/hs259.jl b/src/ADNLPProblems/hs259.jl index 2d761dc6..7b956914 100644 --- a/src/ADNLPProblems/hs259.jl +++ b/src/ADNLPProblems/hs259.jl @@ -1,6 +1,6 @@ export hs259 -function hs259(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs259(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return 100 * (x[2] - x[1]^2)^2 + diff --git a/src/ADNLPProblems/hs26.jl b/src/ADNLPProblems/hs26.jl index 8b5ff034..c5a60ffc 100644 --- a/src/ADNLPProblems/hs26.jl +++ b/src/ADNLPProblems/hs26.jl @@ -1,6 +1,6 @@ export hs26 -function hs26(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs26(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function c!(cx, x) cx[1] = (1 + x[2]^2) * x[1] + x[3]^4 - 3 return cx diff --git a/src/ADNLPProblems/hs260.jl b/src/ADNLPProblems/hs260.jl index 2fd9d78f..099aa616 100644 --- a/src/ADNLPProblems/hs260.jl +++ b/src/ADNLPProblems/hs260.jl @@ -1,6 +1,6 @@ export hs260 -function hs260(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs260(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return 100 * (x[2] - x[1]^2)^2 + diff --git a/src/ADNLPProblems/hs261.jl b/src/ADNLPProblems/hs261.jl index cb0b3b5d..98e9f85f 100644 --- a/src/ADNLPProblems/hs261.jl +++ b/src/ADNLPProblems/hs261.jl @@ -1,6 +1,6 @@ export hs261 -function hs261(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs261(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return (exp(x[1]) - x[2])^4 + 100 * (x[2] - x[3])^6 + tan(x[3] - x[4])^4 + x[1]^8 + (x[4] - 1)^2 diff --git a/src/ADNLPProblems/hs262.jl b/src/ADNLPProblems/hs262.jl index 2919989f..1b639ba6 100644 --- a/src/ADNLPProblems/hs262.jl +++ b/src/ADNLPProblems/hs262.jl @@ -1,6 +1,6 @@ export hs262 -function hs262(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs262(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) return -1 // 2 * x[1] - x[2] - 1 // 2 * x[3] - x[4] end diff --git a/src/ADNLPProblems/hs263.jl b/src/ADNLPProblems/hs263.jl index d51aff87..04ac1342 100644 --- a/src/ADNLPProblems/hs263.jl +++ b/src/ADNLPProblems/hs263.jl @@ -1,6 +1,6 @@ export hs263 -function hs263(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs263(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return -x[1] diff --git a/src/ADNLPProblems/hs264.jl b/src/ADNLPProblems/hs264.jl index 1ec5c59d..360cc7b0 100644 --- a/src/ADNLPProblems/hs264.jl +++ b/src/ADNLPProblems/hs264.jl @@ -1,6 +1,6 @@ export hs264 -function hs264(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs264(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return x[1]^2 + x[2]^2 + 2 * x[3]^2 + x[4]^2 - 5 * x[1] - 5 * x[2] - 21 * x[3] + 7 * x[4] diff --git a/src/ADNLPProblems/hs265.jl b/src/ADNLPProblems/hs265.jl index 01962f6a..d75fd211 100644 --- a/src/ADNLPProblems/hs265.jl +++ b/src/ADNLPProblems/hs265.jl @@ -1,6 +1,6 @@ export hs265 -function hs265(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs265(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return sum(1 - exp(-10 * x[i] * exp(-x[i + 2])) for i = 1:2) diff --git a/src/ADNLPProblems/hs27.jl b/src/ADNLPProblems/hs27.jl index 77513bea..edd3ed23 100644 --- a/src/ADNLPProblems/hs27.jl +++ b/src/ADNLPProblems/hs27.jl @@ -1,6 +1,6 @@ export hs27 -function hs27(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs27(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function c!(cx, x) cx[1] = x[1] + x[3]^2 + 1 return cx diff --git a/src/ADNLPProblems/hs28.jl b/src/ADNLPProblems/hs28.jl index e9f2ca44..2bba6edd 100644 --- a/src/ADNLPProblems/hs28.jl +++ b/src/ADNLPProblems/hs28.jl @@ -5,7 +5,7 @@ function hs28(; use_nls::Bool = false, kwargs...) return hs28(Val(model); kwargs...) end -function hs28(::Val{:nlp}; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs28(::Val{:nlp}; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} return ADNLPModels.ADNLPModel( x -> 1 // 2 * (x[1] + x[2])^2 + 1 // 2 * (x[2] + x[3])^2, T[-4.0, 1.0, 1.0], @@ -19,7 +19,7 @@ function hs28(::Val{:nlp}; n::Int = default_nvar, type::Val{T} = Val(Float64), k ) end -function hs28(::Val{:nls}; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs28(::Val{:nls}; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function F!(r, x) r[1] = x[1] + x[2] r[2] = x[2] + x[3] diff --git a/src/ADNLPProblems/hs29.jl b/src/ADNLPProblems/hs29.jl index 752139c6..9b0d26f0 100644 --- a/src/ADNLPProblems/hs29.jl +++ b/src/ADNLPProblems/hs29.jl @@ -1,6 +1,6 @@ export hs29 -function hs29(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs29(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return -x[1] * x[2] * x[3] diff --git a/src/ADNLPProblems/hs3.jl b/src/ADNLPProblems/hs3.jl index 06e902d9..99d2f896 100644 --- a/src/ADNLPProblems/hs3.jl +++ b/src/ADNLPProblems/hs3.jl @@ -1,6 +1,6 @@ export hs3 -function hs3(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs3(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return x[2] + 1 // 100000 * (x[2] - x[1])^2 diff --git a/src/ADNLPProblems/hs30.jl b/src/ADNLPProblems/hs30.jl index 4f9afc1d..a29de1ce 100644 --- a/src/ADNLPProblems/hs30.jl +++ b/src/ADNLPProblems/hs30.jl @@ -5,7 +5,7 @@ function hs30(; use_nls::Bool = false, kwargs...) return hs30(Val(model); kwargs...) end -function hs30(::Val{:nlp}; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs30(::Val{:nlp}; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return 1 // 2 * sum(x[i]^2 for i = 1:3) @@ -22,7 +22,7 @@ function hs30(::Val{:nlp}; n::Int = default_nvar, type::Val{T} = Val(Float64), k return ADNLPModels.ADNLPModel!(f, x0, lvar, uvar, c!, lcon, ucon, name = "hs30"; kwargs...) end -function hs30(::Val{:nls}; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs30(::Val{:nls}; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function F!(r, x) r .= x return r diff --git a/src/ADNLPProblems/hs31.jl b/src/ADNLPProblems/hs31.jl index 75ae3672..3768f908 100644 --- a/src/ADNLPProblems/hs31.jl +++ b/src/ADNLPProblems/hs31.jl @@ -1,6 +1,6 @@ export hs31 -function hs31(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs31(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return 9 * x[1]^2 + x[2]^2 + 9 * x[3]^2 diff --git a/src/ADNLPProblems/hs316.jl b/src/ADNLPProblems/hs316.jl index 43937edb..7b1f542e 100644 --- a/src/ADNLPProblems/hs316.jl +++ b/src/ADNLPProblems/hs316.jl @@ -1,6 +1,6 @@ export hs316 -function hs316(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs316(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) return (x[1] - 20)^2 + (x[2] + 20)^2 end diff --git a/src/ADNLPProblems/hs317.jl b/src/ADNLPProblems/hs317.jl index 468e2737..e81d5d96 100644 --- a/src/ADNLPProblems/hs317.jl +++ b/src/ADNLPProblems/hs317.jl @@ -1,6 +1,6 @@ export hs317 -function hs317(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs317(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) return (x[1] - 20)^2 + (x[2] + 20)^2 end diff --git a/src/ADNLPProblems/hs318.jl b/src/ADNLPProblems/hs318.jl index 65a20e6e..d33821ee 100644 --- a/src/ADNLPProblems/hs318.jl +++ b/src/ADNLPProblems/hs318.jl @@ -1,6 +1,6 @@ export hs318 -function hs318(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs318(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) return (x[1] - 20)^2 + (x[2] + 20)^2 end diff --git a/src/ADNLPProblems/hs319.jl b/src/ADNLPProblems/hs319.jl index 31b8120a..dd66d186 100644 --- a/src/ADNLPProblems/hs319.jl +++ b/src/ADNLPProblems/hs319.jl @@ -1,6 +1,6 @@ export hs319 -function hs319(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs319(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) return (x[1] - 20)^2 + (x[2] + 20)^2 end diff --git a/src/ADNLPProblems/hs32.jl b/src/ADNLPProblems/hs32.jl index 9d10914b..0ecd8bb6 100644 --- a/src/ADNLPProblems/hs32.jl +++ b/src/ADNLPProblems/hs32.jl @@ -1,6 +1,6 @@ export hs32 -function hs32(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs32(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return (x[1] + 3 * x[2] + x[3])^2 + 4 * (x[1] - x[2])^2 diff --git a/src/ADNLPProblems/hs320.jl b/src/ADNLPProblems/hs320.jl index a2fca912..e50f900e 100644 --- a/src/ADNLPProblems/hs320.jl +++ b/src/ADNLPProblems/hs320.jl @@ -1,6 +1,6 @@ export hs320 -function hs320(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs320(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) return (x[1] - 20)^2 + (x[2] + 20)^2 end diff --git a/src/ADNLPProblems/hs321.jl b/src/ADNLPProblems/hs321.jl index 28e79c2b..e21c6aec 100644 --- a/src/ADNLPProblems/hs321.jl +++ b/src/ADNLPProblems/hs321.jl @@ -1,6 +1,6 @@ export hs321 -function hs321(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs321(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) return (x[1] - 20)^2 + (x[2] + 20)^2 end diff --git a/src/ADNLPProblems/hs322.jl b/src/ADNLPProblems/hs322.jl index 41184a6c..e80ee579 100644 --- a/src/ADNLPProblems/hs322.jl +++ b/src/ADNLPProblems/hs322.jl @@ -1,6 +1,6 @@ export hs322 -function hs322(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs322(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) return (x[1] - 20)^2 + (x[2] + 20)^2 end diff --git a/src/ADNLPProblems/hs33.jl b/src/ADNLPProblems/hs33.jl index 9b18817c..37ba2b98 100644 --- a/src/ADNLPProblems/hs33.jl +++ b/src/ADNLPProblems/hs33.jl @@ -1,6 +1,6 @@ export hs33 -function hs33(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs33(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return (x[1] - 1) * (x[1] - 2) * (x[1] - 3) + x[3] diff --git a/src/ADNLPProblems/hs34.jl b/src/ADNLPProblems/hs34.jl index a18490e6..aae09598 100644 --- a/src/ADNLPProblems/hs34.jl +++ b/src/ADNLPProblems/hs34.jl @@ -1,6 +1,6 @@ export hs34 -function hs34(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs34(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return -x[1] diff --git a/src/ADNLPProblems/hs35.jl b/src/ADNLPProblems/hs35.jl index 6fa182e8..9f724b8b 100644 --- a/src/ADNLPProblems/hs35.jl +++ b/src/ADNLPProblems/hs35.jl @@ -1,6 +1,6 @@ export hs35 -function hs35(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs35(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return 9 - 8 * x[1] - 6 * x[2] - 4 * x[3] + diff --git a/src/ADNLPProblems/hs36.jl b/src/ADNLPProblems/hs36.jl index bd56accc..070e4ffb 100644 --- a/src/ADNLPProblems/hs36.jl +++ b/src/ADNLPProblems/hs36.jl @@ -1,6 +1,6 @@ export hs36 -function hs36(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs36(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return -x[1] * x[2] * x[3] diff --git a/src/ADNLPProblems/hs37.jl b/src/ADNLPProblems/hs37.jl index 60c96c42..3b0c32fd 100644 --- a/src/ADNLPProblems/hs37.jl +++ b/src/ADNLPProblems/hs37.jl @@ -1,6 +1,6 @@ export hs37 -function hs37(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs37(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return -x[1] * x[2] * x[3] diff --git a/src/ADNLPProblems/hs378.jl b/src/ADNLPProblems/hs378.jl index 6cc73386..99d69d39 100644 --- a/src/ADNLPProblems/hs378.jl +++ b/src/ADNLPProblems/hs378.jl @@ -1,6 +1,6 @@ export hs378 -function hs378(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs378(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} A = [ -6089 // 1000, -17164 // 1000, diff --git a/src/ADNLPProblems/hs38.jl b/src/ADNLPProblems/hs38.jl index 5cf7705a..15ae12c1 100644 --- a/src/ADNLPProblems/hs38.jl +++ b/src/ADNLPProblems/hs38.jl @@ -1,6 +1,6 @@ export hs38 -function hs38(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs38(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return 100 * (x[2] - x[1]^2)^2 + diff --git a/src/ADNLPProblems/hs39.jl b/src/ADNLPProblems/hs39.jl index b8a93a05..f58c68e6 100644 --- a/src/ADNLPProblems/hs39.jl +++ b/src/ADNLPProblems/hs39.jl @@ -1,6 +1,6 @@ export hs39 -function hs39(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs39(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function c!(cx, x) cx[1] = x[2] - x[1]^3 - x[3]^2 cx[2] = x[1]^2 - x[2] - x[4]^2 diff --git a/src/ADNLPProblems/hs4.jl b/src/ADNLPProblems/hs4.jl index ecfda739..c9811538 100644 --- a/src/ADNLPProblems/hs4.jl +++ b/src/ADNLPProblems/hs4.jl @@ -1,6 +1,6 @@ export hs4 -function hs4(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs4(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return (x[1] + 1)^3 / 3 + x[2] diff --git a/src/ADNLPProblems/hs40.jl b/src/ADNLPProblems/hs40.jl index 4d764b00..de6a14a5 100644 --- a/src/ADNLPProblems/hs40.jl +++ b/src/ADNLPProblems/hs40.jl @@ -1,6 +1,6 @@ export hs40 -function hs40(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs40(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function c!(cx, x) cx[1] = x[1]^3 + x[2]^2 - 1 cx[2] = x[4] * x[1]^2 - x[3] diff --git a/src/ADNLPProblems/hs41.jl b/src/ADNLPProblems/hs41.jl index 279ac457..05b36ab8 100644 --- a/src/ADNLPProblems/hs41.jl +++ b/src/ADNLPProblems/hs41.jl @@ -1,6 +1,6 @@ export hs41 -function hs41(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs41(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return 2 - x[1] * x[2] * x[3] diff --git a/src/ADNLPProblems/hs42.jl b/src/ADNLPProblems/hs42.jl index e67060d8..aafa444b 100644 --- a/src/ADNLPProblems/hs42.jl +++ b/src/ADNLPProblems/hs42.jl @@ -5,7 +5,7 @@ function hs42(; use_nls::Bool = false, kwargs...) return hs42(Val(model); kwargs...) end -function hs42(::Val{:nlp}; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs42(::Val{:nlp}; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function c!(cx, x) cx[1] = x[3]^2 + x[4]^2 - 2 return cx @@ -25,7 +25,7 @@ function hs42(::Val{:nlp}; n::Int = default_nvar, type::Val{T} = Val(Float64), k ) end -function hs42(::Val{:nls}; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs42(::Val{:nls}; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function F!(r, x) r[1] = x[1] - 1 r[2] = x[2] - 2 diff --git a/src/ADNLPProblems/hs43.jl b/src/ADNLPProblems/hs43.jl index cfbe833b..d3dfdbce 100644 --- a/src/ADNLPProblems/hs43.jl +++ b/src/ADNLPProblems/hs43.jl @@ -1,6 +1,6 @@ export hs43 -function hs43(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs43(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return x[1]^2 + x[2]^2 + 2 * x[3]^2 + x[4]^2 - 5 * x[1] - 5 * x[2] - 21 * x[3] + 7 * x[4] diff --git a/src/ADNLPProblems/hs44.jl b/src/ADNLPProblems/hs44.jl index 0505901c..6e311607 100644 --- a/src/ADNLPProblems/hs44.jl +++ b/src/ADNLPProblems/hs44.jl @@ -1,6 +1,6 @@ export hs44 -function hs44(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs44(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return x[1] - x[2] - x[3] - x[1] * x[3] + x[1] * x[4] + x[2] * x[3] - x[2] * x[4] diff --git a/src/ADNLPProblems/hs45.jl b/src/ADNLPProblems/hs45.jl index 71257e4b..27e88bd0 100644 --- a/src/ADNLPProblems/hs45.jl +++ b/src/ADNLPProblems/hs45.jl @@ -1,6 +1,6 @@ export hs45 -function hs45(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs45(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return 2 - x[1] * x[2] * x[3] * x[4] * x[5] / 120 diff --git a/src/ADNLPProblems/hs46.jl b/src/ADNLPProblems/hs46.jl index 32161956..f348ed27 100644 --- a/src/ADNLPProblems/hs46.jl +++ b/src/ADNLPProblems/hs46.jl @@ -1,6 +1,6 @@ export hs46 -function hs46(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs46(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function c!(cx, x) cx[1] = (x[1]^2) * x[4] + sin(x[4] - x[5]) - 1 cx[2] = x[2] + (x[3]^4) * (x[4]^2) - 2 diff --git a/src/ADNLPProblems/hs47.jl b/src/ADNLPProblems/hs47.jl index f1406f75..688edb4d 100644 --- a/src/ADNLPProblems/hs47.jl +++ b/src/ADNLPProblems/hs47.jl @@ -1,6 +1,6 @@ export hs47 -function hs47(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs47(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function c!(cx, x) cx[1] = x[1] + x[2]^2 + x[3]^3 - 3 cx[2] = x[2] - x[3]^2 + x[4] - 1 diff --git a/src/ADNLPProblems/hs48.jl b/src/ADNLPProblems/hs48.jl index 76909b50..5eb40c20 100644 --- a/src/ADNLPProblems/hs48.jl +++ b/src/ADNLPProblems/hs48.jl @@ -5,7 +5,7 @@ function hs48(; use_nls::Bool = false, kwargs...) return hs48(Val(model); kwargs...) end -function hs48(::Val{:nlp}; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs48(::Val{:nlp}; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} return ADNLPModels.ADNLPModel( x -> 1 // 2 * (x[1] - 1)^2 + 1 // 2 * (x[2] - x[3])^2 + 1 // 2 * (x[4] - x[5])^2, T[3, 5, -3, 2, -2], @@ -20,7 +20,7 @@ function hs48(::Val{:nlp}; n::Int = default_nvar, type::Val{T} = Val(Float64), k ) end -function hs48(::Val{:nls}; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs48(::Val{:nls}; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function F!(r, x) r[1] = x[1] - 1 r[2] = x[2] - x[3] diff --git a/src/ADNLPProblems/hs49.jl b/src/ADNLPProblems/hs49.jl index 84868320..7572d395 100644 --- a/src/ADNLPProblems/hs49.jl +++ b/src/ADNLPProblems/hs49.jl @@ -1,6 +1,6 @@ export hs49 -function hs49(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs49(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} return ADNLPModels.ADNLPModel( x -> (x[1] - x[2])^2 + (x[3] - 1)^2 + (x[4] - 1)^4 + (x[5] - 1)^6, T[10, 7, 2, -3, 0.8], diff --git a/src/ADNLPProblems/hs5.jl b/src/ADNLPProblems/hs5.jl index cac28468..9c3acef3 100644 --- a/src/ADNLPProblems/hs5.jl +++ b/src/ADNLPProblems/hs5.jl @@ -1,6 +1,6 @@ export hs5 -function hs5(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs5(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} x0 = zeros(T, 2) f(x) = sin(x[1] + x[2]) + (x[1] - x[2])^2 - 3x[1] / 2 + 5x[2] / 2 + 1 l = T[-1.5; -3.0] diff --git a/src/ADNLPProblems/hs50.jl b/src/ADNLPProblems/hs50.jl index 26dfe22b..8c8c75a9 100644 --- a/src/ADNLPProblems/hs50.jl +++ b/src/ADNLPProblems/hs50.jl @@ -1,6 +1,6 @@ export hs50 -function hs50(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs50(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} return ADNLPModels.ADNLPModel( x -> (x[1] - x[2])^2 + (x[2] - x[3])^2 + (x[3] - x[4])^4 + (x[4] - x[5])^2, T[35, -31, 11, 5, -5], diff --git a/src/ADNLPProblems/hs51.jl b/src/ADNLPProblems/hs51.jl index d89cd4ac..f5e5121c 100644 --- a/src/ADNLPProblems/hs51.jl +++ b/src/ADNLPProblems/hs51.jl @@ -5,7 +5,7 @@ function hs51(; use_nls::Bool = false, kwargs...) return hs51(Val(model); kwargs...) end -function hs51(::Val{:nlp}; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs51(::Val{:nlp}; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} return ADNLPModels.ADNLPModel( x -> 1 // 2 * (x[1] - x[2])^2 + @@ -23,7 +23,7 @@ function hs51(::Val{:nlp}; n::Int = default_nvar, type::Val{T} = Val(Float64), k ) end -function hs51(::Val{:nls}; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs51(::Val{:nls}; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function F!(r, x) r[1] = x[1] - x[2] r[2] = x[2] + x[3] - 2 diff --git a/src/ADNLPProblems/hs52.jl b/src/ADNLPProblems/hs52.jl index 97bf1ecf..3a7fb4b5 100644 --- a/src/ADNLPProblems/hs52.jl +++ b/src/ADNLPProblems/hs52.jl @@ -5,7 +5,7 @@ function hs52(; use_nls::Bool = false, kwargs...) return hs52(Val(model); kwargs...) end -function hs52(::Val{:nlp}; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs52(::Val{:nlp}; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} return ADNLPModels.ADNLPModel( x -> 1 // 2 * (4 * x[1] - x[2])^2 + @@ -23,7 +23,7 @@ function hs52(::Val{:nlp}; n::Int = default_nvar, type::Val{T} = Val(Float64), k ) end -function hs52(::Val{:nls}; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs52(::Val{:nls}; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function F!(r, x) r[1] = 4 * x[1] - x[2] r[2] = x[2] + x[3] - 2 diff --git a/src/ADNLPProblems/hs53.jl b/src/ADNLPProblems/hs53.jl index 886ad8c5..8ddaadc8 100644 --- a/src/ADNLPProblems/hs53.jl +++ b/src/ADNLPProblems/hs53.jl @@ -5,7 +5,7 @@ function hs53(; use_nls::Bool = false, kwargs...) return hs53(Val(model); kwargs...) end -function hs53(::Val{:nlp}; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs53(::Val{:nlp}; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return 1 // 2 * (x[1] - x[2])^2 + @@ -33,7 +33,7 @@ function hs53(::Val{:nlp}; n::Int = default_nvar, type::Val{T} = Val(Float64), k ) end -function hs53(::Val{:nls}; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs53(::Val{:nls}; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function F!(r, x) r[1] = x[1] - x[2] r[2] = x[2] + x[3] - 2 diff --git a/src/ADNLPProblems/hs54.jl b/src/ADNLPProblems/hs54.jl index 2a0efb5c..b1774ff2 100644 --- a/src/ADNLPProblems/hs54.jl +++ b/src/ADNLPProblems/hs54.jl @@ -1,6 +1,6 @@ export hs54 -function hs54(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs54(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return -exp( diff --git a/src/ADNLPProblems/hs55.jl b/src/ADNLPProblems/hs55.jl index b172f8dd..6578963e 100644 --- a/src/ADNLPProblems/hs55.jl +++ b/src/ADNLPProblems/hs55.jl @@ -1,6 +1,6 @@ export hs55 -function hs55(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs55(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return x[1] + 2 * x[2] + 4 * x[5] + exp(x[1] * x[4]) diff --git a/src/ADNLPProblems/hs56.jl b/src/ADNLPProblems/hs56.jl index 106cf2d7..416f6e6d 100644 --- a/src/ADNLPProblems/hs56.jl +++ b/src/ADNLPProblems/hs56.jl @@ -1,6 +1,6 @@ export hs56 -function hs56(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs56(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function c!(cx, x) cx[1] = x[1] - 42 // 10 * sin(x[4])^2 cx[2] = x[2] - 42 // 10 * sin(x[5])^2 diff --git a/src/ADNLPProblems/hs57.jl b/src/ADNLPProblems/hs57.jl index 79249af7..061ddc0f 100644 --- a/src/ADNLPProblems/hs57.jl +++ b/src/ADNLPProblems/hs57.jl @@ -5,7 +5,7 @@ function hs57(; use_nls::Bool = false, kwargs...) return hs57(Val(model); kwargs...) end -function hs57(::Val{:nlp}; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs57(::Val{:nlp}; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} a = Array{Int64}(undef, 44) a[1:2] .= 8 a[3:6] .= 10 @@ -73,7 +73,7 @@ function hs57(::Val{:nlp}; n::Int = default_nvar, type::Val{T} = Val(Float64), k return ADNLPModels.ADNLPModel!(f, x0, lvar, uvar, c!, lcon, ucon, name = "hs57"; kwargs...) end -function hs57(::Val{:nls}; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs57(::Val{:nls}; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} a = Array{Int64}(undef, 44) a[1:2] .= 8 a[3:6] .= 10 diff --git a/src/ADNLPProblems/hs59.jl b/src/ADNLPProblems/hs59.jl index d03cc880..dfcac7cc 100644 --- a/src/ADNLPProblems/hs59.jl +++ b/src/ADNLPProblems/hs59.jl @@ -1,6 +1,6 @@ export hs59 -function hs59(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs59(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) Ti = eltype(x) diff --git a/src/ADNLPProblems/hs6.jl b/src/ADNLPProblems/hs6.jl index 4bfec492..96b9e95c 100644 --- a/src/ADNLPProblems/hs6.jl +++ b/src/ADNLPProblems/hs6.jl @@ -5,7 +5,7 @@ function hs6(; use_nls::Bool = false, kwargs...) return hs6(Val(model); kwargs...) end -function hs6(::Val{:nlp}; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs6(::Val{:nlp}; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function c!(cx, x) cx[1] = 10 * (x[2] - x[1]^2) return cx @@ -21,7 +21,7 @@ function hs6(::Val{:nlp}; n::Int = default_nvar, type::Val{T} = Val(Float64), kw ) end -function hs6(::Val{:nls}; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs6(::Val{:nls}; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function F!(r, x) r[1] = 1 // 2 * (x[1] - 1)^2 return r diff --git a/src/ADNLPProblems/hs60.jl b/src/ADNLPProblems/hs60.jl index f165ddbe..7a0237c1 100644 --- a/src/ADNLPProblems/hs60.jl +++ b/src/ADNLPProblems/hs60.jl @@ -1,6 +1,6 @@ export hs60 -function hs60(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs60(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return (x[1] - 1)^2 + (x[1] - x[2])^2 + (x[2] - x[3])^4 diff --git a/src/ADNLPProblems/hs61.jl b/src/ADNLPProblems/hs61.jl index a3b661f9..c2f9a2ad 100644 --- a/src/ADNLPProblems/hs61.jl +++ b/src/ADNLPProblems/hs61.jl @@ -1,6 +1,6 @@ export hs61 -function hs61(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs61(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return 4 * x[1]^2 + 2 * x[2]^2 + 2 * x[3]^2 - 33 * x[1] + 16 * x[2] - 24 * x[3] diff --git a/src/ADNLPProblems/hs62.jl b/src/ADNLPProblems/hs62.jl index ed7da9b3..f84c749a 100644 --- a/src/ADNLPProblems/hs62.jl +++ b/src/ADNLPProblems/hs62.jl @@ -1,6 +1,6 @@ export hs62 -function hs62(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs62(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return -32174 // 1000 * ( diff --git a/src/ADNLPProblems/hs63.jl b/src/ADNLPProblems/hs63.jl index f7f7a67b..1a558510 100644 --- a/src/ADNLPProblems/hs63.jl +++ b/src/ADNLPProblems/hs63.jl @@ -1,6 +1,6 @@ export hs63 -function hs63(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs63(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function c!(cx, x) cx[1] = x[1]^2 + x[2]^2 + x[3]^2 - 25 return cx diff --git a/src/ADNLPProblems/hs64.jl b/src/ADNLPProblems/hs64.jl index 09eaf909..b6fc4860 100644 --- a/src/ADNLPProblems/hs64.jl +++ b/src/ADNLPProblems/hs64.jl @@ -1,6 +1,6 @@ export hs64 -function hs64(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs64(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return 5 * x[1] + 50000 / x[1] + 20 * x[2] + 72000 / x[2] + 10 * x[3] + 144000 / x[3] diff --git a/src/ADNLPProblems/hs65.jl b/src/ADNLPProblems/hs65.jl index 69468afe..f30aa813 100644 --- a/src/ADNLPProblems/hs65.jl +++ b/src/ADNLPProblems/hs65.jl @@ -1,6 +1,6 @@ export hs65 -function hs65(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs65(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return (x[1] - x[2])^2 + ((x[1] + x[2] - 10)^2) / 9 + (x[3] - 5)^2 diff --git a/src/ADNLPProblems/hs66.jl b/src/ADNLPProblems/hs66.jl index 460ae9ff..3d099eef 100644 --- a/src/ADNLPProblems/hs66.jl +++ b/src/ADNLPProblems/hs66.jl @@ -1,6 +1,6 @@ export hs66 -function hs66(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs66(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return 2 // 10 * x[3] - 8 // 10 * x[1] diff --git a/src/ADNLPProblems/hs68.jl b/src/ADNLPProblems/hs68.jl index a93f05b8..839af833 100644 --- a/src/ADNLPProblems/hs68.jl +++ b/src/ADNLPProblems/hs68.jl @@ -1,6 +1,6 @@ export hs68 -function hs68(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs68(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} a1 = 1 // 10000 b1 = 1 d1 = 1 diff --git a/src/ADNLPProblems/hs69.jl b/src/ADNLPProblems/hs69.jl index e170eeaa..458ccff9 100644 --- a/src/ADNLPProblems/hs69.jl +++ b/src/ADNLPProblems/hs69.jl @@ -1,6 +1,6 @@ export hs69 -function hs69(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs69(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} a1 = 1 // 10 b1 = 1000 d1 = 1 diff --git a/src/ADNLPProblems/hs7.jl b/src/ADNLPProblems/hs7.jl index 6e9d3ec5..5cc0da53 100644 --- a/src/ADNLPProblems/hs7.jl +++ b/src/ADNLPProblems/hs7.jl @@ -1,6 +1,6 @@ export hs7 -function hs7(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs7(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function c!(cx, x) cx[1] = (1 + x[1]^2)^2 + x[2]^2 - 4 return cx diff --git a/src/ADNLPProblems/hs70.jl b/src/ADNLPProblems/hs70.jl index 05219b3c..00928589 100644 --- a/src/ADNLPProblems/hs70.jl +++ b/src/ADNLPProblems/hs70.jl @@ -1,6 +1,6 @@ export hs70 -function hs70(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs70(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} ci = Array{Rational{Int}}(undef, 19) ci[1] = 1 // 10 for i = 2:19 diff --git a/src/ADNLPProblems/hs71.jl b/src/ADNLPProblems/hs71.jl index 92cfda08..7becd654 100644 --- a/src/ADNLPProblems/hs71.jl +++ b/src/ADNLPProblems/hs71.jl @@ -1,6 +1,6 @@ export hs71 -function hs71(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs71(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return x[1] * x[4] * (x[1] + x[2] + x[3]) + x[3] diff --git a/src/ADNLPProblems/hs72.jl b/src/ADNLPProblems/hs72.jl index ae580da7..71a9e5d4 100644 --- a/src/ADNLPProblems/hs72.jl +++ b/src/ADNLPProblems/hs72.jl @@ -1,6 +1,6 @@ export hs72 -function hs72(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs72(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return 1 + x[1] + x[2] + x[3] + x[4] diff --git a/src/ADNLPProblems/hs73.jl b/src/ADNLPProblems/hs73.jl index 489bb1b6..c7453f0e 100644 --- a/src/ADNLPProblems/hs73.jl +++ b/src/ADNLPProblems/hs73.jl @@ -1,6 +1,6 @@ export hs73 -function hs73(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs73(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return 2455 // 100 * x[1] + 2675 // 100 * x[2] + 39 * x[3] + 4050 // 100 * x[4] diff --git a/src/ADNLPProblems/hs74.jl b/src/ADNLPProblems/hs74.jl index 68ea3012..25bb554b 100644 --- a/src/ADNLPProblems/hs74.jl +++ b/src/ADNLPProblems/hs74.jl @@ -1,6 +1,6 @@ export hs74 -function hs74(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs74(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} a = 55 // 100 function f(x) n = length(x) diff --git a/src/ADNLPProblems/hs75.jl b/src/ADNLPProblems/hs75.jl index 2540f5f7..c77b23df 100644 --- a/src/ADNLPProblems/hs75.jl +++ b/src/ADNLPProblems/hs75.jl @@ -1,6 +1,6 @@ export hs75 -function hs75(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs75(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} a = T(0.48) function f(x) n = length(x) diff --git a/src/ADNLPProblems/hs76.jl b/src/ADNLPProblems/hs76.jl index eb10e86a..7650c0bb 100644 --- a/src/ADNLPProblems/hs76.jl +++ b/src/ADNLPProblems/hs76.jl @@ -1,6 +1,6 @@ export hs76 -function hs76(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs76(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return x[1]^2 + 1 // 2 * x[2]^2 + x[3]^2 + 1 // 2 * x[4]^2 - x[1] * x[3] + x[3] * x[4] - x[1] - diff --git a/src/ADNLPProblems/hs77.jl b/src/ADNLPProblems/hs77.jl index a74c1fbb..f6fb172b 100644 --- a/src/ADNLPProblems/hs77.jl +++ b/src/ADNLPProblems/hs77.jl @@ -1,6 +1,6 @@ export hs77 -function hs77(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs77(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function c!(cx, x) cx[1] = x[1]^2 * x[4] + sin(x[4] - x[5]) - 2 * sqrt(2) cx[2] = x[2] + x[3]^4 * x[4]^2 - 8 - sqrt(2) diff --git a/src/ADNLPProblems/hs78.jl b/src/ADNLPProblems/hs78.jl index 3e0260ea..de755fac 100644 --- a/src/ADNLPProblems/hs78.jl +++ b/src/ADNLPProblems/hs78.jl @@ -1,6 +1,6 @@ export hs78 -function hs78(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs78(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return prod(x[i] for i = 1:5) diff --git a/src/ADNLPProblems/hs79.jl b/src/ADNLPProblems/hs79.jl index 425dafca..d8b4c79d 100644 --- a/src/ADNLPProblems/hs79.jl +++ b/src/ADNLPProblems/hs79.jl @@ -1,6 +1,6 @@ export hs79 -function hs79(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs79(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function c!(cx, x) Ti = eltype(x) cx[1] = x[1] + x[2]^2 + x[3]^3 - 2 - 3 * Ti(sqrt(2)) diff --git a/src/ADNLPProblems/hs8.jl b/src/ADNLPProblems/hs8.jl index f428d574..1f6c4522 100644 --- a/src/ADNLPProblems/hs8.jl +++ b/src/ADNLPProblems/hs8.jl @@ -1,6 +1,6 @@ export hs8 -function hs8(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs8(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function c!(cx, x) cx[1] = x[1]^2 + x[2]^2 - 25 cx[2] = x[1] * x[2] - 9 diff --git a/src/ADNLPProblems/hs80.jl b/src/ADNLPProblems/hs80.jl index 88949cf8..cb549e37 100644 --- a/src/ADNLPProblems/hs80.jl +++ b/src/ADNLPProblems/hs80.jl @@ -1,6 +1,6 @@ export hs80 -function hs80(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs80(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return exp(prod(x[i] for i = 1:5)) diff --git a/src/ADNLPProblems/hs81.jl b/src/ADNLPProblems/hs81.jl index 381f3785..4526c782 100644 --- a/src/ADNLPProblems/hs81.jl +++ b/src/ADNLPProblems/hs81.jl @@ -1,6 +1,6 @@ export hs81 -function hs81(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs81(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return exp(prod(x[i] for i = 1:5)) - 1 // 2 * (x[1]^3 + x[2]^3 + 1)^2 diff --git a/src/ADNLPProblems/hs83.jl b/src/ADNLPProblems/hs83.jl index c65c9374..41fc1c3a 100644 --- a/src/ADNLPProblems/hs83.jl +++ b/src/ADNLPProblems/hs83.jl @@ -1,6 +1,6 @@ export hs83 -function hs83(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs83(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) Ti = eltype(x) diff --git a/src/ADNLPProblems/hs84.jl b/src/ADNLPProblems/hs84.jl index e072d590..f7fd4972 100644 --- a/src/ADNLPProblems/hs84.jl +++ b/src/ADNLPProblems/hs84.jl @@ -1,6 +1,6 @@ export hs84 -function hs84(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs84(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} a = Array{Rational{Int}}(undef, 21) a[1:7] = [ -24345, diff --git a/src/ADNLPProblems/hs86.jl b/src/ADNLPProblems/hs86.jl index 59a8c3d5..dd83e00f 100644 --- a/src/ADNLPProblems/hs86.jl +++ b/src/ADNLPProblems/hs86.jl @@ -1,6 +1,6 @@ export hs86 -function hs86(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs86(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} a = Array{T}(undef, 10, 5) a[1, :] = [-16, 2, 0, 1, 0] a[2, :] = [0, -2, 0, 4, 2] diff --git a/src/ADNLPProblems/hs87.jl b/src/ADNLPProblems/hs87.jl index facfcc01..2cdd4652 100644 --- a/src/ADNLPProblems/hs87.jl +++ b/src/ADNLPProblems/hs87.jl @@ -1,6 +1,6 @@ export hs87 -function hs87(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs87(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f1(x) #= return if 0 <= x <= 300 diff --git a/src/ADNLPProblems/hs9.jl b/src/ADNLPProblems/hs9.jl index 2923b38e..56e3f8fb 100644 --- a/src/ADNLPProblems/hs9.jl +++ b/src/ADNLPProblems/hs9.jl @@ -1,6 +1,6 @@ export hs9 -function hs9(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs9(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} return ADNLPModels.ADNLPModel( x -> sin(π * x[1] / 12) * cos(π * x[2] / 16), zeros(T, 2), diff --git a/src/ADNLPProblems/hs93.jl b/src/ADNLPProblems/hs93.jl index c71f4bc4..29e960e9 100644 --- a/src/ADNLPProblems/hs93.jl +++ b/src/ADNLPProblems/hs93.jl @@ -1,6 +1,6 @@ export hs93 -function hs93(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs93(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return 204 // 10000 * x[1] * x[4] * (x[1] + x[2] + x[3]) + diff --git a/src/ADNLPProblems/hs95.jl b/src/ADNLPProblems/hs95.jl index 7754bb42..9461a106 100644 --- a/src/ADNLPProblems/hs95.jl +++ b/src/ADNLPProblems/hs95.jl @@ -1,6 +1,6 @@ export hs95 -function hs95(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs95(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return 43 // 10 * x[1] + diff --git a/src/ADNLPProblems/hs96.jl b/src/ADNLPProblems/hs96.jl index 2da48e58..9160b494 100644 --- a/src/ADNLPProblems/hs96.jl +++ b/src/ADNLPProblems/hs96.jl @@ -1,6 +1,6 @@ export hs96 -function hs96(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs96(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return 43 // 10 * x[1] + diff --git a/src/ADNLPProblems/hs97.jl b/src/ADNLPProblems/hs97.jl index bd9a9720..b80067cb 100644 --- a/src/ADNLPProblems/hs97.jl +++ b/src/ADNLPProblems/hs97.jl @@ -1,6 +1,6 @@ export hs97 -function hs97(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs97(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return 43 // 10 * x[1] + diff --git a/src/ADNLPProblems/hs98.jl b/src/ADNLPProblems/hs98.jl index cce5c075..eab3aea4 100644 --- a/src/ADNLPProblems/hs98.jl +++ b/src/ADNLPProblems/hs98.jl @@ -1,6 +1,6 @@ export hs98 -function hs98(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs98(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return 43 // 10 * x[1] + diff --git a/src/ADNLPProblems/hs99.jl b/src/ADNLPProblems/hs99.jl index 69372735..aba8a0e0 100644 --- a/src/ADNLPProblems/hs99.jl +++ b/src/ADNLPProblems/hs99.jl @@ -1,6 +1,6 @@ export hs99 -function hs99(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function hs99(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} b = 32 a = [0, 50, 50, 75, 75, 75, 100, 100] t = [0, 25, 50, 100, 150, 200, 290, 380] diff --git a/src/ADNLPProblems/indef_mod.jl b/src/ADNLPProblems/indef_mod.jl index 9bcb1ef7..3950ae45 100644 --- a/src/ADNLPProblems/indef_mod.jl +++ b/src/ADNLPProblems/indef_mod.jl @@ -1,6 +1,6 @@ export indef_mod -function indef_mod(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function indef_mod(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} n < 3 && @warn("indef_mod: number of variables must be ≥ 4") n = max(3, n) function f(x; n = length(x)) diff --git a/src/ADNLPProblems/integreq.jl b/src/ADNLPProblems/integreq.jl index 6a270f59..2524a1ae 100644 --- a/src/ADNLPProblems/integreq.jl +++ b/src/ADNLPProblems/integreq.jl @@ -8,7 +8,7 @@ end function integreq( ::Val{:nlp}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} function f(x; n = length(x)) @@ -30,7 +30,7 @@ end function integreq( ::Val{:nls}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} function F!(r, x; n = length(x)) diff --git a/src/ADNLPProblems/jennrichsampson.jl b/src/ADNLPProblems/jennrichsampson.jl index 06e7573f..ef14ecc9 100644 --- a/src/ADNLPProblems/jennrichsampson.jl +++ b/src/ADNLPProblems/jennrichsampson.jl @@ -8,7 +8,7 @@ end function jennrichsampson( ::Val{:nlp}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, m::Int = 10, kwargs..., ) where {T} @@ -21,7 +21,7 @@ end function jennrichsampson( ::Val{:nls}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, m::Int = 10, kwargs..., ) where {T} diff --git a/src/ADNLPProblems/kirby2.jl b/src/ADNLPProblems/kirby2.jl index c0724eca..1795a536 100644 --- a/src/ADNLPProblems/kirby2.jl +++ b/src/ADNLPProblems/kirby2.jl @@ -8,7 +8,7 @@ end function kirby2( ::Val{:nlp}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} y = Rational{Int}[ @@ -179,7 +179,7 @@ end function kirby2( ::Val{:nls}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} y = Rational{Int}[ diff --git a/src/ADNLPProblems/kowosb.jl b/src/ADNLPProblems/kowosb.jl index c38d2d72..d3521971 100644 --- a/src/ADNLPProblems/kowosb.jl +++ b/src/ADNLPProblems/kowosb.jl @@ -8,7 +8,7 @@ end function kowosb( ::Val{:nlp}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} n = 4 @@ -51,7 +51,7 @@ end function kowosb( ::Val{:nls}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} n = 4 diff --git a/src/ADNLPProblems/lanczos1.jl b/src/ADNLPProblems/lanczos1.jl index 0fb327b6..945f78e3 100644 --- a/src/ADNLPProblems/lanczos1.jl +++ b/src/ADNLPProblems/lanczos1.jl @@ -8,7 +8,7 @@ end function lanczos1( ::Val{:nlp}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} y = Rational{Int}[ @@ -52,7 +52,7 @@ end function lanczos1( ::Val{:nls}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} y = Rational{Int}[ diff --git a/src/ADNLPProblems/lanczos2.jl b/src/ADNLPProblems/lanczos2.jl index 5d3219d2..409d52bb 100644 --- a/src/ADNLPProblems/lanczos2.jl +++ b/src/ADNLPProblems/lanczos2.jl @@ -8,7 +8,7 @@ end function lanczos2( ::Val{:nlp}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} y = Rational{Int}[ @@ -52,7 +52,7 @@ end function lanczos2( ::Val{:nls}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} y = Rational{Int}[ diff --git a/src/ADNLPProblems/lanczos3.jl b/src/ADNLPProblems/lanczos3.jl index 9ee6a984..36b2277b 100644 --- a/src/ADNLPProblems/lanczos3.jl +++ b/src/ADNLPProblems/lanczos3.jl @@ -8,7 +8,7 @@ end function lanczos3( ::Val{:nlp}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} y = Rational{Int}[ @@ -53,7 +53,7 @@ end function lanczos3( ::Val{:nls}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} y = Rational{Int}[ diff --git a/src/ADNLPProblems/liarwhd.jl b/src/ADNLPProblems/liarwhd.jl index 3009ada1..767d5ba7 100644 --- a/src/ADNLPProblems/liarwhd.jl +++ b/src/ADNLPProblems/liarwhd.jl @@ -1,6 +1,6 @@ export liarwhd -function liarwhd(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function liarwhd(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} n < 2 && @warn("liarwhd: number of variables must be ≥ 4") n = max(2, n) function f(x; n = length(x)) diff --git a/src/ADNLPProblems/lincon.jl b/src/ADNLPProblems/lincon.jl index f93e478a..1e2b136e 100644 --- a/src/ADNLPProblems/lincon.jl +++ b/src/ADNLPProblems/lincon.jl @@ -1,6 +1,6 @@ export lincon -function lincon(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function lincon(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} A = [1 2; 3 4] b = [5; 6] B = LinearAlgebra.diagm([3 * i for i = 3:5]) diff --git a/src/ADNLPProblems/linsv.jl b/src/ADNLPProblems/linsv.jl index 38b0fdf2..c9c2c360 100644 --- a/src/ADNLPProblems/linsv.jl +++ b/src/ADNLPProblems/linsv.jl @@ -1,6 +1,6 @@ export linsv -function linsv(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function linsv(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} x0 = zeros(T, 2) f(x) = x[1] lcon = T[3; 1] diff --git a/src/ADNLPProblems/marine.jl b/src/ADNLPProblems/marine.jl index 4f550b55..e238f36f 100644 --- a/src/ADNLPProblems/marine.jl +++ b/src/ADNLPProblems/marine.jl @@ -3,7 +3,7 @@ export marine function marine(; n::Int = default_nvar, nc::Int = 1, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} nc = max(min(nc, 4), 1) # number of collocation points diff --git a/src/ADNLPProblems/meyer3.jl b/src/ADNLPProblems/meyer3.jl index 67f32a2a..2f913166 100644 --- a/src/ADNLPProblems/meyer3.jl +++ b/src/ADNLPProblems/meyer3.jl @@ -8,7 +8,7 @@ end function meyer3( ::Val{:nlp}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} t = 45 .+ 5 * (1:16) @@ -40,7 +40,7 @@ end function meyer3( ::Val{:nls}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} t = 45 .+ 5 * (1:16) diff --git a/src/ADNLPProblems/mgh01feas.jl b/src/ADNLPProblems/mgh01feas.jl index 2e23c725..73d2647e 100644 --- a/src/ADNLPProblems/mgh01feas.jl +++ b/src/ADNLPProblems/mgh01feas.jl @@ -1,6 +1,6 @@ export mgh01feas -function mgh01feas(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function mgh01feas(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} x0 = T[-1.2; 1.0] f(x) = zero(eltype(x)) function c!(cx, x) diff --git a/src/ADNLPProblems/mgh09.jl b/src/ADNLPProblems/mgh09.jl index a40dad32..f75aa72a 100644 --- a/src/ADNLPProblems/mgh09.jl +++ b/src/ADNLPProblems/mgh09.jl @@ -5,7 +5,7 @@ function mgh09(; use_nls::Bool = false, kwargs...) return mgh09(Val(model); kwargs...) end -function mgh09(::Val{:nlp}; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function mgh09(::Val{:nlp}; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} y = Rational{Int}[ 1957//10000 4 1947//10000 2 @@ -30,7 +30,7 @@ function mgh09(::Val{:nlp}; n::Int = default_nvar, type::Val{T} = Val(Float64), return ADNLPModels.ADNLPModel(f, x0, name = "mgh09"; kwargs...) end -function mgh09(::Val{:nls}; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function mgh09(::Val{:nls}; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} y = Rational{Int}[ 1957//10000 4 1947//10000 2 diff --git a/src/ADNLPProblems/mgh10.jl b/src/ADNLPProblems/mgh10.jl index 150f19c7..b947e02a 100644 --- a/src/ADNLPProblems/mgh10.jl +++ b/src/ADNLPProblems/mgh10.jl @@ -5,7 +5,7 @@ function mgh10(; use_nls::Bool = false, kwargs...) return mgh10(Val(model); kwargs...) end -function mgh10(::Val{:nlp}; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function mgh10(::Val{:nlp}; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} y = Rational{Int}[ 3.478000E+04 5.000000E+01 2.861000E+04 5.500000E+01 @@ -32,7 +32,7 @@ function mgh10(::Val{:nlp}; n::Int = default_nvar, type::Val{T} = Val(Float64), return ADNLPModels.ADNLPModel(f, x0, name = "mgh10"; kwargs...) end -function mgh10(::Val{:nls}; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function mgh10(::Val{:nls}; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} y = Rational{Int}[ 3.478000E+04 5.000000E+01 2.861000E+04 5.500000E+01 diff --git a/src/ADNLPProblems/mgh17.jl b/src/ADNLPProblems/mgh17.jl index 677a94ed..67c3ced8 100644 --- a/src/ADNLPProblems/mgh17.jl +++ b/src/ADNLPProblems/mgh17.jl @@ -5,7 +5,7 @@ function mgh17(; use_nls::Bool = false, kwargs...) return mgh17(Val(model); kwargs...) end -function mgh17(::Val{:nlp}; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function mgh17(::Val{:nlp}; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} y = Rational{Int}[ 8.440000E-01 0.000000E+00 9.080000E-01 1.000000E+01 @@ -51,7 +51,7 @@ function mgh17(::Val{:nlp}; n::Int = default_nvar, type::Val{T} = Val(Float64), return ADNLPModels.ADNLPModel(f, x0, name = "mgh17"; kwargs...) end -function mgh17(::Val{:nls}; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function mgh17(::Val{:nls}; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} y = Rational{Int}[ 8.440000E-01 0.000000E+00 9.080000E-01 1.000000E+01 diff --git a/src/ADNLPProblems/misra1a.jl b/src/ADNLPProblems/misra1a.jl index 7ff2dcc8..dee73688 100644 --- a/src/ADNLPProblems/misra1a.jl +++ b/src/ADNLPProblems/misra1a.jl @@ -8,7 +8,7 @@ end function misra1a( ::Val{:nlp}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} y = Rational{Int}[ @@ -38,7 +38,7 @@ end function misra1a( ::Val{:nls}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} y = Rational{Int}[ diff --git a/src/ADNLPProblems/misra1b.jl b/src/ADNLPProblems/misra1b.jl index 004f7db3..f4c2259d 100644 --- a/src/ADNLPProblems/misra1b.jl +++ b/src/ADNLPProblems/misra1b.jl @@ -8,7 +8,7 @@ end function misra1b( ::Val{:nlp}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} y = Rational{Int}[ @@ -38,7 +38,7 @@ end function misra1b( ::Val{:nls}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} y = Rational{Int}[ diff --git a/src/ADNLPProblems/misra1c.jl b/src/ADNLPProblems/misra1c.jl index dc485b16..08db73c2 100644 --- a/src/ADNLPProblems/misra1c.jl +++ b/src/ADNLPProblems/misra1c.jl @@ -8,7 +8,7 @@ end function misra1c( ::Val{:nlp}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} y = Rational{Int}[ @@ -38,7 +38,7 @@ end function misra1c( ::Val{:nls}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} y = Rational{Int}[ diff --git a/src/ADNLPProblems/misra1d.jl b/src/ADNLPProblems/misra1d.jl index 393935e7..f0347858 100644 --- a/src/ADNLPProblems/misra1d.jl +++ b/src/ADNLPProblems/misra1d.jl @@ -8,7 +8,7 @@ end function misra1d( ::Val{:nlp}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} y = Rational{Int}[ @@ -39,7 +39,7 @@ end function misra1d( ::Val{:nls}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} y = Rational{Int}[ diff --git a/src/ADNLPProblems/morebv.jl b/src/ADNLPProblems/morebv.jl index 2018ec1d..bb16b244 100644 --- a/src/ADNLPProblems/morebv.jl +++ b/src/ADNLPProblems/morebv.jl @@ -8,7 +8,7 @@ end function morebv( ::Val{:nlp}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} n < 2 && @warn("morebv: number of variables must be ≥ 4") @@ -31,7 +31,7 @@ end function morebv( ::Val{:nls}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} n < 2 && @warn("morebv: number of variables must be ≥ 4") diff --git a/src/ADNLPProblems/nasty.jl b/src/ADNLPProblems/nasty.jl index 554e9efc..dfbb7e21 100644 --- a/src/ADNLPProblems/nasty.jl +++ b/src/ADNLPProblems/nasty.jl @@ -1,6 +1,6 @@ export nasty -function nasty(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function nasty(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return 1 // 2 * ((eltype(x)(1.0e10) * x[1])^2 + x[2]^2) diff --git a/src/ADNLPProblems/ncb20.jl b/src/ADNLPProblems/ncb20.jl index 69ccad43..faa2cff3 100644 --- a/src/ADNLPProblems/ncb20.jl +++ b/src/ADNLPProblems/ncb20.jl @@ -1,6 +1,6 @@ export ncb20 -function ncb20(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function ncb20(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} n < 31 && @warn("ncb20: number of variables must be ≥ 31") n = max(31, n) function f(x; n = length(x)) diff --git a/src/ADNLPProblems/ncb20b.jl b/src/ADNLPProblems/ncb20b.jl index e8894d6e..1809f12f 100644 --- a/src/ADNLPProblems/ncb20b.jl +++ b/src/ADNLPProblems/ncb20b.jl @@ -1,6 +1,6 @@ export ncb20b -function ncb20b(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function ncb20b(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} n < 20 && @warn("ncb20b: number of variables must be ≥ 20") n = max(20, n) function f(x; n = length(x)) diff --git a/src/ADNLPProblems/nelson.jl b/src/ADNLPProblems/nelson.jl index 0d710ede..a4a74310 100644 --- a/src/ADNLPProblems/nelson.jl +++ b/src/ADNLPProblems/nelson.jl @@ -8,7 +8,7 @@ end function nelson( ::Val{:nlp}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} y = Rational{Int}[ @@ -154,7 +154,7 @@ end function nelson( ::Val{:nls}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} y = Rational{Int}[ diff --git a/src/ADNLPProblems/noncvxu2.jl b/src/ADNLPProblems/noncvxu2.jl index db7e2df2..4d4429f1 100644 --- a/src/ADNLPProblems/noncvxu2.jl +++ b/src/ADNLPProblems/noncvxu2.jl @@ -1,6 +1,6 @@ export noncvxu2 -function noncvxu2(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function noncvxu2(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} n < 2 && @warn("noncvxun2: number of variables must be ≥ 2") n = max(2, n) function f(x; n = length(x)) diff --git a/src/ADNLPProblems/noncvxun.jl b/src/ADNLPProblems/noncvxun.jl index c1780f62..15579157 100644 --- a/src/ADNLPProblems/noncvxun.jl +++ b/src/ADNLPProblems/noncvxun.jl @@ -1,6 +1,6 @@ export noncvxun -function noncvxun(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function noncvxun(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} n < 2 && @warn("noncvxun: number of variables must be ≥ 2") n = max(2, n) function f(x; n = length(x)) diff --git a/src/ADNLPProblems/nondia.jl b/src/ADNLPProblems/nondia.jl index cf5afc4e..36052490 100644 --- a/src/ADNLPProblems/nondia.jl +++ b/src/ADNLPProblems/nondia.jl @@ -1,6 +1,6 @@ export nondia -function nondia(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function nondia(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} n < 2 && @warn("nondia: number of variables must be ≥ 2") n = max(2, n) function f(x; n = length(x)) diff --git a/src/ADNLPProblems/nondquar.jl b/src/ADNLPProblems/nondquar.jl index 5859f14c..15d85abc 100644 --- a/src/ADNLPProblems/nondquar.jl +++ b/src/ADNLPProblems/nondquar.jl @@ -1,6 +1,6 @@ export nondquar -function nondquar(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function nondquar(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} n < 2 && @warn("nondquar: number of variables must be ≥ 2") n = max(2, n) function f(x; n = length(x)) diff --git a/src/ADNLPProblems/osborne1.jl b/src/ADNLPProblems/osborne1.jl index cce2f485..9652f1a9 100644 --- a/src/ADNLPProblems/osborne1.jl +++ b/src/ADNLPProblems/osborne1.jl @@ -9,7 +9,7 @@ end function osborne1( ::Val{:nlp}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} y = [ @@ -60,7 +60,7 @@ end function osborne1( ::Val{:nls}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} y = [ diff --git a/src/ADNLPProblems/osborne2.jl b/src/ADNLPProblems/osborne2.jl index 4c30c938..cade8df6 100644 --- a/src/ADNLPProblems/osborne2.jl +++ b/src/ADNLPProblems/osborne2.jl @@ -8,7 +8,7 @@ end function osborne2( ::Val{:nlp}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} y = [ @@ -99,7 +99,7 @@ end function osborne2( ::Val{:nls}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} y = [ diff --git a/src/ADNLPProblems/palmer1c.jl b/src/ADNLPProblems/palmer1c.jl index 7bfdd9b0..26804c18 100644 --- a/src/ADNLPProblems/palmer1c.jl +++ b/src/ADNLPProblems/palmer1c.jl @@ -8,7 +8,7 @@ end function palmer1c( ::Val{:nlp}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} X = [ @@ -97,7 +97,7 @@ end function palmer1c( ::Val{:nls}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} X = [ diff --git a/src/ADNLPProblems/palmer1d.jl b/src/ADNLPProblems/palmer1d.jl index 7660a5e4..60002b82 100644 --- a/src/ADNLPProblems/palmer1d.jl +++ b/src/ADNLPProblems/palmer1d.jl @@ -8,7 +8,7 @@ end function palmer1d( ::Val{:nlp}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} X = [ @@ -97,7 +97,7 @@ end function palmer1d( ::Val{:nls}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} X = [ diff --git a/src/ADNLPProblems/palmer2c.jl b/src/ADNLPProblems/palmer2c.jl index 8f5cedf5..705fd457 100644 --- a/src/ADNLPProblems/palmer2c.jl +++ b/src/ADNLPProblems/palmer2c.jl @@ -8,7 +8,7 @@ end function palmer2c( ::Val{:nlp}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} X = [ @@ -73,7 +73,7 @@ end function palmer2c( ::Val{:nls}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} X = [ diff --git a/src/ADNLPProblems/palmer3c.jl b/src/ADNLPProblems/palmer3c.jl index d82e4bb5..5a6cfb2d 100644 --- a/src/ADNLPProblems/palmer3c.jl +++ b/src/ADNLPProblems/palmer3c.jl @@ -8,7 +8,7 @@ end function palmer3c( ::Val{:nlp}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} X = [ @@ -73,7 +73,7 @@ end function palmer3c( ::Val{:nls}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} X = [ diff --git a/src/ADNLPProblems/palmer4c.jl b/src/ADNLPProblems/palmer4c.jl index 1484e000..ca769af4 100644 --- a/src/ADNLPProblems/palmer4c.jl +++ b/src/ADNLPProblems/palmer4c.jl @@ -8,7 +8,7 @@ end function palmer4c( ::Val{:nlp}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} X = [ @@ -73,7 +73,7 @@ end function palmer4c( ::Val{:nls}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} X = [ diff --git a/src/ADNLPProblems/palmer5c.jl b/src/ADNLPProblems/palmer5c.jl index d53a6358..1662c93a 100644 --- a/src/ADNLPProblems/palmer5c.jl +++ b/src/ADNLPProblems/palmer5c.jl @@ -8,7 +8,7 @@ end function palmer5c( ::Val{:nlp}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} X = [ @@ -64,7 +64,7 @@ end function palmer5c( ::Val{:nls}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} X = [ diff --git a/src/ADNLPProblems/palmer5d.jl b/src/ADNLPProblems/palmer5d.jl index 040ec1aa..8d071565 100644 --- a/src/ADNLPProblems/palmer5d.jl +++ b/src/ADNLPProblems/palmer5d.jl @@ -8,7 +8,7 @@ end function palmer5d( ::Val{:nlp}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} X = [ @@ -51,7 +51,7 @@ end function palmer5d( ::Val{:nls}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} X = [ diff --git a/src/ADNLPProblems/palmer6c.jl b/src/ADNLPProblems/palmer6c.jl index 860bc39d..718e0570 100644 --- a/src/ADNLPProblems/palmer6c.jl +++ b/src/ADNLPProblems/palmer6c.jl @@ -8,7 +8,7 @@ end function palmer6c( ::Val{:nlp}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} X = [ @@ -53,7 +53,7 @@ end function palmer6c( ::Val{:nls}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} X = [ diff --git a/src/ADNLPProblems/palmer7c.jl b/src/ADNLPProblems/palmer7c.jl index 687fb8bb..2f04c39e 100644 --- a/src/ADNLPProblems/palmer7c.jl +++ b/src/ADNLPProblems/palmer7c.jl @@ -8,7 +8,7 @@ end function palmer7c( ::Val{:nlp}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} X = [ @@ -53,7 +53,7 @@ end function palmer7c( ::Val{:nls}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} X = [ diff --git a/src/ADNLPProblems/palmer8c.jl b/src/ADNLPProblems/palmer8c.jl index 85af26af..0c75bd16 100644 --- a/src/ADNLPProblems/palmer8c.jl +++ b/src/ADNLPProblems/palmer8c.jl @@ -8,7 +8,7 @@ end function palmer8c( ::Val{:nlp}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} X = [ @@ -51,7 +51,7 @@ end function palmer8c( ::Val{:nls}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} X = [ diff --git a/src/ADNLPProblems/penalty1.jl b/src/ADNLPProblems/penalty1.jl index 99c58481..b19d0c0d 100644 --- a/src/ADNLPProblems/penalty1.jl +++ b/src/ADNLPProblems/penalty1.jl @@ -8,7 +8,7 @@ end function penalty1( ::Val{:nlp}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} function f(x; n = length(x), a = eltype(x)(sqrt(1e-5))) @@ -22,7 +22,7 @@ end function penalty1( ::Val{:nls}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} function F!(r, x; n = length(x), a = eltype(x)(sqrt(1e-5))) diff --git a/src/ADNLPProblems/penalty2.jl b/src/ADNLPProblems/penalty2.jl index 3f9fa2af..b6e7ed53 100644 --- a/src/ADNLPProblems/penalty2.jl +++ b/src/ADNLPProblems/penalty2.jl @@ -1,6 +1,6 @@ export penalty2 -function penalty2(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function penalty2(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} n < 3 && @warn("penalty2: number of variables must be ≥ 3") n = max(3, n) function f(x; n = length(x)) diff --git a/src/ADNLPProblems/penalty3.jl b/src/ADNLPProblems/penalty3.jl index 8f8a7f9b..5700f8ba 100644 --- a/src/ADNLPProblems/penalty3.jl +++ b/src/ADNLPProblems/penalty3.jl @@ -1,6 +1,6 @@ export penalty3 -function penalty3(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function penalty3(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} n < 3 && @warn("penalty3: number of variables must be ≥ 3") n = max(3, n) function f(x; n = length(x)) diff --git a/src/ADNLPProblems/polygon.jl b/src/ADNLPProblems/polygon.jl index f8523a04..ad7a0e65 100644 --- a/src/ADNLPProblems/polygon.jl +++ b/src/ADNLPProblems/polygon.jl @@ -1,6 +1,6 @@ export polygon -function polygon(args...; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function polygon(args...; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} N = div(n, 2) function f(y; N = N) @views r, θ = y[1:N], y[(N + 1):end] diff --git a/src/ADNLPProblems/polygon1.jl b/src/ADNLPProblems/polygon1.jl index d0e34b87..fd8459eb 100644 --- a/src/ADNLPProblems/polygon1.jl +++ b/src/ADNLPProblems/polygon1.jl @@ -1,6 +1,6 @@ export polygon1 -function polygon1(args...; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function polygon1(args...; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} N = div(n, 2) function f(y; N = N) @views r, θ = y[1:N], y[(N + 1):end] diff --git a/src/ADNLPProblems/polygon2.jl b/src/ADNLPProblems/polygon2.jl index 82033449..a409a4bc 100644 --- a/src/ADNLPProblems/polygon2.jl +++ b/src/ADNLPProblems/polygon2.jl @@ -1,6 +1,6 @@ export polygon2 -function polygon2(args...; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function polygon2(args...; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} N = div(n, 2) function f(y; N = N) r, α = y[1:N], y[(N + 1):end] diff --git a/src/ADNLPProblems/polygon3.jl b/src/ADNLPProblems/polygon3.jl index 27f2d54b..8cea88d2 100644 --- a/src/ADNLPProblems/polygon3.jl +++ b/src/ADNLPProblems/polygon3.jl @@ -1,6 +1,6 @@ export polygon3 -function polygon3(args...; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function polygon3(args...; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} N = div(n, 2) function f(y; N = N) @views x, y = y[1:N], y[(N + 1):end] diff --git a/src/ADNLPProblems/powellbs.jl b/src/ADNLPProblems/powellbs.jl index e2ef9b47..e538125c 100644 --- a/src/ADNLPProblems/powellbs.jl +++ b/src/ADNLPProblems/powellbs.jl @@ -1,6 +1,6 @@ export powellbs -function powellbs(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function powellbs(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} f(x) = 1 // 2 * ((10000 * x[1] * x[2] - 1)^2 + (exp(-x[1]) + exp(-x[2]) - 10001 // 10000)^2) x0 = T[0, 1] return ADNLPModels.ADNLPModel(f, x0, name = "powellbs"; kwargs...) diff --git a/src/ADNLPProblems/powellsg.jl b/src/ADNLPProblems/powellsg.jl index 3ce2c097..ee0c09c5 100644 --- a/src/ADNLPProblems/powellsg.jl +++ b/src/ADNLPProblems/powellsg.jl @@ -1,6 +1,6 @@ export powellsg -function powellsg(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function powellsg(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} (n % 4 == 0) || @warn("powellsg: number of variables adjusted to be a multiple of 4") n = 4 * max(1, div(n, 4)) # number of variables adjusted to be a multiple of 4 function f(x; n = length(x)) diff --git a/src/ADNLPProblems/power.jl b/src/ADNLPProblems/power.jl index 2aaa0504..4ecd32e7 100644 --- a/src/ADNLPProblems/power.jl +++ b/src/ADNLPProblems/power.jl @@ -5,7 +5,7 @@ function power(; use_nls::Bool = false, kwargs...) return power(Val(model); kwargs...) end -function power(::Val{:nlp}; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function power(::Val{:nlp}; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x; n = length(x)) return 1 // 2 * (sum((i * x[i]^2) for i = 1:n))^2 end @@ -13,7 +13,7 @@ function power(::Val{:nlp}; n::Int = default_nvar, type::Val{T} = Val(Float64), return ADNLPModels.ADNLPModel(f, x0, name = "power"; kwargs...) end -function power(::Val{:nls}; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function power(::Val{:nls}; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function F!(r, x; n = length(x)) r[1] = sum((i * x[i]^2) for i = 1:n) return r diff --git a/src/ADNLPProblems/quartc.jl b/src/ADNLPProblems/quartc.jl index fee9970b..289b7225 100644 --- a/src/ADNLPProblems/quartc.jl +++ b/src/ADNLPProblems/quartc.jl @@ -1,6 +1,6 @@ export quartc -function quartc(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function quartc(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x; n = length(x)) return sum((x[i] - i)^4 for i = 1:n) end diff --git a/src/ADNLPProblems/rat42.jl b/src/ADNLPProblems/rat42.jl index 6b491fc7..c666ab17 100644 --- a/src/ADNLPProblems/rat42.jl +++ b/src/ADNLPProblems/rat42.jl @@ -5,7 +5,7 @@ function rat42(; use_nls::Bool = false, kwargs...) return rat42(Val(model); kwargs...) end -function rat42(::Val{:nlp}; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function rat42(::Val{:nlp}; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} y = Rational{Int}[ 8.930E0 9.000E0 10.800E0 14.000E0 @@ -24,7 +24,7 @@ function rat42(::Val{:nlp}; n::Int = default_nvar, type::Val{T} = Val(Float64), return ADNLPModels.ADNLPModel(f, x0, name = "rat42"; kwargs...) end -function rat42(::Val{:nls}; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function rat42(::Val{:nls}; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} y = Rational{Int}[ 8.930E0 9.000E0 10.800E0 14.000E0 diff --git a/src/ADNLPProblems/rat43.jl b/src/ADNLPProblems/rat43.jl index 925e73f5..e3e6552e 100644 --- a/src/ADNLPProblems/rat43.jl +++ b/src/ADNLPProblems/rat43.jl @@ -5,7 +5,7 @@ function rat43(; use_nls::Bool = false, kwargs...) return rat43(Val(model); kwargs...) end -function rat43(::Val{:nlp}; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function rat43(::Val{:nlp}; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} y = Rational{Int}[ 16.08E0 1.0E0 33.83E0 2.0E0 @@ -31,7 +31,7 @@ function rat43(::Val{:nlp}; n::Int = default_nvar, type::Val{T} = Val(Float64), return ADNLPModels.ADNLPModel(f, x0, name = "rat43"; kwargs...) end -function rat43(::Val{:nls}; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function rat43(::Val{:nls}; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} y = Rational{Int}[ 16.08E0 1.0E0 33.83E0 2.0E0 diff --git a/src/ADNLPProblems/robotarm.jl b/src/ADNLPProblems/robotarm.jl index f63c3cb9..b395b820 100644 --- a/src/ADNLPProblems/robotarm.jl +++ b/src/ADNLPProblems/robotarm.jl @@ -12,7 +12,7 @@ export robotarm function robotarm(; n::Int = default_nvar, L = 4.5, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} N = max(2, div(n, 9)) diff --git a/src/ADNLPProblems/rozman1.jl b/src/ADNLPProblems/rozman1.jl index 1b780253..0ab12259 100644 --- a/src/ADNLPProblems/rozman1.jl +++ b/src/ADNLPProblems/rozman1.jl @@ -8,7 +8,7 @@ end function rozman1( ::Val{:nlp}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} y = Rational{Int}[ @@ -50,7 +50,7 @@ end function rozman1( ::Val{:nls}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} y = Rational{Int}[ diff --git a/src/ADNLPProblems/sbrybnd.jl b/src/ADNLPProblems/sbrybnd.jl index e42c817c..c4fadc64 100644 --- a/src/ADNLPProblems/sbrybnd.jl +++ b/src/ADNLPProblems/sbrybnd.jl @@ -8,7 +8,7 @@ end function sbrybnd( ::Val{:nlp}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} n < 2 && @warn("sbrybnd: number of variables must be ≥ 2") @@ -31,7 +31,7 @@ end function sbrybnd( ::Val{:nls}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} n < 2 && @warn("sbrybnd: number of variables must be ≥ 2") diff --git a/src/ADNLPProblems/schmvett.jl b/src/ADNLPProblems/schmvett.jl index 2b086a2f..7c91a015 100644 --- a/src/ADNLPProblems/schmvett.jl +++ b/src/ADNLPProblems/schmvett.jl @@ -1,6 +1,6 @@ export schmvett -function schmvett(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function schmvett(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} n < 3 && @warn("schmvett: number of variables must be ≥ 3") n = max(3, n) function f(x; n = length(x)) diff --git a/src/ADNLPProblems/scosine.jl b/src/ADNLPProblems/scosine.jl index ca3f88c7..3b8a1de7 100644 --- a/src/ADNLPProblems/scosine.jl +++ b/src/ADNLPProblems/scosine.jl @@ -1,6 +1,6 @@ export scosine -function scosine(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function scosine(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} n < 2 && @warn("scosine: number of variables must be ≥ 2") n = max(2, n) p = [exp(6 * (i - 1) // (n - 1)) for i = 1:n] diff --git a/src/ADNLPProblems/shpak1.jl b/src/ADNLPProblems/shpak1.jl index 7cdec9aa..b89ca118 100644 --- a/src/ADNLPProblems/shpak1.jl +++ b/src/ADNLPProblems/shpak1.jl @@ -1,6 +1,6 @@ export Shpak1 -function Shpak1(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function Shpak1(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return sin(x[1]) + sin(10 // 3 * x[1]) diff --git a/src/ADNLPProblems/shpak2.jl b/src/ADNLPProblems/shpak2.jl index 6a8b367e..c1ff87ee 100644 --- a/src/ADNLPProblems/shpak2.jl +++ b/src/ADNLPProblems/shpak2.jl @@ -1,6 +1,6 @@ export Shpak2 -function Shpak2(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function Shpak2(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return sin(x[1]) + sin(10 // 3 * x[1]) diff --git a/src/ADNLPProblems/shpak3.jl b/src/ADNLPProblems/shpak3.jl index 07ff8f6d..a9008b9d 100644 --- a/src/ADNLPProblems/shpak3.jl +++ b/src/ADNLPProblems/shpak3.jl @@ -1,6 +1,6 @@ export Shpak3 -function Shpak3(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function Shpak3(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return 1 * sin(2 * x[1] + 1) + diff --git a/src/ADNLPProblems/shpak4.jl b/src/ADNLPProblems/shpak4.jl index d869f834..55e4390e 100644 --- a/src/ADNLPProblems/shpak4.jl +++ b/src/ADNLPProblems/shpak4.jl @@ -1,6 +1,6 @@ export Shpak4 -function Shpak4(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function Shpak4(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) n = length(x) return (x[1] + sin(x[1])) * exp(-(x[1])^2) diff --git a/src/ADNLPProblems/shpak5.jl b/src/ADNLPProblems/shpak5.jl index 4089d720..ce150f53 100644 --- a/src/ADNLPProblems/shpak5.jl +++ b/src/ADNLPProblems/shpak5.jl @@ -1,6 +1,6 @@ export Shpak5 -function Shpak5(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function Shpak5(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} veca = [3040 // 1000 1098 // 1000 674 // 1000 3537 // 1000 6173 // 1000 8679 // 1000 4503 // 1000 3328 // 1000 6937 // diff --git a/src/ADNLPProblems/shpak6.jl b/src/ADNLPProblems/shpak6.jl index f9bd8cda..b92b79a1 100644 --- a/src/ADNLPProblems/shpak6.jl +++ b/src/ADNLPProblems/shpak6.jl @@ -1,6 +1,6 @@ export Shpak6 -function Shpak6(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function Shpak6(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} veca = [4696 // 1000 4885 // 1000 800 // 1000 4986 // 1000 3901 // 1000 2395 // 1000 945 // 1000 8371 // 1000 6181 // diff --git a/src/ADNLPProblems/sinquad.jl b/src/ADNLPProblems/sinquad.jl index d1adda45..b7318683 100644 --- a/src/ADNLPProblems/sinquad.jl +++ b/src/ADNLPProblems/sinquad.jl @@ -1,6 +1,6 @@ export sinquad -function sinquad(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function sinquad(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} n < 3 && @warn("sinquad: number of variables must be ≥ 3") n = max(3, n) function f(x; n = length(x)) diff --git a/src/ADNLPProblems/sparsine.jl b/src/ADNLPProblems/sparsine.jl index 4047e819..d9e425d6 100644 --- a/src/ADNLPProblems/sparsine.jl +++ b/src/ADNLPProblems/sparsine.jl @@ -1,6 +1,6 @@ export sparsine -function sparsine(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function sparsine(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} n < 10 && @warn("sparsine: number of variables must be ≥ 10") n = max(10, n) function f(x; n = length(x)) diff --git a/src/ADNLPProblems/sparsqur.jl b/src/ADNLPProblems/sparsqur.jl index 7061b2a9..fbc0f2f1 100644 --- a/src/ADNLPProblems/sparsqur.jl +++ b/src/ADNLPProblems/sparsqur.jl @@ -1,6 +1,6 @@ export sparsqur -function sparsqur(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function sparsqur(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} n < 10 && @warn("sparsqur: number of variables must be ≥ 10") n = max(10, n) function f(x; n = length(x)) diff --git a/src/ADNLPProblems/spmsrtls.jl b/src/ADNLPProblems/spmsrtls.jl index fffa05ef..c710c85e 100644 --- a/src/ADNLPProblems/spmsrtls.jl +++ b/src/ADNLPProblems/spmsrtls.jl @@ -8,7 +8,7 @@ end function spmsrtls( ::Val{:nlp}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} m = max(Int(round((n + 2) / 3)), 34) @@ -66,7 +66,7 @@ end function spmsrtls( ::Val{:nls}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} m = max(Int(round((n + 2) / 3)), 34) diff --git a/src/ADNLPProblems/srosenbr.jl b/src/ADNLPProblems/srosenbr.jl index c395e37c..451d0a6e 100644 --- a/src/ADNLPProblems/srosenbr.jl +++ b/src/ADNLPProblems/srosenbr.jl @@ -1,6 +1,6 @@ export srosenbr -function srosenbr(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function srosenbr(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} (n % 2 == 0) || @warn("srosenbr: number of variables adjusted to be even") n = 2 * max(1, div(n, 2)) function f(x; n = length(x)) diff --git a/src/ADNLPProblems/structural.jl b/src/ADNLPProblems/structural.jl index 64e5b43f..6520152b 100644 --- a/src/ADNLPProblems/structural.jl +++ b/src/ADNLPProblems/structural.jl @@ -3,7 +3,7 @@ export structural function structural( args...; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} n = max(n, 100) diff --git a/src/ADNLPProblems/tetra.jl b/src/ADNLPProblems/tetra.jl index 19764659..e2063f9a 100644 --- a/src/ADNLPProblems/tetra.jl +++ b/src/ADNLPProblems/tetra.jl @@ -14,7 +14,7 @@ function tetra( TETS::Vector{Int64} = Tets_tetra, Const::Vector{Int64} = Constants_tetra; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} x0 = T.(x0) diff --git a/src/ADNLPProblems/threepk.jl b/src/ADNLPProblems/threepk.jl index cae5cc32..b0c41260 100644 --- a/src/ADNLPProblems/threepk.jl +++ b/src/ADNLPProblems/threepk.jl @@ -1,6 +1,6 @@ export threepk -function threepk(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function threepk(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} npkc = 3 npkcm1 = -1 + 3 npkcp1 = 1 + 3 diff --git a/src/ADNLPProblems/thurber.jl b/src/ADNLPProblems/thurber.jl index 9ed2e0b9..025b3dca 100644 --- a/src/ADNLPProblems/thurber.jl +++ b/src/ADNLPProblems/thurber.jl @@ -8,7 +8,7 @@ end function thurber( ::Val{:nlp}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} y = Rational{Int}[ @@ -67,7 +67,7 @@ end function thurber( ::Val{:nls}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} y = Rational{Int}[ diff --git a/src/ADNLPProblems/tointgss.jl b/src/ADNLPProblems/tointgss.jl index 53d342b6..8f2deb85 100644 --- a/src/ADNLPProblems/tointgss.jl +++ b/src/ADNLPProblems/tointgss.jl @@ -1,6 +1,6 @@ export tointgss -function tointgss(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function tointgss(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} n < 3 && @warn("tointgss: number of variables must be ≥ 3") n = max(3, n) function f(x; n = length(x)) diff --git a/src/ADNLPProblems/tquartic.jl b/src/ADNLPProblems/tquartic.jl index 35dd1bc5..9e69e60a 100644 --- a/src/ADNLPProblems/tquartic.jl +++ b/src/ADNLPProblems/tquartic.jl @@ -8,7 +8,7 @@ end function tquartic( ::Val{:nlp}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} n < 2 && @warn("tquartic: number of variables must be ≥ 2") @@ -23,7 +23,7 @@ end function tquartic( ::Val{:nls}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} n < 2 && @warn("tquartic: number of variables must be ≥ 2") diff --git a/src/ADNLPProblems/triangle.jl b/src/ADNLPProblems/triangle.jl index e8c5a549..3b684190 100644 --- a/src/ADNLPProblems/triangle.jl +++ b/src/ADNLPProblems/triangle.jl @@ -14,7 +14,7 @@ function triangle( TRIS::Vector{Int64} = Tr, Const::Vector{Int64} = Constants; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} x0 = T.(x0) diff --git a/src/ADNLPProblems/tridia.jl b/src/ADNLPProblems/tridia.jl index 16a010f4..8f303622 100644 --- a/src/ADNLPProblems/tridia.jl +++ b/src/ADNLPProblems/tridia.jl @@ -1,6 +1,6 @@ export tridia -function tridia(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function tridia(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x; n = length(x)) return (x[1] - 1)^2 + sum(i * (-x[i - 1] + 2 * x[i])^2 for i = 2:n) end diff --git a/src/ADNLPProblems/vardim.jl b/src/ADNLPProblems/vardim.jl index b3cf71d8..36ca4c3d 100644 --- a/src/ADNLPProblems/vardim.jl +++ b/src/ADNLPProblems/vardim.jl @@ -1,6 +1,6 @@ export vardim -function vardim(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function vardim(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x; n = length(x)) return sum((x[i] - 1)^2 for i = 1:n) + sum(i * (x[i] - 1) for i = 1:n)^2 + diff --git a/src/ADNLPProblems/vibrbeam.jl b/src/ADNLPProblems/vibrbeam.jl index 9690c532..faf763f8 100644 --- a/src/ADNLPProblems/vibrbeam.jl +++ b/src/ADNLPProblems/vibrbeam.jl @@ -8,7 +8,7 @@ end function vibrbeam( ::Val{:nlp}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} # Positions @@ -130,7 +130,7 @@ end function vibrbeam( ::Val{:nls}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} # Positions diff --git a/src/ADNLPProblems/watson.jl b/src/ADNLPProblems/watson.jl index 91a8a84f..14b18678 100644 --- a/src/ADNLPProblems/watson.jl +++ b/src/ADNLPProblems/watson.jl @@ -8,7 +8,7 @@ end function watson( ::Val{:nlp}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} n = min(max(n, 2), 31) @@ -37,7 +37,7 @@ end function watson( ::Val{:nls}; n::Int = default_nvar, - type::Val{T} = Val(Float64), + type::Type{T} = Float64, kwargs..., ) where {T} n = min(max(n, 2), 31) diff --git a/src/ADNLPProblems/woods.jl b/src/ADNLPProblems/woods.jl index 3357b131..42616656 100644 --- a/src/ADNLPProblems/woods.jl +++ b/src/ADNLPProblems/woods.jl @@ -1,6 +1,6 @@ export woods -function woods(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function woods(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} (n % 4 == 0) || @warn("woods: number of variables adjusted to be a multiple of 4") n = 4 * max(1, div(n, 4)) function f(x; n = length(x)) diff --git a/src/ADNLPProblems/zangwil3.jl b/src/ADNLPProblems/zangwil3.jl index c6c8ea57..64558744 100644 --- a/src/ADNLPProblems/zangwil3.jl +++ b/src/ADNLPProblems/zangwil3.jl @@ -1,6 +1,6 @@ export zangwil3 -function zangwil3(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T} +function zangwil3(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T} function f(x) return zero(eltype(x)) end diff --git a/test/test_utils.jl b/test/test_utils.jl index 13366280..b1b75a1f 100644 --- a/test/test_utils.jl +++ b/test/test_utils.jl @@ -139,9 +139,9 @@ function test_multi_precision(prob::Symbol; list_types = [Float32, Float64]) for T in list_types nlp = if (nvar + ncon < 10000) - eval(Meta.parse("ADNLPProblems.$(prob)(type=$(Val(T)))")) + eval(Meta.parse("ADNLPProblems.$(prob)(type=$(T))")) else - eval(Meta.parse("ADNLPProblems.$(prob)(type=$(Val(T)), " * simp_backend * ")")) + eval(Meta.parse("ADNLPProblems.$(prob)(type=$T), " * simp_backend * ")")) end test_multi_precision(T, nlp) end