Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
odow committed Dec 14, 2022
1 parent 74262e4 commit af40d84
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/Nonlinear/parse.jl
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ function _parse_without_recursion_inner(stack, data, expr, x, parent)
end
push!(expr.nodes, Node(node_type, id, parent))
parent = length(expr.nodes)
# Args need to be pushed onto the stack in reverse
# Args need to be pushed onto the stack in reverse because the stack is a
# first-in last-out datastructure.
for arg in reverse(x.args)
push!(stack, (parent, arg))
end
Expand Down
6 changes: 3 additions & 3 deletions src/attributes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1857,9 +1857,9 @@ function attribute_value_type(::ConstraintConflictStatus)
end

"""
UserDefinedFunction(name::Symbol, N::Int)
UserDefinedFunction(name::Symbol, arity::Int)
Set a user-defined function by the name of `Name` with `N` arguments.
Set a user-defined function by the name of `Name` with `arity` arguments.
The value to be set is a tuple containg one to three functions, representing the
zero, first, and second-order derivatives of the function.
Expand All @@ -1883,7 +1883,7 @@ MOI.set(model, MOI.UserDefinedFunction(:f, 2), (f, ∇f, ∇²f))
"""
struct UserDefinedFunction <: AbstractModelAttribute
name::Symbol
N::Int
arity::Int
end

"""
Expand Down

0 comments on commit af40d84

Please sign in to comment.