Package pylal :: Module low_latency_clustering :: Class SlidingMaxHeap
[hide private]
[frames] | no frames]

Class SlidingMaxHeap

source code

object --+
         |
        SlidingMaxHeap

A max heap that retains the order in which samples were added to it. The history capacity grows dynamically by expanding to the smallest power of two required to hold the contents.

This is essentially an ordinary max heap, storing values and their sample offsets from the originating stream, coupled with a dynamically sized ring buffer storing the heap ranks of each sample.

This procedure should take about O(1) time per input sample on average.

Instance Methods [hide private]
 
__init__(self, value=None)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
_drop_oldest(self) source code
 
drop_while(self, predicate) source code
 
append(self, x) source code
 
root(self)
Return the maximum element in the history (the 'root' of the binary tree that is the heap).
source code
 
history(self) source code
 
count(self) source code
 
is_heap(self) source code
 
_swap(self, i, j) source code
 
_cmp(self, i, j) source code
 
_sift_up(self, i) source code
 
_sift_down(self, i) source code
 
_sift(self, i) source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, value=None)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

root(self)

source code 

Return the maximum element in the history (the 'root' of the binary tree that is the heap).

Decorators:
  • @property

history(self)

source code 
Decorators:
  • @property

count(self)

source code 
Decorators:
  • @property