protected class CoverTree.MyHeap extends java.lang.Object implements RevisionHandler
| Constructor and Description |
|---|
MyHeap(int maxSize)
constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
downheap()
performs downheap operation for the heap to maintian its properties.
|
CoverTree.MyHeapElement |
get()
returns the first element and removes it from the heap.
|
CoverTree.MyHeapElement |
getKthNearest()
returns the kth nearest element or null if none there.
|
java.lang.String |
getRevision()
Returns the revision string.
|
int |
noOfKthNearest()
returns the number of k nearest.
|
CoverTree.MyHeapElement |
peek()
peeks at the first element.
|
void |
put(double d)
adds the distance value to the heap.
|
void |
putBySubstitute(double d)
Puts an element by substituting it in place of the top most element.
|
void |
putKthNearest(double d)
Stores kth nearest elements (if there are more than one).
|
int |
size()
returns the size of the heap.
|
int |
totalSize()
returns the total size.
|
protected void |
upheap()
performs upheap operation for the heap to maintian its properties.
|
public MyHeap(int maxSize)
maxSize - the maximum size of the heappublic int size()
public CoverTree.MyHeapElement peek()
public CoverTree.MyHeapElement get() throws java.lang.Exception
java.lang.Exception - if no elements in heappublic void put(double d)
throws java.lang.Exception
d - the distance valuejava.lang.Exception - if the heap gets too largepublic void putBySubstitute(double d)
throws java.lang.Exception
d - The distance value.java.lang.Exception - If distance is smaller than that of the head element.public int noOfKthNearest()
m_KthNearestSizepublic void putKthNearest(double d)
d - the distancepublic CoverTree.MyHeapElement getKthNearest()
protected void upheap()
protected void downheap()
public int totalSize()
public java.lang.String getRevision()
getRevision in interface RevisionHandler