Package functions.unitary.transforms
Class Integral
Object
GeneralFunction
UnitaryFunction
Transformation
Integral
- All Implemented Interfaces:
Differentiable
,Evaluable
,Outputable
,Simplifiable
,Comparable<GeneralFunction>
,Iterable<GeneralFunction>
public class Integral extends Transformation
A wrapper class used to store functions in the integration pipeline, allowing users to utilize the methods in
tools.integration
.-
Field Summary
-
Constructor Summary
Constructors Constructor Description Integral(GeneralFunction integrand)
Integral(GeneralFunction integrand, String respectTo)
Constructs a newIntegral
-
Method Summary
Modifier and Type Method Description UnitaryFunction
clone()
Returns a clone of thisGeneralFunction
int
compareSelf(GeneralFunction that)
Used internally for comparing two functions of the same exact typeboolean
equalsFunction(GeneralFunction that)
Returns true when the two fully-simplified functions are equaldouble
evaluate(Map<String,Double> variableValues)
Integrates the operand numerically from 0 to the value specified in theMap
corresponding torespectTo
GeneralFunction
execute()
Returns the integral of the integrandGeneralFunction
getDerivative(String varID)
Returns the derivative of aGeneralFunction
with respect to a variable.UnitaryFunction
getInstance(GeneralFunction function)
Returns a new instance of thisUnitaryFunction
GeneralFunction
simplify()
Returns thisGeneralFunction
, simplifiedIntegral
simplifyInternal()
Simplifies theUnitaryFunction.operand
usingSimplifiable.simplify()
GeneralFunction
substituteVariables(Map<String,? extends GeneralFunction> toSubstitute)
Substitutes variables with functions as specified in a mapOutputFunction
toOutputFunction()
Converts this function into anOutputFunction
for use in string conversionString
toString()
Returns a String representation of thisGeneralFunction
Methods inherited from class UnitaryFunction
hashCode, iterator, newInstanceOf, simplifyFOC, simplifyInverse, substituteAll
Methods inherited from class GeneralFunction
compareTo, derivativeAt, equals, equalsSimplified, getNthDerivative, getSimplifiedDerivative
-
Constructor Details
-
Method Details
-
toString
public String toString()Description copied from class:GeneralFunction
Returns a String representation of thisGeneralFunction
- Overrides:
toString
in classUnitaryFunction
- Returns:
- String representation of this function
-
clone
Description copied from class:GeneralFunction
Returns a clone of thisGeneralFunction
- Overrides:
clone
in classUnitaryFunction
- Returns:
- a clone of this function
-
substituteVariables
Description copied from class:GeneralFunction
Substitutes variables with functions as specified in a map- Overrides:
substituteVariables
in classGeneralFunction
- Parameters:
toSubstitute
- the map betweenVariable
strings andGeneralFunction
s- Returns:
- the new
GeneralFunction
after all substitutions are preformed
-
equalsFunction
Description copied from class:GeneralFunction
Returns true when the two fully-simplified functions are equal- Overrides:
equalsFunction
in classUnitaryFunction
- Parameters:
that
- TheGeneralFunction
that the current function is being checked against- Returns:
- true if the two functions are equal
-
compareSelf
Description copied from class:GeneralFunction
Used internally for comparing two functions of the same exact type- Overrides:
compareSelf
in classUnitaryFunction
- Parameters:
that
- theGeneralFunction
that this is compared against- Returns:
- the comparison
-
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)Integrates the operand numerically from 0 to the value specified in theMap
corresponding torespectTo
- Parameters:
variableValues
- the values of the variables of theGeneralFunction
at the point- Returns:
- the operand integrated numerically
-
simplifyInternal
Description copied from class:UnitaryFunction
Simplifies theUnitaryFunction.operand
usingSimplifiable.simplify()
- Overrides:
simplifyInternal
in classUnitaryFunction
- Returns:
- an instance of this
UnitaryFunction
with theUnitaryFunction.operand
simplified
-
getInstance
Description copied from class:UnitaryFunction
Returns a new instance of thisUnitaryFunction
- Specified by:
getInstance
in classUnitaryFunction
- Parameters:
function
- theGeneralFunction
to be operated on- Returns:
- a new instance of this
UnitaryFunction
-
execute
Returns the integral of the integrand- Specified by:
execute
in classTransformation
- Returns:
- the integral of the integrand
- Throws:
IntegrationFailedException
- if the integral could not be found
-
simplify
Description copied from interface:Simplifiable
Returns thisGeneralFunction
, simplified- Specified by:
simplify
in interfaceSimplifiable
- Overrides:
simplify
in classTransformation
- Returns:
- the simplified function
-
toOutputFunction
Description copied from interface:Outputable
Converts this function into anOutputFunction
for use in string conversion- Specified by:
toOutputFunction
in interfaceOutputable
- Overrides:
toOutputFunction
in classUnitaryFunction
- Returns:
- this function as an
OutputFunction
-