diff --git a/docs/src/guide.jl b/docs/src/guide.jl index cf513f2..8d5b8a6 100644 --- a/docs/src/guide.jl +++ b/docs/src/guide.jl @@ -60,7 +60,8 @@ constraint( c, 3x[i+1]^3 + 2 * x[i+2] - 5 + sin(x[i+1] - x[i+2])sin(x[i+1] + x[i+2]) + 4x[i+1] - x[i]exp(x[i] - x[i+1]) - 3 for i = 1:(N-2); - lcon = -1.0, ucon = 1.0 + lcon = -1.0, + ucon = 1.0, ) # If you want to create a single-bounded constraint, you can set `lcon` to `-Inf` or `ucon` to `Inf`. For example, if we wanted to set the lower bound of the constraint to -1 and the upper bound to infinity, we could do it as follows: @@ -68,7 +69,8 @@ constraint( c, 3x[i+1]^3 + 2 * x[i+2] - 5 + sin(x[i+1] - x[i+2])sin(x[i+1] + x[i+2]) + 4x[i+1] - x[i]exp(x[i] - x[i+1]) - 3 for i = 1:(N-2); - lcon = -1.0, ucon = Inf + lcon = -1.0, + ucon = Inf, ) # ## ExaModel diff --git a/ext/ExaModelsMOI.jl b/ext/ExaModelsMOI.jl index be8b94f..c422092 100644 --- a/ext/ExaModelsMOI.jl +++ b/ext/ExaModelsMOI.jl @@ -445,10 +445,12 @@ function _exafy(i::R, var_to_idx, p) where {R<:Real} end function _exafy(e::MOI.ScalarNonlinearFunction, var_to_idx, p = ()) - return op(e.head)((begin - c, p = _exafy(e, var_to_idx, p) - c - end for e in e.args)...), p + return op(e.head)(( + begin + c, p = _exafy(e, var_to_idx, p) + c + end for e in e.args + )...), p end function _exafy(e::MOI.ScalarAffineFunction{T}, var_to_idx, p = ()) where {T}