Package functions.unitary.transforms
Class PartialDerivative
Object
GeneralFunction
UnitaryFunction
Transformation
PartialDerivative
- All Implemented Interfaces:
Differentiable
,Evaluable
,Outputable
,Simplifiable
,Comparable<GeneralFunction>
,Iterable<GeneralFunction>
public class PartialDerivative extends Transformation
A wrapper class used to store functions in the integration pipeline, allowing users to utilize the methods provided by the
Differentiable
interface.-
Field Summary
-
Constructor Summary
Constructors Constructor Description PartialDerivative(GeneralFunction operand, String respectTo)
Constructs a newPartialDerivative
-
Method Summary
Modifier and Type Method Description UnitaryFunction
clone()
Returns a clone of thisGeneralFunction
int
compareSelf(GeneralFunction that)
Used internally for comparing two functions of the same exact typeboolean
equalsFunction(GeneralFunction that)
Returns true when the two fully-simplified functions are equaldouble
evaluate(Map<String,Double> variableValues)
Evaluates aGeneralFunction
at a point denoted by aMap
GeneralFunction
execute()
Returns the partial derivative of the operandGeneralFunction
getDerivative(String varID)
Returns the derivative of aGeneralFunction
with respect to a variable.UnitaryFunction
getInstance(GeneralFunction function)
Returns a new instance of thisUnitaryFunction
UnitaryFunction
simplifyInternal()
Simplifies theUnitaryFunction.operand
usingSimplifiable.simplify()
GeneralFunction
substituteVariables(Map<String,? extends GeneralFunction> toSubstitute)
Substitutes variables with functions as specified in a mapOutputFunction
toOutputFunction()
Converts this function into anOutputFunction
for use in string conversionString
toString()
Returns a String representation of thisGeneralFunction
Methods inherited from class UnitaryFunction
hashCode, iterator, newInstanceOf, simplifyFOC, simplifyInverse, substituteAll
Methods inherited from class GeneralFunction
compareTo, derivativeAt, equals, equalsSimplified, getNthDerivative, getSimplifiedDerivative
-
Constructor Details
-
PartialDerivative
Constructs a newPartialDerivative
- Parameters:
operand
- The operand on thePartialDerivative
respectTo
- The variable that thePartialDerivative
is with respect to
-
-
Method Details
-
toString
public String toString()Description copied from class:GeneralFunction
Returns a String representation of thisGeneralFunction
- Overrides:
toString
in classUnitaryFunction
- Returns:
- String representation of this function
-
clone
Description copied from class:GeneralFunction
Returns a clone of thisGeneralFunction
- Overrides:
clone
in classUnitaryFunction
- Returns:
- a clone of this function
-
substituteVariables
Description copied from class:GeneralFunction
Substitutes variables with functions as specified in a map- Overrides:
substituteVariables
in classGeneralFunction
- Parameters:
toSubstitute
- the map betweenVariable
strings andGeneralFunction
s- Returns:
- the new
GeneralFunction
after all substitutions are preformed
-
equalsFunction
Description copied from class:GeneralFunction
Returns true when the two fully-simplified functions are equal- Overrides:
equalsFunction
in classUnitaryFunction
- Parameters:
that
- TheGeneralFunction
that the current function is being checked against- Returns:
- true if the two functions are equal
-
compareSelf
Description copied from class:GeneralFunction
Used internally for comparing two functions of the same exact type- Overrides:
compareSelf
in classUnitaryFunction
- Parameters:
that
- theGeneralFunction
that this is compared against- Returns:
- the comparison
-
getDerivative
Description copied from interface:Differentiable
Returns the derivative of aGeneralFunction
with respect to a variable. Should not be used in general;GeneralFunction.getSimplifiedDerivative(java.lang.String)
is strongly preferred.- Parameters:
varID
- the ID of the variable that is differentiated against- Returns:
- the derivative of the function with respect to
varID
-
evaluate
public double evaluate(Map<String,Double> variableValues)Description copied from interface:Evaluable
Evaluates aGeneralFunction
at a point denoted by aMap
- Parameters:
variableValues
- the values of the variables in theGeneralFunction
at the point- Returns:
- the value of the
GeneralFunction
at the point
-
simplifyInternal
Description copied from class:UnitaryFunction
Simplifies theUnitaryFunction.operand
usingSimplifiable.simplify()
- Overrides:
simplifyInternal
in classUnitaryFunction
- Returns:
- an instance of this
UnitaryFunction
with theUnitaryFunction.operand
simplified
-
getInstance
Description copied from class:UnitaryFunction
Returns a new instance of thisUnitaryFunction
- Specified by:
getInstance
in classUnitaryFunction
- Parameters:
function
- theGeneralFunction
to be operated on- Returns:
- a new instance of this
UnitaryFunction
-
execute
Returns the partial derivative of the operand- Specified by:
execute
in classTransformation
- Returns:
- the partial derivative of the operand
-
toOutputFunction
Description copied from interface:Outputable
Converts this function into anOutputFunction
for use in string conversion- Specified by:
toOutputFunction
in interfaceOutputable
- Overrides:
toOutputFunction
in classUnitaryFunction
- Returns:
- this function as an
OutputFunction
-