Package functions.endpoint
Class Variable
Object
GeneralFunction
EndpointFunction
Variable
- All Implemented Interfaces:
Differentiable,Evaluable,Outputable,Simplifiable,Comparable<GeneralFunction>,Iterable<GeneralFunction>,OutputFunction
public class Variable extends EndpointFunction
-
Field Summary
Fields Modifier and Type Field Description StringvarIDThe String representing this variable -
Constructor Summary
-
Method Summary
Modifier and Type Method Description GeneralFunctionclone()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 aMapGeneralFunctiongetDerivative(String varID)Returns the derivative of aGeneralFunctionwith respect to a variable.inthashCode()Returns a hash code value for this objectGeneralFunctionsimplify()Returns thisGeneralFunction, simplifiedStringtoString()Returns a String representation of thisGeneralFunctionMethods inherited from class EndpointFunction
getName, getOperands, iterator, substituteAll, toLatex, toOutputFunctionMethods inherited from class GeneralFunction
compareTo, derivativeAt, equals, equalsSimplified, getNthDerivative, getSimplifiedDerivative, substituteVariables
-
Field Details
-
varID
public final String varIDThe String representing this variable
-
-
Constructor Details
-
Method Details
-
toString
public String toString()Description copied from class:GeneralFunctionReturns a String representation of thisGeneralFunction- Specified by:
toStringin interfaceOutputFunction- Specified by:
toStringin classGeneralFunction- Returns:
- String representation of this function
-
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
-
clone
Description copied from class:GeneralFunctionReturns a clone of thisGeneralFunction- Specified by:
clonein classGeneralFunction- Returns:
- a clone of this function
-
simplify
Description copied from interface:SimplifiableReturns thisGeneralFunction, simplified- Returns:
- the simplified function
-
equalsFunction
Description copied from class:GeneralFunctionReturns true when the two fully-simplified functions are equal- Specified by:
equalsFunctionin classGeneralFunction- 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- Specified by:
compareSelfin classGeneralFunction- Parameters:
that- theGeneralFunctionthat this is compared against- Returns:
- the comparison
-
hashCode
public int hashCode()Description copied from class:GeneralFunctionReturns a hash code value for this object- Specified by:
hashCodein interfaceOutputFunction- Specified by:
hashCodein classGeneralFunction- Returns:
- a hash code value for this object
-