public class SymbolicSumOfLogs extends AbstractSymbolicStorelessUnivariateStatistic implements java.io.Serializable
Therefore,
NaN.
Double.POSITIVE_INFINITY
, but at least one value is 0, the
result is Double.NEGATIVE_INFINITY.
Double.POSITIVE_INFINITY
and
Double.NEGATIVE_INFINITY
are among the values, the result is
NaN.
Note that this implementation is not synchronized. If
multiple threads access an instance of this class concurrently, and at least
one of the threads invokes the increment()
or
clear()
method, it must be synchronized externally.
Constructor and Description |
---|
SymbolicSumOfLogs()
Create a SumOfLogs instance
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears the internal state of the Statistic
|
IExpr |
evaluate(IAST values,
int begin,
int length)
Returns the sum of the natural logs of the entries in the specified portion
of the input array, or
Double.NaN if the designated subarray
is empty. |
long |
getN()
Returns the number of values that have been added.
|
IExpr |
getResult()
Returns the current value of the Statistic.
|
void |
increment(IExpr d)
Updates the internal state of the statistic to reflect the addition of the
new value.
|
evaluate, incrementAll, incrementAll, test, test, test, test
public void increment(IExpr d)
increment
in interface StorelessSymbolicUnivariateStatistic
increment
in class AbstractSymbolicStorelessUnivariateStatistic
d
- the new value.public IExpr getResult()
getResult
in interface StorelessSymbolicUnivariateStatistic
getResult
in class AbstractSymbolicStorelessUnivariateStatistic
Double.NaN
if it has been
cleared or just instantiated.public long getN()
getN
in interface StorelessSymbolicUnivariateStatistic
getN
in class AbstractSymbolicStorelessUnivariateStatistic
public void clear()
clear
in interface StorelessSymbolicUnivariateStatistic
clear
in class AbstractSymbolicStorelessUnivariateStatistic
public IExpr evaluate(IAST values, int begin, int length)
Double.NaN
if the designated subarray
is empty.
Throws IllegalArgumentException
if the array is null.
See SymbolicSumOfLogs
.
evaluate
in interface SymbolicUnivariateStatistic
evaluate
in class AbstractSymbolicStorelessUnivariateStatistic
values
- the input arraybegin
- index of the first array element to includelength
- the number of elements to includejava.lang.IllegalArgumentException
- if the array is null or the array index parameters are not validUnivariateStatistic.evaluate(double[],
int, int)