public class WrapperFunction extends FunctionParserExtension
name
Constructor and Description |
---|
WrapperFunction(Function f)
Create a WrapperFunction object containing a specified function.
|
Modifier and Type | Method and Description |
---|---|
void |
apply(StackOfDouble stack,
Cases cases)
Evaluate the function applied to argument values popped from the stack,
and leave the result on the stack.
|
boolean |
dependsOn(Variable x)
Return true if the definition of this function depends
in some way on the variable x.
|
Function |
derivative(int wrt)
Return the derivative of the function with repect to
argument number wrt, where arguments are numbered starting from 1.
|
Function |
derivative(Variable x)
Return the derivative of the function with respect to the
variable x (where x is NOT one of the parameters of the function).
|
int |
getArity()
Return the number of arguments of this function.
|
Function |
getFunction()
Return the function that is currently wrapped in this WrapperFunction.
|
double |
getVal(double[] arguments)
Find the value of the function at the argument value
argument[0], ....
|
double |
getValueWithCases(double[] arguments,
Cases cases)
Find the value of the function at the argument values
argument[0],....
|
void |
setFunction(Function f)
Set the function that is contained in this WrapperFunction.
|
appendOutputString, compileDerivative, doParse, extent, getName, setName, setParensCanBeOptional
public WrapperFunction(Function f)
f
- The non-null function that will be contained in the WrapperFunction.public void setFunction(Function f)
f
- The non-null function to be used in this WrapperFunction object.
It must have the same arity as the current function.public Function getFunction()
public int getArity()
public double getVal(double[] arguments)
public double getValueWithCases(double[] arguments, Cases cases)
public Function derivative(int wrt)
public Function derivative(Variable x)
public boolean dependsOn(Variable x)
public void apply(StackOfDouble stack, Cases cases)
apply
in interface ExpressionCommand
apply
in class FunctionParserExtension
stack
- contains results of previous commands in the program.cases
- if non-null, any case information generated during evaluation should be recorded here.