Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
odow committed Apr 3, 2024
1 parent e92cd80 commit 7dfc743
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions src/MOI/MOI_wrapper.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4756,21 +4756,15 @@ function _reverse_polish(
type::Vector{Cint},
value::Vector{Cdouble},
)
if f.head == :- && length(f.args) == 1 # Special handling for unary -
push!(type, Lib.XPRS_TOK_OP)
push!(value, Lib.XPRS_OP_UMINUS)
for arg in reverse(f.args)
_reverse_polish(model, arg, type, value)
end
return
end
ret = get(_FUNCTION_MAP, f.head, nothing)
if ret === nothing
throw(MOI.UnsupportedNonlinearOperator(f.head))
elseif f.head == :+ && length(f.args) != 2 # Special handling for n-ary +
elseif f.head == :+ && length(f.args) != 2 # Special handling for n-ary +
ret = (Lib.XPRS_TOK_IFUN, Lib.XPRS_IFUN_SUM)
elseif f.head == :* && length(f.args) != 2 # Special handling for n-ary *
elseif f.head == :* && length(f.args) != 2 # Special handling for n-ary *
ret = (Lib.XPRS_TOK_IFUN, Lib.XPRS_IFUN_PROD)
elseif f.head == :- && length(f.args) == 1 # Special handling for unary -
ret = (Lib.XPRS_TOK_OP, Lib.XPRS_OP_UMINUS)

Check warning on line 4767 in src/MOI/MOI_wrapper.jl

View check run for this annotation

Codecov / codecov/patch

src/MOI/MOI_wrapper.jl#L4759-L4767

Added lines #L4759 - L4767 were not covered by tests
end
push!(type, ret[1])
push!(value, ret[2])
Expand Down

0 comments on commit 7dfc743

Please sign in to comment.