25package umontreal.ssj.functions;
46 throw new NullPointerException();
47 this.func = func.clone();
62 sum += fi.evaluate(x);
63 return sum / func.length;
68 throw new IllegalArgumentException(
"n must be greater than or equal to 0");
74 return sum / func.length;
81 return sum / func.length;
88 return sum / func.length;
double derivative(double x)
Computes (or estimates) the first derivative of the function at point x.
double integral(double a, double b)
Computes (or estimates) the integral of the function over the interval .
double evaluate(double x)
Returns the value of the function evaluated at .
AverageMathFunction(MathFunction... func)
Constructs a function computing the average of the functions in the array func.
double derivative(double x, int n)
Computes (or estimates) the th derivative of the function at point x.
MathFunction[] getFunctions()
Returns the functions being averaged.
Provides utility methods for computing derivatives and integrals of functions.
static double derivative(MathFunction func, double x)
Returns the first derivative of the function func evaluated at x.
static double integral(MathFunction func, double a, double b)
Returns the integral of the function func over .
Represents a mathematical function whose th derivative can be computed using derivative(double,...
Represents a mathematical function whose derivative can be computed using derivative(double).
Represents a mathematical function whose integral can be computed by the integral(double,...
This interface should be implemented by classes which represent univariate mathematical functions.