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
After some calculation, the expression just become equal to a symbol.
But the struct constructor seems copied something different.
What is this happening here? And what is the proper approach to do this?
Thank you.
using SymEngine
@vars x
struct test
val::Basicend
expr = x+2
expr_m2 = expr-2println( SymEngine.get_symengine_class(x) ) # Symbolprintln( SymEngine.get_symengine_class(expr_m2) ) # also Symbolprintln( x == expr_m2 ) # trueprintln( test(x)==test(x) ) # also trueprintln( test(x)==test(expr_m2) ) # unexpected false
The text was updated successfully, but these errors were encountered:
@zhaoli-IHEP, we create julia objects from symengine C objects as necessary. Therefore expr and (expr+2)-2 are two different objects, but == operator is overloaded to compare. You'll have to overload == operator for test too
@zhaoli-IHEP, we create julia objects from symengine C objects as necessary. Therefore expr and (expr+2)-2 are two different objects, but == operator is overloaded to compare. You'll have to overload == operator for test too
Thank you so much. Now I can understand this issue.
After some calculation, the expression just become equal to a symbol.
But the struct constructor seems copied something different.
What is this happening here? And what is the proper approach to do this?
Thank you.
The text was updated successfully, but these errors were encountered: