JuliaSmoothOptimizers / ADNLPModels.jl

Other
37 stars 14 forks source link

Bug sparse hessian with conditionals #140

Closed tmigot closed 3 months ago

tmigot commented 1 year ago

There are at least two from OptimizationProblems.jl

function AMPGO07(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T}
  function f(x)
    return x[1] <= 0 ? convert(eltype(x), Inf) :
           sin(x[1]) + sin(10 // 3 * x[1]) + log(abs(x[1])) - 84 // 100 * x[1] + 3
  end
  x0 = T(2.7) * ones(T, 1)
  return ADNLPModels.ADNLPModel(f, x0, name = "AMPGO07"; kwargs...)
end

and

function AMPGO13(; n::Int = default_nvar, type::Val{T} = Val(Float64), kwargs...) where {T}
  function f(x)
    n = length(x)
    return 0 < x[1] < 1 ? -(x[1]^(2 // 3) + (1 - x[1]^2)^(1 // 3)) : convert(eltype(x), Inf)
  end
  x0 = T[1 / 1000]
  return ADNLPModels.ADNLPModel(f, x0, name = "AMPGO13"; kwargs...)
end

that are not continuous though

amontoison commented 1 year ago

As I proposed yesterday, we should remove these problems from the collection.

amontoison commented 3 months ago

Fixed with the new sparsity pattern detector.