Uses org. to compute the logs.
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.
| Modifier and Type | Field and Description |
|---|---|
| private int | n
Number of values that have been added |
| private static final long | serialVersionUID
Serializable version identifier |
| private double | value
The currently running value |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| n | back to summary |
|---|---|
| private int n Number of values that have been added | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Serializable version identifier | |
| value | back to summary |
|---|---|
| private double value The currently running value | |
| SumOfLogs | back to summary |
|---|---|
| public SumOfLogs() Create a SumOfLogs instance | |
| SumOfLogs | back to summary |
|---|---|
| public SumOfLogs(SumOfLogs original) throws NullArgumentException Copy constructor, creates a new
| |
| clear | back to summary |
|---|---|
| public void clear() Implements abstract org. Implements org. Doc from org. Clears the internal state of the Statistic
| |
| copy | back to summary |
|---|---|
| public SumOfLogs copy() Implements abstract org. Implements org. Doc from org. Returns a copy of the statistic with the same internal state.
| |
| copy | back to summary |
|---|---|
| public static void copy(SumOfLogs source, SumOfLogs dest) throws NullArgumentException Copies source to dest. Neither source nor dest can be null.
| |
| evaluate | back to summary |
|---|---|
| public double evaluate(final double[] values, final int begin, final int length) throws MathIllegalArgumentException Overrides org. Implements org. Returns the sum of the natural logs of the entries in the specified portion of
the input array, or
Throws
See
| |
| getN | back to summary |
|---|---|
| public long getN() Implements org. Doc from org. Returns the number of values that have been added.
| |
| getResult | back to summary |
|---|---|
| public double getResult() Implements abstract org. Implements org. Doc from org. Returns the current value of the Statistic.
| |
| increment | back to summary |
|---|---|
| public void increment(final double d) Implements abstract org. Implements org. Doc from org. Updates the internal state of the statistic to reflect the addition of the new value.
| |