cern.jet.stat.tfloat.quantile
Interface FloatQuantileFinder
-
- All Superinterfaces:
- java.io.Serializable
public interface FloatQuantileFinder extends java.io.SerializableThe interface shared by all quantile finders, no matter if they are exact or approximate. It is usually completely sufficient to operate on this interface only. Also seeQuantileFloatBin1D, demonstrating how this package can be used.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description voidadd(float value)Adds a value to the receiver.voidaddAllOf(FloatArrayList values)Adds all values of the specified list to the receiver.voidaddAllOfFromTo(FloatArrayList values, int from, int to)Adds the part of the specified list between indexes from (inclusive) and to (inclusive) to the receiver.voidclear()Removes all elements from the receiver.java.lang.Objectclone()Returns a deep copy of the receiver.booleanforEach(FloatProcedure procedure)Applies a procedure to each element of the receiver, if any.longmemory()Returns the number of elements currently needed to store all contained elements.floatphi(float element)Returns how many percent of the elements contained in the receiver are <= element.FloatArrayListquantileElements(FloatArrayList phis)Computes the specified quantile elements over the values previously added.longsize()Returns the number of elements currently contained in the receiver (identical to the number of values added so far).longtotalMemory()Returns the number of elements currently needed to store all contained elements.
-
-
-
Method Detail
-
add
void add(float value)
Adds a value to the receiver.- Parameters:
value- the value to add.
-
addAllOf
void addAllOf(FloatArrayList values)
Adds all values of the specified list to the receiver.- Parameters:
values- the list of which all values shall be added.
-
addAllOfFromTo
void addAllOfFromTo(FloatArrayList values, int from, int to)
Adds the part of the specified list between indexes from (inclusive) and to (inclusive) to the receiver.- Parameters:
values- 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).
-
clear
void clear()
Removes all elements from the receiver. The receiver will be empty after this call returns, and its memory requirements will be close to zero.
-
clone
java.lang.Object clone()
Returns a deep copy of the receiver.- Returns:
- a deep copy of the receiver.
-
forEach
boolean forEach(FloatProcedure procedure)
Applies a procedure to each element of the receiver, if any. Iterates over the receiver in no particular order.- Parameters:
procedure- the procedure to be applied. Stops iteration if the procedure returns false, otherwise continues.- Returns:
- false if the procedure stopped before all elements where iterated over, true otherwise.
-
memory
long memory()
Returns the number of elements currently needed to store all contained elements. This number usually differs from the results of method size(), according to the underlying datastructure.
-
phi
float phi(float element)
Returns how many percent of the elements contained in the receiver are <= element. Does linear interpolation if the element is not contained but lies in between two contained elements. Writing a wrapper is a good idea if you can think of better ways of doing interpolation. Same if you want to keep min,max and other such measures.- Parameters:
element- the element to search for.- Returns:
- the percentage p of elements <= element ( 0.0 <= p <=1.0).
-
quantileElements
FloatArrayList quantileElements(FloatArrayList phis)
Computes the specified quantile elements over the values previously added.- Parameters:
phis- the quantiles for which elements are to be computed. Each phi must be in the interval [0.0,1.0]. phis must be sorted ascending.- Returns:
- the quantile elements.
-
size
long size()
Returns the number of elements currently contained in the receiver (identical to the number of values added so far).
-
totalMemory
long totalMemory()
Returns the number of elements currently needed to store all contained elements. This number usually differs from the results of method size(), according to the underlying datastructure.
-
-
DMelt 3.0 © DataMelt by jWork.ORG