ComplexFunction - liorls/Ex1 GitHub Wiki

This class is an implemention of complex_function interface. Each complex function have left function, right function and operator.

The functions:

  • Constructor - There is a constructor that accepts a string and by the characters, belongs to whether it is a polynomial / monom or a complex functions.
  • F- Calculates a function of type y=f(x) at specific point.
  • The functions of the operators- calculates left function with right function. *left- returns the left function.
  • right- returns the right function.
  • getOp- returns the operation of this complex function
  • Copy- deep copy of the complex functions.
  • toString- Returns a string of the complex functions.
  • initFromString- Create complex functions object by type the complex functions as a string.
  • Equals- check if two complex functions are the same.

##note: When we use with function equals (plus (x, x) == plus (2x ,0)) The answer will be false, the functions are not equals. But we can see that they are equal. The reason is that the project structure does not reduce a complex function to a normal function, the option is to compare the two functions according to the values ​​obtained by calculating y of each function at any point between minus infinite and infinite.