Package functions.binary
Class Rand
Object
- All Implemented Interfaces:
Differentiable
,Evaluable
,Outputable
,Simplifiable
,Comparable<GeneralFunction>
,Iterable<GeneralFunction>
public class Rand extends BinaryFunction
-
Field Summary
-
Constructor Summary
Constructors Constructor Description Rand(GeneralFunction function1, GeneralFunction function2)
Constructs a newRand
-
Method Summary
Modifier and Type Method Description GeneralFunction
clone()
Returns a clone of thisGeneralFunction
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.BinaryFunction
getInstance(GeneralFunction function1, GeneralFunction function2)
Returns an instance of thisGeneralFunction
, using the correct subclassGeneralFunction
simplify()
Returns thisGeneralFunction
, simplifiedString
toString()
Returns a String representation of thisGeneralFunction
Methods inherited from class BinaryFunction
compareSelf, equalsFunction, getFunction1, getFunction2, hashCode, iterator, simplifyFOC, substituteAll, toOutputFunction
Methods inherited from class GeneralFunction
compareTo, derivativeAt, equals, equalsSimplified, getNthDerivative, getSimplifiedDerivative, substituteVariables
-
Constructor Details
-
Method Details
-
getInstance
Description copied from class:BinaryFunction
Returns an instance of thisGeneralFunction
, using the correct subclass- Specified by:
getInstance
in classBinaryFunction
- Parameters:
function1
- Constructor parameter 1function2
- Constructor parameter 2- Returns:
- an instance of this
GeneralFunction
-
toString
public String toString()Description copied from class:GeneralFunction
Returns a String representation of thisGeneralFunction
- Specified by:
toString
in classGeneralFunction
- Returns:
- String representation of this function
-
clone
Description copied from class:GeneralFunction
Returns a clone of thisGeneralFunction
- Specified by:
clone
in classGeneralFunction
- Returns:
- a clone of this function
-
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
-
simplify
Description copied from interface:Simplifiable
Returns thisGeneralFunction
, simplified- Returns:
- the simplified function
-