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 UnitaryFunctionclone()Returns a clone of thisGeneralFunctionintcompareSelf(GeneralFunction that)Used internally for comparing two functions of the same exact typebooleanequalsFunction(GeneralFunction that)Returns true when the two fully-simplified functions are equaldoubleevaluate(Map<String,Double> variableValues)Evaluates aGeneralFunctionat a point denoted by aMapGeneralFunctionexecute()Returns the partial derivative of the operandGeneralFunctiongetDerivative(String varID)Returns the derivative of aGeneralFunctionwith respect to a variable.UnitaryFunctiongetInstance(GeneralFunction function)Returns a new instance of thisUnitaryFunctionUnitaryFunctionsimplifyInternal()Simplifies theUnitaryFunction.operandusingSimplifiable.simplify()GeneralFunctionsubstituteVariables(Map<String,? extends GeneralFunction> toSubstitute)Substitutes variables with functions as specified in a mapOutputFunctiontoOutputFunction()Converts this function into anOutputFunctionfor use in string conversionStringtoString()Returns a String representation of thisGeneralFunctionMethods inherited from class UnitaryFunction
hashCode, iterator, newInstanceOf, simplifyFOC, simplifyInverse, substituteAllMethods inherited from class GeneralFunction
compareTo, derivativeAt, equals, equalsSimplified, getNthDerivative, getSimplifiedDerivative
-
Constructor Details
-
PartialDerivative
Constructs a newPartialDerivative- Parameters:
operand- The operand on thePartialDerivativerespectTo- The variable that thePartialDerivativeis with respect to
-
-
Method Details
-
toString
public String toString()Description copied from class:GeneralFunctionReturns a String representation of thisGeneralFunction- Overrides:
toStringin classUnitaryFunction- Returns:
- String representation of this function
-
clone
Description copied from class:GeneralFunctionReturns a clone of thisGeneralFunction- Overrides:
clonein classUnitaryFunction- Returns:
- a clone of this function
-
substituteVariables
Description copied from class:GeneralFunctionSubstitutes variables with functions as specified in a map- Overrides:
substituteVariablesin classGeneralFunction- Parameters:
toSubstitute- the map betweenVariablestrings andGeneralFunctions- Returns:
- the new
GeneralFunctionafter all substitutions are preformed
-
equalsFunction
Description copied from class:GeneralFunctionReturns true when the two fully-simplified functions are equal- Overrides:
equalsFunctionin classUnitaryFunction- Parameters:
that- TheGeneralFunctionthat the current function is being checked against- Returns:
- true if the two functions are equal
-
compareSelf
Description copied from class:GeneralFunctionUsed internally for comparing two functions of the same exact type- Overrides:
compareSelfin classUnitaryFunction- Parameters:
that- theGeneralFunctionthat this is compared against- Returns:
- the comparison
-
getDerivative
Description copied from interface:DifferentiableReturns the derivative of aGeneralFunctionwith 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:EvaluableEvaluates aGeneralFunctionat a point denoted by aMap- Parameters:
variableValues- the values of the variables in theGeneralFunctionat the point- Returns:
- the value of the
GeneralFunctionat the point
-
simplifyInternal
Description copied from class:UnitaryFunctionSimplifies theUnitaryFunction.operandusingSimplifiable.simplify()- Overrides:
simplifyInternalin classUnitaryFunction- Returns:
- an instance of this
UnitaryFunctionwith theUnitaryFunction.operandsimplified
-
getInstance
Description copied from class:UnitaryFunctionReturns a new instance of thisUnitaryFunction- Specified by:
getInstancein classUnitaryFunction- Parameters:
function- theGeneralFunctionto be operated on- Returns:
- a new instance of this
UnitaryFunction
-
execute
Returns the partial derivative of the operand- Specified by:
executein classTransformation- Returns:
- the partial derivative of the operand
-
toOutputFunction
Description copied from interface:OutputableConverts this function into anOutputFunctionfor use in string conversion- Specified by:
toOutputFunctionin interfaceOutputable- Overrides:
toOutputFunctionin classUnitaryFunction- Returns:
- this function as an
OutputFunction
-