visma icon indicating copy to clipboard operation
visma copied to clipboard

Simplification of expression

Open ayush9398 opened this issue 5 years ago • 2 comments

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.

ayush9398 avatar Apr 20 '19 15:04 ayush9398

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.~~

8hantanu avatar Apr 21 '19 10:04 8hantanu

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

ayush9398 avatar Apr 25 '19 21:04 ayush9398