Package math.differentialcalculus
Class Differentiable
- java.lang.Object
-
- math.differentialcalculus.Differentiable
-
public class Differentiable extends java.lang.ObjectAnything 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.StringbasevariableThe 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.StringgetDerivativeExpression(java.util.ArrayList<java.lang.String> derivedData)java.lang.StringgetExpression()java.lang.StringgetName()booleanisChain()voidsetData(java.util.ArrayList<java.lang.String> data)voidsetName(java.lang.String name)voidsimplifyDerivedData(java.util.ArrayList<java.lang.String> derivedData)Simplifies the contents of thederivedDataArrayList.java.lang.StringtoString()
-
-
-
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 thederivedDataArrayList.- 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:
toStringin classjava.lang.Object
-
-