Skip to content
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

Simplification of expression #180

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from

Conversation

ayush9398
Copy link
Contributor

This partially solves issue #141

  • Added property reduced in the Expression class.
  • Added a class method, get_reduced() to simplify the expression.
  • If the expression is simplified to a single token, the class type changes from Expression to appropriate Function class.

@8hantanu
Copy link
Member

8hantanu commented Apr 21, 2019

Can you add some tests for the above?
Also, note you might need to add an extra check if the expression needs to be simplified.
For example, when solving for y in x - 2yz + 1= 0 the resultant expression y=-0.5*((-1.0-x)/z) can be reduced but must not be reduced.

@ayush9398
Copy link
Contributor Author

Hey @8hantanu , I have added the test function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants