public abstract class AbstractUnivariateStatistic extends Object implements UnivariateStatistic
UnivariateStatistic
interface.
Provides a default implementation of evaluate(double[]),
delegating to evaluate(double[], int, int)
in the natural way.
Also includes a test
method that performs generic parameter
validation for the evaluate
methods.
Constructor and Description |
---|
AbstractUnivariateStatistic() |
Modifier and Type | Method and Description |
---|---|
abstract UnivariateStatistic |
copy()
Returns a copy of the statistic with the same internal state.
|
double |
evaluate()
Returns the result of evaluating the statistic over the stored data.
|
double |
evaluate(double[] values)
Returns the result of evaluating the statistic over the input array.
|
abstract double |
evaluate(double[] values,
int begin,
int length)
Returns the result of evaluating the statistic over the specified entries
in the input array.
|
double[] |
getData()
Get a copy of the stored data array.
|
void |
setData(double[] values)
Set the data array.
|
void |
setData(double[] values,
int begin,
int length)
Set the data array.
|
public void setData(double[] values)
The stored value is a copy of the parameter array, not the array itself.
values
- data array to store (may be null to remove stored data)evaluate()
public double[] getData()
public void setData(double[] values, int begin, int length) throws MathIllegalArgumentException
values
- data array to storebegin
- the index of the first element to includelength
- the number of elements to includeMathIllegalArgumentException
- if values is null or the indices
are not validevaluate()
public double evaluate() throws MathIllegalArgumentException
The stored array is the one which was set by previous calls to setData(double[])
.
MathIllegalArgumentException
- if the stored data array is nullpublic double evaluate(double[] values) throws MathIllegalArgumentException
evaluate
in interface UnivariateStatistic
evaluate
in interface MathArrays.Function
values
- input arrayMathIllegalArgumentException
- if values is nullpublic abstract double evaluate(double[] values, int begin, int length) throws MathIllegalArgumentException
evaluate
in interface UnivariateStatistic
evaluate
in interface MathArrays.Function
values
- the input arraybegin
- the index of the first element to includelength
- the number of elements to includeMathIllegalArgumentException
- if values is null or the indices are invalidpublic abstract UnivariateStatistic copy()
copy
in interface UnivariateStatistic
Jas4pp 1.5 © Java Analysis Studio for Particle Physics