Package functions.commutative.integer
Class IntegerCommutativeFunction
Object
GeneralFunction
CommutativeFunction
IntegerCommutativeFunction
- All Implemented Interfaces:
Differentiable
,Evaluable
,Outputable
,Simplifiable
,Comparable<GeneralFunction>
,Iterable<GeneralFunction>
public abstract class IntegerCommutativeFunction extends CommutativeFunction
IntegerCommutativeFunction
provides resources for subclasses to implement mathematical functions with integer-restricted domain.-
Field Summary
-
Constructor Summary
Constructors Constructor Description IntegerCommutativeFunction(GeneralFunction... functions)
Constructs a newIntegerCommutativeFunction
-
Method Summary
Modifier and Type Method Description double
evaluate(Map<String,Double> variableValues)
Evaluates aGeneralFunction
at a point denoted by aMap
GeneralFunction
getDerivative(String varID)
Returns the derivative of aGeneralFunction
with respect to a variable.double
operate(double a, double b)
Performs the operation of thisCommutativeFunction
on the two inputsprotected abstract long
operateInt(int... operands)
Performs the operation of this function on the inputsMethods inherited from class CommutativeFunction
compareSelf, equalsFunction, getFunctions, getIdentityValue, getInstance, getJoiningCollector, hashCode, iterator, simplify, simplifyConstants, simplifyElements, simplifyIdentity, simplifyInternal, simplifyPull, simplifyTrivialElement, substituteAll, toOutputFunction, toString
Methods inherited from class GeneralFunction
clone, compareTo, derivativeAt, equals, equalsSimplified, getNthDerivative, getSimplifiedDerivative, substituteVariables
-
Constructor Details
-
IntegerCommutativeFunction
Constructs a newIntegerCommutativeFunction
- Parameters:
functions
- theGeneralFunction
s that will be acted on
-
-
Method Details
-
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
-
operate
public double operate(double a, double b)Description copied from class:CommutativeFunction
Performs the operation of thisCommutativeFunction
on the two inputs- Specified by:
operate
in classCommutativeFunction
- Parameters:
a
- the first inputb
- the second input- Returns:
- the operation applied to the inputs
-
operateInt
protected abstract long operateInt(int... operands)Performs the operation of this function on the inputs- Parameters:
operands
- the list of inputs- Returns:
- the operation applied to the inputs
-