JuliaReach / LazySets.jl

Scalable symbolic-numeric set computations in Julia
https://juliareach.github.io/LazySets.jl/
Other
226 stars 32 forks source link

Merge metaprogramming loops #3613

Closed schillic closed 16 hours ago

schillic commented 1 month ago

The function _issubset_in_emptyset calls isempty. The removed loop used a shortcut for set types that are never empty, but the compiler figures that out and also skips isempty. So this was not really faster. Hence, I suggest to remove the loop to keep the codebase smaller.

mforets commented 21 hours ago

The removed loop used a shortcut for set types that are never empty, but the compiler figures that out and also skips isempty.

that sounds quite advanced. how does it figure that out?

schillic commented 16 hours ago

The removed loop used a shortcut for set types that are never empty, but the compiler figures that out and also skips isempty.

that sounds quite advanced. how does it figure that out?

Simply because isempty(X) = false is constant, and then the if isempty(X) can be optimized away.