If there are no values in the dataset, then 0 is returned.
If any of the values are
NaN, then NaN is returned.
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 long | |
| private static final long | serialVersionUID
Serializable version identifier |
| private double | value
The currently running sumSq |
| Access | Constructor and Description |
|---|---|
| public | |
| public | SumOfSquares(SumOfSquares
the original)SumOfSquares instance to copyCopy constructor, creates a new |
| Modifier and Type | Method and Description |
|---|---|
| public void | clear()
Implements abstract org. Implements org. Clears the internal state of the Statistic |
| public SumOfSquares | copy()
Implements abstract org. Implements org. Returns a copy of the statistic with the same internal state. |
| public static void | copy(SumOfSquares
SumOfSquares to copy source, SumOfSquares SumOfSquares to copy to dest)Copies source to dest. |
| public double | Returns: the sum of the squares of the values or 0 if length = 0the input array values, final int index of the first array element to include begin, final int the number of elements to include length)Overrides org. Implements org. Returns the sum of the squares of the entries in the specified portion of
the input array, or |
| public long | getN()
Implements org. Returns the number of values that have been added. |
| public double | getResult()
Implements abstract org. Implements org. Returns the current value of the Statistic. |
| public void | increment(final double
the new value. d)Implements abstract org. Implements org. Updates the internal state of the statistic to reflect the addition of the new value. |
| n | back to summary |
|---|---|
| private long n | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Serializable version identifier | |
| value | back to summary |
|---|---|
| private double value The currently running sumSq | |
| SumOfSquares | back to summary |
|---|---|
| public SumOfSquares() Create a SumOfSquares instance | |
| SumOfSquares | back to summary |
|---|---|
| public SumOfSquares(SumOfSquares 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 SumOfSquares 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(SumOfSquares source, SumOfSquares 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 squares of the entries in the specified portion of
the input array, or
Throws
| |
| 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.
| |