Parallel Colt 0.7.2

hep.aida.tfloat.bin
Class StaticFloatBin1D

java.lang.Object
  extended by cern.colt.PersistentObject
      extended by hep.aida.tfloat.bin.AbstractFloatBin
          extended by hep.aida.tfloat.bin.AbstractFloatBin1D
              extended by hep.aida.tfloat.bin.StaticFloatBin1D
All Implemented Interfaces:
FloatBufferConsumer, Serializable, Cloneable
Direct Known Subclasses:
MightyStaticFloatBin1D

public class StaticFloatBin1D
extends AbstractFloatBin1D

1-dimensional non-rebinnable bin consuming float elements; Efficiently computes basic statistics of data sequences. First see the package summary and javadoc tree view to get the broad picture.

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.

Version:
0.9, 03-Jul-99
Author:
wolfgang.hoschek@cern.ch
See Also:
Serialized Form

Field Summary
 
Fields inherited from class cern.colt.PersistentObject
serialVersionUID
 
Constructor Summary
StaticFloatBin1D()
          Constructs and returns an empty bin.
 
Method Summary
 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] ).
 
Methods inherited from class hep.aida.tfloat.bin.AbstractFloatBin1D
addAllOf, buffered, compareWith, equals, mean, rms, standardDeviation, standardError, toString, trimToSize, variance
 
Methods inherited from class hep.aida.tfloat.bin.AbstractFloatBin
center, center, error, error, offset, offset, value, value
 
Methods inherited from class cern.colt.PersistentObject
clone
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StaticFloatBin1D

public StaticFloatBin1D()
Constructs and returns an empty bin.

Method Detail

add

public void add(float element)
Adds the specified element to the receiver.

Specified by:
add in class AbstractFloatBin1D
Parameters:
element - element to be appended.

addAllOfFromTo

public 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.

Overrides:
addAllOfFromTo in class AbstractFloatBin1D
Parameters:
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).
Throws:
IndexOutOfBoundsException - if list.size()>0 && (from<0 || from>to || to>=list.size()) .

clear

public void clear()
Removes all elements from the receiver. The receiver will be empty after this call returns.

Specified by:
clear in class AbstractFloatBin

isRebinnable

public boolean isRebinnable()
Returns false. Returns whether a client can obtain all elements added to the receiver. In other words, tells whether the receiver internally preserves all added elements. If the receiver is rebinnable, the elements can be obtained via elements() methods.

Specified by:
isRebinnable in class AbstractFloatBin

max

public float max()
Returns the maximum.

Specified by:
max in class AbstractFloatBin1D

min

public float min()
Returns the minimum.

Specified by:
min in class AbstractFloatBin1D

size

public int size()
Returns the number of elements contained in the receiver.

Specified by:
size in class AbstractFloatBin
Returns:
the number of elements contained in the receiver.

sum

public float sum()
Returns the sum of all elements, which is Sum( x[i] ).

Specified by:
sum in class AbstractFloatBin1D

sumOfSquares

public float sumOfSquares()
Returns the sum of squares, which is Sum( x[i] * x[i] ).

Specified by:
sumOfSquares in class AbstractFloatBin1D

Parallel Colt 0.7.2

Jump to the Parallel Colt Homepage