hep.aida.tfloat.bin
Class AbstractFloatBin1D
- java.lang.Object
-
- cern.colt.PersistentObject
-
- hep.aida.tfloat.bin.AbstractFloatBin
-
- hep.aida.tfloat.bin.AbstractFloatBin1D
-
- All Implemented Interfaces:
- FloatBufferConsumer, java.io.Serializable, java.lang.Cloneable
- Direct Known Subclasses:
- StaticFloatBin1D
public abstract class AbstractFloatBin1D extends AbstractFloatBin implements FloatBufferConsumer
Abstract base class for all 1-dimensional bins consumes float elements. First see the package summary and javadoc tree view to get the broad picture.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.
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method and Description abstract voidadd(float element)Adds the specified element to the receiver.voidaddAllOf(FloatArrayList list)Adds all values of the specified list to the receiver.voidaddAllOfFromTo(FloatArrayList list, int from, int to)Adds the part of the specified list between indexes from (inclusive) and to (inclusive) to the receiver.FloatBufferbuffered(int capacity)Constructs and returns a streaming buffer connected to the receiver.java.lang.StringcompareWith(AbstractFloatBin1D other)Computes the deviations from the receiver's measures to another bin's measures.booleanequals(java.lang.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 floatmax()Returns the maximum.floatmean()Returns the arithmetic mean, which is Sum( x[i] ) / size().abstract floatmin()Returns the minimum.floatrms()Returns the rms (Root Mean Square), which is Math.sqrt( Sum( x[i]*x[i] ) / size() ).floatstandardDeviation()Returns the sample standard deviation, which is Math.sqrt(variance()).floatstandardError()Returns the sample standard error, which is Math.sqrt(variance() / size())abstract floatsum()Returns the sum of all elements, which is Sum( x[i] ).abstract floatsumOfSquares()Returns the sum of squares, which is Sum( x[i] * x[i] ).java.lang.StringtoString()Returns a String representation of the receiver.voidtrimToSize()Trims the capacity of the receiver to be the receiver's current size.floatvariance()Returns the sample variance, which is Sum( (x[i]-mean())2 ) / (size()-1).-
Methods inherited from class hep.aida.tfloat.bin.AbstractFloatBin
center, center, clear, error, error, isRebinnable, offset, offset, size, value, value
-
Methods inherited from class cern.colt.PersistentObject
clone
-
-
-
-
Method Detail
-
add
public abstract void add(float element)
Adds the specified element to the receiver.- Parameters:
element- element to be appended.
-
addAllOf
public final void addAllOf(FloatArrayList list)
Adds all values of the specified list to the receiver.- Specified by:
addAllOfin interfaceFloatBufferConsumer- Parameters:
list- the list of which all values shall be added.
-
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. You may want to override this method for performance reasons.- 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:
java.lang.IndexOutOfBoundsException- if list.size()>0 && (from<0 || from>to || to>=list.size()) .
-
buffered
public FloatBuffer buffered(int capacity)
Constructs and returns a streaming buffer connected to the receiver. Whenever the buffer is full it's contents are automatically flushed to this. (Addding elements via a buffer to a bin is significantly faster than adding them directly.)- Parameters:
capacity- the number of elements the buffer shall be capable of holding before overflowing and flushing to the receiver.- Returns:
- a streaming buffer having the receiver as target.
-
compareWith
public java.lang.String compareWith(AbstractFloatBin1D other)
Computes the deviations from the receiver's measures to another bin's measures.- Parameters:
other- the other bin to compare with- Returns:
- a summary of the deviations.
-
equals
public boolean equals(java.lang.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.- Overrides:
equalsin classAbstractFloatBin
-
max
public abstract float max()
Returns the maximum.
-
mean
public float mean()
Returns the arithmetic mean, which is Sum( x[i] ) / size().
-
min
public abstract float min()
Returns the minimum.
-
rms
public float rms()
Returns the rms (Root Mean Square), which is Math.sqrt( Sum( x[i]*x[i] ) / size() ).
-
standardDeviation
public float standardDeviation()
Returns the sample standard deviation, which is Math.sqrt(variance()).
-
standardError
public float standardError()
Returns the sample standard error, which is Math.sqrt(variance() / size())
-
sum
public abstract float sum()
Returns the sum of all elements, which is Sum( x[i] ).
-
sumOfSquares
public abstract float sumOfSquares()
Returns the sum of squares, which is Sum( x[i] * x[i] ).
-
toString
public java.lang.String toString()
Returns a String representation of the receiver.- Overrides:
toStringin classAbstractFloatBin
-
trimToSize
public void trimToSize()
Trims the capacity of the receiver to be the receiver's current size. Releases any superfluos internal memory. An application can use this operation to minimize the storage of the receiver. This default implementation does nothing.- Overrides:
trimToSizein classAbstractFloatBin
-
variance
public float variance()
Returns the sample variance, which is Sum( (x[i]-mean())2 ) / (size()-1).
-
-
DMelt 3.0 © DataMelt by jWork.ORG