Represents a function computing the average of several functions. More...
Public Member Functions | |
| AverageMathFunction (MathFunction... func) | |
| Constructs a function computing the average of the functions in the array func. | |
| MathFunction[] | getFunctions () |
| Returns the functions being averaged. | |
| double | evaluate (double x) |
| Returns the value of the function evaluated at \(x\). | |
| double | derivative (double x, int n) |
| Computes (or estimates) the \(n\)th derivative of the function at point x. | |
| 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 \([a,
b]\). | |
Represents a function computing the average of several functions.
Let \(f_0(x), …, f_{n-1}(x)\) be a set of \(n\) functions. This function represents the average
\[ f(x)=\frac{1}{n}\sum_{i=0}^{n-1} f_i(x). \]
Definition at line 33 of file AverageMathFunction.java.
| umontreal.ssj.functions.AverageMathFunction.AverageMathFunction | ( | MathFunction... | func | ) |
Constructs a function computing the average of the functions in the array func.
| func | the array of functions to average. |
Definition at line 44 of file AverageMathFunction.java.
| double umontreal.ssj.functions.AverageMathFunction.derivative | ( | double | x | ) |
Computes (or estimates) the first derivative of the function at point x.
| x | the point to evaluate the derivative to. |
Implements umontreal.ssj.functions.MathFunctionWithFirstDerivative.
Definition at line 77 of file AverageMathFunction.java.
| double umontreal.ssj.functions.AverageMathFunction.derivative | ( | double | x, |
| int | n ) |
Computes (or estimates) the \(n\)th derivative of the function at point x.
For \(n=0\), this returns the result of umontreal.ssj.functions.MathFunction.evaluate(double).
| x | the point to evaluate the derivate to. |
| n | the order of the derivative. |
| IllegalArgumentException | if `n` is negative or 0. |
Implements umontreal.ssj.functions.MathFunctionWithDerivative.
Definition at line 66 of file AverageMathFunction.java.
| double umontreal.ssj.functions.AverageMathFunction.evaluate | ( | double | x | ) |
Returns the value of the function evaluated at \(x\).
| x | value at which the function is evaluated |
Implements umontreal.ssj.functions.MathFunction.
Definition at line 59 of file AverageMathFunction.java.
| MathFunction[] umontreal.ssj.functions.AverageMathFunction.getFunctions | ( | ) |
Returns the functions being averaged.
Definition at line 55 of file AverageMathFunction.java.
| double umontreal.ssj.functions.AverageMathFunction.integral | ( | double | a, |
| double | b ) |
Computes (or estimates) the integral of the function over the interval \([a, b]\).
| a | the starting point of the interval. |
| b | the ending point of the interval. |
Implements umontreal.ssj.functions.MathFunctionWithIntegral.
Definition at line 84 of file AverageMathFunction.java.