Skip to content

Commit a9c3d38

Browse files
committed
Update powellsg :nls variant to use @adjust_nvar_warn macro
Ensures consistent warning messages between :nlp and :nls variants, showing both original and adjusted dimension values.
1 parent 4d99e6d commit a9c3d38

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/ADNLPProblems/powellsg.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,9 @@ function powellsg(::Val{:nlp}; n::Int = default_nvar, type::Type{T} = Float64, k
2525
end
2626

2727
function powellsg(::Val{:nls}; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T}
28-
(n % 4 == 0) || @warn("powellsg: number of variables adjusted to be a multiple of 4")
28+
n_orig = n
2929
n = 4 * max(1, div(n, 4))
30+
@adjust_nvar_warn("powellsg", n_orig, n)
3031
function F!(r, x; n = length(x))
3132
@inbounds for j = 1:4:n
3233
r[j] = x[j] + 10 * x[j + 1]

0 commit comments

Comments
 (0)