Class DoubleBuffer
java.lang.Object
cern.colt.PersistentObject
cern.jet.stat.quantile.Buffer
cern.jet.stat.quantile.DoubleBuffer
- All Implemented Interfaces:
Serializable, Cloneable
A buffer holding double elements; internally used for computing approximate quantiles.
-
Field Summary
FieldsFields inherited from class Buffer
isAllocated, k, level, weightFields inherited from class PersistentObject
serialVersionUID -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(double value) Adds a value to the receiver.voidaddAllOfFromTo(DoubleArrayList elements, int from, int to) Adds a value to the receiver.protected voidallocate()Allocates the receiver.voidclear()Clears the receiver.clone()Returns a deep copy of the receiver.booleancontains(double element) Returns whether the specified element is contained in the receiver.booleanisEmpty()Returns whether the receiver is empty.booleanisFull()Returns whether the receiver is empty.intmemory()Returns the number of elements currently needed to store all contained elements.doublerank(double element) Returns the rank of a given element within the sorted sequence of the receiver.intsize()Returns the number of elements contained in the receiver.voidsort()Sorts the receiver.toString()Returns a String representation of the receiver.
-
Field Details
-
values
-
isSorted
protected boolean isSorted
-
-
Constructor Details
-
DoubleBuffer
public DoubleBuffer(int k) This method was created in VisualAge.- Parameters:
k- int
-
-
Method Details
-
add
public void add(double value) Adds a value to the receiver. -
addAllOfFromTo
Adds a value to the receiver. -
allocate
protected void allocate()Allocates the receiver. -
clear
-
clone
Returns a deep copy of the receiver.- Overrides:
clonein classPersistentObject- Returns:
- a deep copy of the receiver.
-
contains
public boolean contains(double element) Returns whether the specified element is contained in the receiver. -
isEmpty
-
isFull
-
memory
public int 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 algorithm. -
rank
public double rank(double element) Returns the rank of a given element within the sorted sequence of the receiver. A rank is the number of elements invalid input: '<'= element. Ranks are of the form {1,2,...size()}. If no element is invalid input: '<'= element, then the rank is zero. If the element lies in between two contained elements, then uses linear interpolation.- Parameters:
element- the element to search forlist- cern.colt.list.DoubleArrayList- Returns:
- the rank of the element.
-
size
-
sort
-
toString
-