Skip to content

Commit

Permalink
prepend 'gradient' with 'Symbolics.'
Browse files Browse the repository at this point in the history
  • Loading branch information
schillic committed Jul 16, 2024
1 parent 407cb2f commit 2ec15f0
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions src/Initialization/init_Symbolics.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using .Symbolics: gradient,
simplify,
using .Symbolics: simplify,
Num, # variable like, e.g. x[1]
Term, # term like, eg. x[1] + x[2] == 1
Symbolic,
Expand Down
2 changes: 1 addition & 1 deletion src/Sets/HPolyhedron/HPolyhedron.jl
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ function load_symbolics_hpolyhedron()
end
end

coeffs = [N.val) for α in gradient(sexpr, vars_list)]
coeffs = [N.val) for α in Symbolics.gradient(sexpr, vars_list)]
β = -N(Symbolics.substitute(sexpr, zeroed_vars))

push!(clist, HalfSpace(coeffs, β))
Expand Down
2 changes: 1 addition & 1 deletion src/Sets/HalfSpace.jl
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ function load_symbolics_halfspace()
end

# compute the linear coefficients by taking first-order derivatives
coeffs = [N.val) for α in gradient(sexpr, collect(vars))]
coeffs = [N.val) for α in Symbolics.gradient(sexpr, collect(vars))]

# get the constant term by expression substitution
zeroed_vars = Dict(v => zero(N) for v in vars)
Expand Down
2 changes: 1 addition & 1 deletion src/Sets/Hyperplane.jl
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@ function load_symbolics_hyperplane()
end

# compute the linear coefficients by taking first order derivatives
coeffs = [N.val) for α in gradient(sexpr, collect(vars))]
coeffs = [N.val) for α in Symbolics.gradient(sexpr, collect(vars))]

# get the constant term by expression substitution
zeroed_vars = Dict(v => zero(N) for v in vars)
Expand Down

0 comments on commit 2ec15f0

Please sign in to comment.