Class Derivative


  • public class Derivative
    extends java.lang.Object
    Author:
    GBEMIRO
    • Method Summary

      Modifier and Type Method Description
      java.lang.String differentiate()
      Differentiates the expression.
      java.util.ArrayList<java.lang.String> differentiateAsList()
      Differentiates the expression.
      static java.lang.String eval​(java.lang.String expr)  
      java.lang.String getMathExpr()  
      static void main​(java.lang.String[] args)  
      void setMathExpr​(java.lang.String mathExpr)  
      java.util.ArrayList<java.lang.String> translateToBaseTerms​(Differentiable d)  
      java.util.ArrayList<java.lang.String> translateToBaseTerms_1​(Differentiable d)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • setMathExpr

        public void setMathExpr​(java.lang.String mathExpr)
      • getMathExpr

        public java.lang.String getMathExpr()
      • translateToBaseTerms

        public java.util.ArrayList<java.lang.String> translateToBaseTerms​(Differentiable d)
        Returns:
        an ArrayList containing this object's data in terms of the base variable.
      • translateToBaseTerms_1

        public java.util.ArrayList<java.lang.String> translateToBaseTerms_1​(Differentiable d)
        Returns:
        an ArrayList containing this object's data in terms of the base variable.
      • differentiate

        public java.lang.String differentiate()
        Differentiates the expression.
        Returns:
        the derivative as a string of characters.
      • differentiateAsList

        public java.util.ArrayList<java.lang.String> differentiateAsList()
        Differentiates the expression.
        Returns:
        the derivative as a list of scanned tokens.
      • eval

        public static java.lang.String eval​(java.lang.String expr)
        Parameters:
        expr - The expression to differentiate. It must have the form: diff(@(x)sin(x),2) or diff(@(x)sin(x),2,3) If the diff(@(x)sin(x),2) form is specified, then the function is differentiated 2 times and the result is returned. If the diff(@(x)sin(x),2,3) form is specified, then the function is differentiated 3 times and the result is evaluated at x = 2 and then the value is returned.
      • main

        public static void main​(java.lang.String[] args)
        Parameters:
        args -