Class Differentiable


  • public class Differentiable
    extends java.lang.Object
    Anything that can be mathematically differentiated.. e.g a number, a variable or an expression.
    Author:
    GBEMIRO
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String basevariable
      The base variable that the top level expression is to be differentiated with respect to.
    • Constructor Summary

      Constructors 
      Constructor Description
      Differentiable​(java.lang.String name)  
      Differentiable​(java.lang.String name, java.util.ArrayList<java.lang.String> data)  
    • Method Summary

      Modifier and Type Method Description
      java.util.ArrayList<java.lang.String> differentiate​(Derivative d)  
      java.util.ArrayList<java.lang.String> getData()  
      java.lang.String getDerivativeExpression​(java.util.ArrayList<java.lang.String> derivedData)  
      java.lang.String getExpression()  
      java.lang.String getName()  
      boolean isChain()  
      void setData​(java.util.ArrayList<java.lang.String> data)  
      void setName​(java.lang.String name)  
      void simplifyDerivedData​(java.util.ArrayList<java.lang.String> derivedData)
      Simplifies the contents of the derivedData ArrayList.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • basevariable

        public static final java.lang.String basevariable
        The base variable that the top level expression is to be differentiated with respect to.
        See Also:
        Constant Field Values
    • Constructor Detail

      • Differentiable

        public Differentiable​(java.lang.String name)
        Parameters:
        name - The representation of the Differentiable.
      • Differentiable

        public Differentiable​(java.lang.String name,
                              java.util.ArrayList<java.lang.String> data)
        Parameters:
        name - The representation of the Differentiable.
        data - The information contained by the Differentiable.
    • Method Detail

      • isChain

        public boolean isChain()
        Returns:
        true if this name is automatically generated.. which implies that it was created to represent a Differentiable that is a part of the differentiation chain.
      • setName

        public void setName​(java.lang.String name)
      • getName

        public java.lang.String getName()
      • setData

        public void setData​(java.util.ArrayList<java.lang.String> data)
      • getData

        public java.util.ArrayList<java.lang.String> getData()
      • simplifyDerivedData

        public void simplifyDerivedData​(java.util.ArrayList<java.lang.String> derivedData)
        Simplifies the contents of the derivedData ArrayList.
        Parameters:
        derivedData -
      • differentiate

        public java.util.ArrayList<java.lang.String> differentiate​(Derivative d)
        Parameters:
        d - The parent Derivative object.
        Returns:
        the List containing the tokens of the derivative.
      • getDerivativeExpression

        public java.lang.String getDerivativeExpression​(java.util.ArrayList<java.lang.String> derivedData)
        Returns:
        the derivative as a String object.
      • getExpression

        public java.lang.String getExpression()
        Returns:
        The string format of the data.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object