Skip to content

Commit

Permalink
Merge pull request #3651 from JuliaReach/schillic/hpolytope
Browse files Browse the repository at this point in the history
Fix HPolytope constructor with old Symbolics version
  • Loading branch information
schillic authored Nov 20, 2024
2 parents e450418 + 5579b43 commit 3fa947a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Initialization/init_Symbolics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ _vec(vars::Vector{Symbolics.Arr{Num,1}}) = reduce(vcat, vars)
_vec(vars::Vector{Vector{Num}}) = reduce(vcat, vars)
_vec(vars::Vector{Real}) = reduce(vcat, vars)

_get_variables(expr::Num) = convert(Vector{Num}, Symbolics.get_variables(expr; sort=true))
# `sort` argument was introduced in Symbolics v6.1
@static if VERSION < v"1.10"
_get_variables(expr::Num) = convert(Vector{Num}, Symbolics.get_variables(expr))
else
_get_variables(expr::Num) = convert(Vector{Num}, Symbolics.get_variables(expr; sort=true))
end
function _get_variables(expr::Vector{<:Num})
return unique(reduce(vcat, _get_variables(ex) for ex in expr))
end

0 comments on commit 3fa947a

Please sign in to comment.