public abstract class AbstractFloatBin1D extends AbstractFloatBin implements FloatBufferConsumer
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.
Modifier and Type | Method and Description |
---|---|
abstract void |
add(float element)
Adds the specified element to the receiver.
|
void |
addAllOf(FloatArrayList list)
Adds all values of the specified list 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.
|
FloatBuffer |
buffered(int capacity)
Constructs and returns a streaming buffer connected to the receiver.
|
String |
compareWith(AbstractFloatBin1D other)
Computes the deviations from the receiver's measures to another bin's
measures.
|
boolean |
equals(Object object)
Returns whether two bins are equal; They are equal if the other object is
of the same class or a subclass of this class and both have the same
size, minimum, maximum, sum and sumOfSquares.
|
abstract float |
max()
Returns the maximum.
|
float |
mean()
Returns the arithmetic mean, which is Sum( x[i] ) / size().
|
abstract float |
min()
Returns the minimum.
|
float |
rms()
Returns the rms (Root Mean Square), which is
Math.sqrt( Sum( x[i]*x[i] ) / size() ).
|
float |
standardDeviation()
Returns the sample standard deviation, which is
Math.sqrt(variance()).
|
float |
standardError()
Returns the sample standard error, which is
Math.sqrt(variance() / size())
|
abstract float |
sum()
Returns the sum of all elements, which is Sum( x[i] ).
|
abstract float |
sumOfSquares()
Returns the sum of squares, which is Sum( x[i] * x[i] ).
|
String |
toString()
Returns a String representation of the receiver.
|
void |
trimToSize()
Trims the capacity of the receiver to be the receiver's current size.
|
float |
variance()
Returns the sample variance, which is
Sum( (x[i]-mean())2 ) / (size()-1).
|
center, center, clear, error, error, isRebinnable, offset, offset, size, value, value
clone
public abstract void add(float element)
element
- element to be appended.public final void addAllOf(FloatArrayList list)
addAllOf
in interface FloatBufferConsumer
list
- the list of which all values shall be added.public void addAllOfFromTo(FloatArrayList list, int from, int to)
list
- 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 FloatBuffer buffered(int capacity)
capacity
- the number of elements the buffer shall be capable of holding
before overflowing and flushing to the receiver.public String compareWith(AbstractFloatBin1D other)
other
- the other bin to compare withpublic boolean equals(Object object)
equals
in class AbstractFloatBin
public abstract float max()
public float mean()
public abstract float min()
public float rms()
public float standardDeviation()
public float standardError()
public abstract float sum()
public abstract float sumOfSquares()
public String toString()
toString
in class AbstractFloatBin
public void trimToSize()
trimToSize
in class AbstractFloatBin
public float variance()
Jump to the Parallel Colt Homepage