public class AverageMathFunction extends java.lang.Object implements MathFunction, MathFunctionWithFirstDerivative, MathFunctionWithDerivative, MathFunctionWithIntegral
∑i=0n-1fi(x).
| Constructor and Description |
|---|
AverageMathFunction(MathFunction... func)
Constructs a function computing the average
of the functions in the array func.
|
| Modifier and Type | Method and Description |
|---|---|
double |
derivative(double x)
Computes (or estimates) the first derivative
of the function at point x.
|
double |
derivative(double x,
int n)
Computes (or estimates) the nth derivative
of the function at point x.
|
double |
evaluate(double x)
Returns the value of the function evaluated at x.
|
MathFunction[] |
getFunctions()
Returns the functions being averaged.
|
double |
integral(double a,
double b)
Computes (or estimates) the integral of the
function over the interval [a, b].
|
public AverageMathFunction(MathFunction... func)
func - the array of functions to average.public MathFunction[] getFunctions()
public double evaluate(double x)
MathFunctionevaluate in interface MathFunctionx - value at which the distribution function is evaluatedpublic double derivative(double x,
int n)
MathFunctionWithDerivativeevaluate.derivative in interface MathFunctionWithDerivativex - the point to evaluate the derivate to.n - the order of the derivative.public double derivative(double x)
MathFunctionWithFirstDerivativederivative in interface MathFunctionWithFirstDerivativex - the point to evaluate the derivative to.public double integral(double a,
double b)
MathFunctionWithIntegralintegral in interface MathFunctionWithIntegrala - the starting point of the interval.b - the ending point of the interval.To submit a bug or ask questions, send an e-mail to Pierre L'Ecuyer.