Skip to content

Commit

Permalink
Fix small dimension specification issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
danphenderson committed Dec 26, 2024
1 parent 536bb26 commit 48299db
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/ADNLPProblems/clplatea.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions src/ADNLPProblems/clplateb.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions src/ADNLPProblems/clplatec.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 48299db

Please sign in to comment.