From 48299db5366f41c36683458bef28b3c4254c34d9 Mon Sep 17 00:00:00 2001 From: danphenderson Date: Thu, 26 Dec 2024 18:44:49 -0500 Subject: [PATCH] Fix small dimension specification issue. --- src/ADNLPProblems/clplatea.jl | 4 ++-- src/ADNLPProblems/clplateb.jl | 4 ++-- src/ADNLPProblems/clplatec.jl | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/ADNLPProblems/clplatea.jl b/src/ADNLPProblems/clplatea.jl index a9ba039e..8cdd7ebc 100644 --- a/src/ADNLPProblems/clplatea.jl +++ b/src/ADNLPProblems/clplatea.jl @@ -6,8 +6,8 @@ function clplatea(; wght = -0.1, kwargs..., ) where {T} - p = floor(Int, sqrt(n)) - p * p != n && @warn("clplatea: number of variables adjusted from $n down to $(p*p)") + p = floor(Int, sqrt(n)) < 3 ? 3 : floor(Int, sqrt(n)) + p * p != n && @warn("clplatea: number of variables adjusted from $n to $(p*p)") n = p * p hp2 = (1 // 2) * p^2 function f(x; p = p, hp2 = hp2, wght = wght) diff --git a/src/ADNLPProblems/clplateb.jl b/src/ADNLPProblems/clplateb.jl index ecc12dea..ff5bed85 100644 --- a/src/ADNLPProblems/clplateb.jl +++ b/src/ADNLPProblems/clplateb.jl @@ -6,8 +6,8 @@ function clplateb(; wght = -0.1, kwargs..., ) where {T} - p = floor(Int, sqrt(n)) - p * p != n && @warn("clplateb: number of variables adjusted from $n down to $(p*p)") + p = floor(Int, sqrt(n)) < 3 ? 3 : floor(Int, sqrt(n)) + p * p != n && @warn("clplateb: number of variables adjusted from $n to $(p*p)") n = p * p hp2 = 1 // 2 * p^2 function f(x; p = p, hp2 = hp2, wght = wght) diff --git a/src/ADNLPProblems/clplatec.jl b/src/ADNLPProblems/clplatec.jl index a72a7738..32d46826 100644 --- a/src/ADNLPProblems/clplatec.jl +++ b/src/ADNLPProblems/clplatec.jl @@ -8,8 +8,8 @@ function clplatec(; l = 0.01, kwargs..., ) where {T} - p = floor(Int, sqrt(n)) - p * p != n && @warn("clplatec: number of variables adjusted from $n down to $(p*p)") + p = floor(Int, sqrt(n)) < 3 ? 3 : floor(Int, sqrt(n)) + p * p != n && @warn("clplatec: number of variables adjusted from $n to $(p*p)") n = p * p hp2 = 1 // 2 * p^2