You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For Add, Mul and Term, once hash() is called, the field hash is filled and then it doesn't need to recompute the hash down to the subtree when hash() is called later.
But Sym, Pow and Div don't share this benefit.
It would be inefficient for, for example, the following expression.
(((((a / b) ^ c) / d) ^ e) / f) ^ g
The text was updated successfully, but these errors were encountered:
bowenszhu
changed the title
Why Pow and Div do not have hash field?
Why don't Pow and Div have hash field?
Aug 26, 2022
SymbolicUtils.jl/src/types.jl
Lines 51 to 61 in dcbe861
SymbolicUtils.jl/src/types.jl
Lines 228 to 256 in dcbe861
For
Add
,Mul
andTerm
, oncehash()
is called, the fieldhash
is filled and then it doesn't need to recompute the hash down to the subtree whenhash()
is called later.But
Sym
,Pow
andDiv
don't share this benefit.It would be inefficient for, for example, the following expression.
The text was updated successfully, but these errors were encountered: