Package functions.commutative.integer
Class GCD
- All Implemented Interfaces:
Differentiable
,Evaluable
,Outputable
,Simplifiable
,Comparable<GeneralFunction>
,Iterable<GeneralFunction>
public class GCD extends IntegerCommutativeFunction
-
Field Summary
-
Constructor Summary
Constructors Constructor Description GCD(GeneralFunction... functions)
Constructs a newGCD
-
Method Summary
Modifier and Type Method Description GeneralFunction
clone()
Returns a clone of thisGeneralFunction
double
getIdentityValue()
Returns the identity of thisCommutativeFunction
, such as 0 for + or gcd and 1 for * or lcmCommutativeFunction
getInstance(GeneralFunction... functions)
Returns an instance of thisGeneralFunction
protected long
operateInt(int... operands)
Performs the operation of this function on the inputsMethods inherited from class CommutativeFunction
compareSelf, equalsFunction, getFunctions, getJoiningCollector, hashCode, iterator, simplify, simplifyConstants, simplifyElements, simplifyIdentity, simplifyInternal, simplifyPull, simplifyTrivialElement, substituteAll, toOutputFunction, toString
Methods inherited from class GeneralFunction
compareTo, derivativeAt, equals, equalsSimplified, getNthDerivative, getSimplifiedDerivative, substituteVariables
-
Constructor Details
-
GCD
Constructs a newGCD
- Parameters:
functions
- theGeneralFunction
s that will be acted on
-
-
Method Details
-
operateInt
protected long operateInt(int... operands)Description copied from class:IntegerCommutativeFunction
Performs the operation of this function on the inputs- Specified by:
operateInt
in classIntegerCommutativeFunction
- Parameters:
operands
- the list of inputs- Returns:
- the operation applied to the inputs
-
getInstance
Description copied from class:CommutativeFunction
Returns an instance of thisGeneralFunction
- Specified by:
getInstance
in classCommutativeFunction
- Parameters:
functions
- theGeneralFunction
s that will be acted on- Returns:
- an instance of this
GeneralFunction
-
clone
Description copied from class:GeneralFunction
Returns a clone of thisGeneralFunction
- Specified by:
clone
in classGeneralFunction
- Returns:
- a clone of this function
-
getIdentityValue
public double getIdentityValue()Description copied from class:CommutativeFunction
Returns the identity of thisCommutativeFunction
, such as 0 for + or gcd and 1 for * or lcm- Specified by:
getIdentityValue
in classCommutativeFunction
- Returns:
- the identity of this
CommutativeFunction
-