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 UnitaryFunctionclone()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)Integrates the operand numerically from 0 to the value specified in theMapcorresponding torespectToGeneralFunctionexecute()Returns the integral of the integrandGeneralFunctiongetDerivative(String varID)Returns the derivative of aGeneralFunctionwith respect to a variable.UnitaryFunctiongetInstance(GeneralFunction function)Returns a new instance of thisUnitaryFunctionGeneralFunctionsimplify()Returns thisGeneralFunction, simplifiedIntegralsimplifyInternal()Simplifies theUnitaryFunction.operandusingSimplifiable.simplify()GeneralFunctionsubstituteVariables(Map<String,? extends GeneralFunction> toSubstitute)Substitutes variables with functions as specified in a mapOutputFunctiontoOutputFunction()Converts this function into anOutputFunctionfor use in string conversionStringtoString()Returns a String representation of thisGeneralFunctionMethods inherited from class UnitaryFunction
hashCode, iterator, newInstanceOf, simplifyFOC, simplifyInverse, substituteAllMethods inherited from class GeneralFunction
compareTo, derivativeAt, equals, equalsSimplified, getNthDerivative, getSimplifiedDerivative
-
Constructor Details
-
Method Details
-
toString
public String toString()Description copied from class:GeneralFunctionReturns a String representation of thisGeneralFunction- Overrides:
toStringin classUnitaryFunction- Returns:
- String representation of this function
-
clone
Description copied from class:GeneralFunctionReturns a clone of thisGeneralFunction- Overrides:
clonein classUnitaryFunction- Returns:
- a clone of this function
-
substituteVariables
Description copied from class:GeneralFunctionSubstitutes variables with functions as specified in a map- Overrides:
substituteVariablesin classGeneralFunction- Parameters:
toSubstitute- the map betweenVariablestrings andGeneralFunctions- Returns:
- the new
GeneralFunctionafter all substitutions are preformed
-
equalsFunction
Description copied from class:GeneralFunctionReturns true when the two fully-simplified functions are equal- Overrides:
equalsFunctionin classUnitaryFunction- 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- Overrides:
compareSelfin classUnitaryFunction- Parameters:
that- theGeneralFunctionthat this is compared against- Returns:
- the comparison
-
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)Integrates the operand numerically from 0 to the value specified in theMapcorresponding torespectTo- Parameters:
variableValues- the values of the variables of theGeneralFunctionat the point- Returns:
- the operand integrated numerically
-
simplifyInternal
Description copied from class:UnitaryFunctionSimplifies theUnitaryFunction.operandusingSimplifiable.simplify()- Overrides:
simplifyInternalin classUnitaryFunction- Returns:
- an instance of this
UnitaryFunctionwith theUnitaryFunction.operandsimplified
-
getInstance
Description copied from class:UnitaryFunctionReturns a new instance of thisUnitaryFunction- Specified by:
getInstancein classUnitaryFunction- Parameters:
function- theGeneralFunctionto be operated on- Returns:
- a new instance of this
UnitaryFunction
-
execute
Returns the integral of the integrand- Specified by:
executein classTransformation- Returns:
- the integral of the integrand
- Throws:
IntegrationFailedException- if the integral could not be found
-
simplify
Description copied from interface:SimplifiableReturns thisGeneralFunction, simplified- Specified by:
simplifyin interfaceSimplifiable- Overrides:
simplifyin classTransformation- Returns:
- the simplified function
-
toOutputFunction
Description copied from interface:OutputableConverts this function into anOutputFunctionfor use in string conversion- Specified by:
toOutputFunctionin interfaceOutputable- Overrides:
toOutputFunctionin classUnitaryFunction- Returns:
- this function as an
OutputFunction
-