diff --git a/docs/src/manual/nonlinear.md b/docs/src/manual/nonlinear.md index ae4ace22b9d..df4f63348db 100644 --- a/docs/src/manual/nonlinear.md +++ b/docs/src/manual/nonlinear.md @@ -353,9 +353,8 @@ op_square_2 = model[:op_square] ### Add an operator without macros -The [`@operator`](@ref) macro is syntactic sugar for the -[`add_nonlinear_operator`](@ref) method. Thus, the non-macro version of the -preceding example is: +The [`@operator`](@ref) macro is syntactic sugar for [`add_nonlinear_operator`](@ref). +Thus, the non-macro version of the preceding example is: ```@repl using JuMP @@ -534,7 +533,7 @@ your function which are `Float64`. ```julia function bad_f(x...) y = zeros(length(x)) # This constructs an array of `Float64`! - for i = 1:length(x) + for i in 1:length(x) y[i] = x[i]^i end return sum(y) @@ -542,7 +541,7 @@ end function good_f(x::T...) where {T<:Real} y = zeros(T, length(x)) # Construct an array of type `T` instead! - for i = 1:length(x) + for i in 1:length(x) y[i] = x[i]^i end return sum(y) diff --git a/src/nlp_expr.jl b/src/nlp_expr.jl index f16e867c6bb..6fe42fcb5ee 100644 --- a/src/nlp_expr.jl +++ b/src/nlp_expr.jl @@ -885,8 +885,8 @@ If `dim > 1`, then the method signatures of each function must be: * `∇²f(H::AbstractMatrix{T}, x::T...)::Nothing where {T<:Real}` Where the gradient vector `g` and Hessian matrix `H` are filled in-place. For -the Hessian, you must fill in the non-zero upper-triangular entries only. -Setting an off-diagonal lower-triangular element may error. +the Hessian, you must fill in the non-zero lower-triangular entries only. +Setting an off-diagonal upper-triangular element may error. ## Example @@ -1001,8 +1001,8 @@ If `dim > 1`, then the method signatures of each function must be: * `∇²f(H::AbstractMatrix{T}, x::T...)::Nothing where {T<:Real}` Where the gradient vector `g` and Hessian matrix `H` are filled in-place. For -the Hessian, you must fill in the non-zero upper-triangular entries only. -Setting an off-diagonal lower-triangular element may error. +the Hessian, you must fill in the non-zero lower-triangular entries only. +Setting an off-diagonal upper-triangular element may error. ## Example