Package functions.binary
Class Logb
Object
- All Implemented Interfaces:
Differentiable,Evaluable,Outputable,Simplifiable,Comparable<GeneralFunction>,Iterable<GeneralFunction>
public class Logb extends BinaryFunction
-
Field Summary
-
Constructor Summary
Constructors Constructor Description Logb(GeneralFunction argument, GeneralFunction base)Constructs a new Logb -
Method Summary
Modifier and Type Method Description GeneralFunctionclone()Returns a clone of thisGeneralFunctiondoubleevaluate(Map<String,Double> variableValues)Evaluates aGeneralFunctionat a point denoted by aMapGeneralFunctiongetDerivative(String varID)Returns the derivative of aGeneralFunctionwith respect to a variable.BinaryFunctiongetInstance(GeneralFunction function1, GeneralFunction function2)Returns an instance of thisGeneralFunction, using the correct subclassGeneralFunctionsimplify()Returns thisGeneralFunction, simplifiedGeneralFunctionsimplifyIdentity()ReturnsDefaultFunctions.ONEif the base of the logarithm equals the argumentGeneralFunctionsimplifyPowers()Returns aGeneralFunctionwhere, if the argument is aPoworExp, the exponent of the argument has been moved in front of the logarithm in aProductOutputFunctiontoOutputFunction()Converts this function into anOutputFunctionfor use in string conversionGeneralFunctiontoSpecialCase()StringtoString()Returns a String representation of thisGeneralFunctionMethods inherited from class BinaryFunction
compareSelf, equalsFunction, getFunction1, getFunction2, hashCode, iterator, simplifyFOC, substituteAllMethods inherited from class GeneralFunction
compareTo, derivativeAt, equals, equalsSimplified, getNthDerivative, getSimplifiedDerivative, substituteVariables
-
Constructor Details
-
Logb
Constructs a new Logb- Parameters:
argument- The argument of the logarithmbase- The base of the logarithm
-
-
Method Details
-
evaluate
public double evaluate(Map<String,Double> variableValues)Description copied from interface:EvaluableEvaluates aGeneralFunctionat a point denoted by aMap- Parameters:
variableValues- the values of the variables in theGeneralFunctionat the point- Returns:
- the value of the
GeneralFunctionat the point
-
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
-
getInstance
Description copied from class:BinaryFunctionReturns an instance of thisGeneralFunction, using the correct subclass- Specified by:
getInstancein classBinaryFunction- Parameters:
function1- Constructor parameter 1function2- Constructor parameter 2- Returns:
- an instance of this
GeneralFunction
-
clone
Description copied from class:GeneralFunctionReturns a clone of thisGeneralFunction- Specified by:
clonein classGeneralFunction- Returns:
- a clone of this function
-
toSpecialCase
-
toString
public String toString()Description copied from class:GeneralFunctionReturns a String representation of thisGeneralFunction- Specified by:
toStringin classGeneralFunction- Returns:
- String representation of this function
-
simplify
Description copied from interface:SimplifiableReturns thisGeneralFunction, simplified- Returns:
- the simplified function
-
simplifyIdentity
ReturnsDefaultFunctions.ONEif the base of the logarithm equals the argument- Returns:
DefaultFunctions.ONEif the base of the logarithm equals the argument
-
simplifyPowers
Returns aGeneralFunctionwhere, if the argument is aPoworExp, the exponent of the argument has been moved in front of the logarithm in aProduct- Returns:
- a
GeneralFunctionwhere, if the argument is aPoworExp, the exponent of the argument has been moved in front of the logarithm in aProduct
-
toOutputFunction
Description copied from interface:OutputableConverts this function into anOutputFunctionfor use in string conversion- Specified by:
toOutputFunctionin interfaceOutputable- Overrides:
toOutputFunctionin classBinaryFunction- Returns:
- this function as an
OutputFunction
-