public class StaticFloatBin1D extends AbstractFloatBin1D
The data streamed into a SimpleBin1D is not preserved! As a
consequence infinitely many elements can be added to this bin. As a further
consequence this bin cannot compute more than basic statistics. It is also
not rebinnable. If these drawbacks matter, consider to use a
DynamicFloatBin1D, which overcomes them at the expense of increased
memory requirements.
This class is fully thread safe (all public methods are synchronized). Thus, you can have one or more threads adding to the bin as well as one or more threads reading and viewing the statistics of the bin while it is filled. For high performance, add data in large chunks (buffers) via method addAllOf rather than piecewise via method add.
Implementation: Incremental maintainance. Performance linear in the number of elements added.
| Constructor and Description |
|---|
StaticFloatBin1D()
Constructs and returns an empty bin.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(float element)
Adds the specified element to the receiver.
|
void |
addAllOfFromTo(FloatArrayList list,
int from,
int to)
Adds the part of the specified list between indexes from
(inclusive) and to (inclusive) to the receiver.
|
void |
clear()
Removes all elements from the receiver.
|
boolean |
isRebinnable()
Returns false.
|
float |
max()
Returns the maximum.
|
float |
min()
Returns the minimum.
|
int |
size()
Returns the number of elements contained in the receiver.
|
float |
sum()
Returns the sum of all elements, which is Sum( x[i] ).
|
float |
sumOfSquares()
Returns the sum of squares, which is Sum( x[i] * x[i] ).
|
addAllOf, buffered, compareWith, equals, mean, rms, standardDeviation, standardError, toString, trimToSize, variancecenter, center, error, error, offset, offset, value, valueclonepublic void add(float element)
add in class AbstractFloatBin1Delement - element to be appended.public void addAllOfFromTo(FloatArrayList list, int from, int to)
addAllOfFromTo in class AbstractFloatBin1Dlist - the list of which elements shall be added.from - the index of the first element to be added (inclusive).to - the index of the last element to be added (inclusive).IndexOutOfBoundsException - if
list.size()>0 && (from<0 || from>to || to>=list.size())
.public void clear()
clear in class AbstractFloatBinpublic boolean isRebinnable()
isRebinnable in class AbstractFloatBinpublic float max()
max in class AbstractFloatBin1Dpublic float min()
min in class AbstractFloatBin1Dpublic int size()
size in class AbstractFloatBinpublic float sum()
sum in class AbstractFloatBin1Dpublic float sumOfSquares()
sumOfSquares in class AbstractFloatBin1DJump to the Parallel Colt Homepage