From 1f3a6dde0089dd75c6466ed63a08007c40148953 Mon Sep 17 00:00:00 2001 From: Alexis Montoison Date: Thu, 26 Dec 2024 22:21:23 +0100 Subject: [PATCH] Add a function is_supported for MadNLP.jl --- Project.toml | 2 +- src/wrappers.jl | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 50d9bd5..3a06c63 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "HSL" uuid = "34c5aeac-e683-54a6-a0e9-6e0fdc586c50" -version = "0.5.0" +version = "0.4.3" [deps] HSL_jll = "017b0a0e-03f4-516a-9b91-836bbd1904dd" diff --git a/src/wrappers.jl b/src/wrappers.jl index 3bfb800..6d7dbd4 100644 --- a/src/wrappers.jl +++ b/src/wrappers.jl @@ -180,3 +180,29 @@ include("Fortran/hsl_subset/mi24.jl") include("Fortran/hsl_subset/mi26.jl") include("Fortran/hsl_subset/ym01.jl") include("Fortran/hsl_subset/ym11.jl") + +# MadNLP +is_supported(::Val{:ma27}, ::DataType) = false +is_supported(::Val{:ma27}, ::Type{Float32}) = true +is_supported(::Val{:ma27}, ::Type{Float64}) = true +is_supported(::Val{:ma27}, ::Type{Float128}) = LIBHSL_version() ≥ v"2024.11.28" + +is_supported(::Val{:ma57}, ::DataType) = false +is_supported(::Val{:ma57}, ::Type{Float32}) = true +is_supported(::Val{:ma57}, ::Type{Float64}) = true +is_supported(::Val{:ma57}, ::Type{Float128}) = LIBHSL_version() > v"2024.11.28" + +is_supported(::Val{:hsl_ma77}, ::DataType) = false +is_supported(::Val{:hsl_ma77}, ::Type{Float32}) = true +is_supported(::Val{:hsl_ma77}, ::Type{Float64}) = true +is_supported(::Val{:hsl_ma77}, ::Type{Float128}) = LIBHSL_version() > v"2024.11.28" + +is_supported(::Val{:hsl_ma86}, ::DataType) = false +is_supported(::Val{:hsl_ma86}, ::Type{Float32}) = true +is_supported(::Val{:hsl_ma86}, ::Type{Float64}) = true +is_supported(::Val{:hsl_ma86}, ::Type{Float128}) = LIBHSL_version() > v"2024.11.28" + +is_supported(::Val{:hsl_ma97}, ::DataType) = false +is_supported(::Val{:hsl_ma97}, ::Type{Float32}) = true +is_supported(::Val{:hsl_ma97}, ::Type{Float64}) = true +is_supported(::Val{:hsl_ma97}, ::Type{Float128}) = LIBHSL_version() > v"2024.11.28"