-
Notifications
You must be signed in to change notification settings - Fork 157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added support for handling chaining of Symbolic operators and printing without assignment . #2051
Conversation
|
@certik I shall do some more refactoring and explain you the code (mostly the approach) tomorrow in our weekly meeting . I did good amount of testing with random examples and everything works , if you have something particular to test let me know . |
I've added a test . It might look a bit random but I guess that's the only way we can check all edge cases for operator chaining along with brackets placed randomly . Though I've compared all tests with SymPy and everything looks good
|
Actually we might see that there are some differences between how stuff is being printed I am not sure why this would happen, maybe some internal differences between how sympy and symengine's C wrapper have been framed . Because the C code generated is absolutely spot on . For eg I'll paste the last few lines for C code for
As you see I don't think this might be concerning unless and untill the expressions are same mathematically , though I thought of pointing it out if ever we end up thinking why something like this might be happening . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this works.
This Pr starts small . For eg
But once we have a queue/stack data structure (I've chosen a queue as it is more intuitive at places) in place to generate temporary variables , we can essentially do much more as shown in the comment below.