A kD-tree suitable for splitting parameter spaces and counting hypervolumes.
Is modified from the KDTree class so that bounding boxes are stored. This means that there are no longer gaps in the hypervolume once the samples have been split into groups.
Definition at line 2497 of file bayespputils.py.
Inherits object.
Public Member Functions | |
def | __init__ (self, objects, boundingbox, dims=0) |
Construct a kD-tree from a sequence of objects. More... | |
def | objects (self) |
Returns the objects in the tree. More... | |
def | __iter__ (self) |
Iterator over all the objects contained in the tree. More... | |
def | left (self) |
Returns the left tree. More... | |
def | right (self) |
Returns the right tree. More... | |
def | split_dim (self) |
Returns the dimension along which this level of the kD-tree splits. More... | |
def | bounds (self) |
Returns the coordinates of the lower-left and upper-right corners of the bounding box for this tree: low_left, up_right. More... | |
def | volume (self) |
Returns the volume of the bounding box of the tree. More... | |
def | integrate (self, f, boxing=64) |
Returns the integral of f(objects) over the tree. More... | |
def | operate (self, f, g, boxing=64) |
Operates on tree nodes exceeding boxing parameter depth. More... | |
def | search (self, coordinates, boxing=64) |
takes a set of coordinates and searches down through the tree untill it gets to a box with less than 'boxing' objects in it and returns the box bounds, number of objects in the box, and the weighting. More... | |
def | fillNewTree (self, boxing=64, isArea=False) |
copies tree structure, but with KDSkeleton as the new nodes. More... | |
def lalinference.bayespputils.KDTreeVolume.__init__ | ( | self, | |
objects, | |||
boundingbox, | |||
dims = 0 |
|||
) |
Construct a kD-tree from a sequence of objects.
Each object should return its coordinates using obj.coord(). the obj should also store the bounds of the hypervolume its found in. for non-leaf objects we need the name of the dimension split and value at split.
Definition at line 2504 of file bayespputils.py.
def lalinference.bayespputils.KDTreeVolume.objects | ( | self | ) |
Returns the objects in the tree.
Definition at line 2568 of file bayespputils.py.
def lalinference.bayespputils.KDTreeVolume.__iter__ | ( | self | ) |
Iterator over all the objects contained in the tree.
Definition at line 2574 of file bayespputils.py.
def lalinference.bayespputils.KDTreeVolume.left | ( | self | ) |
Returns the left tree.
Definition at line 2580 of file bayespputils.py.
def lalinference.bayespputils.KDTreeVolume.right | ( | self | ) |
Returns the right tree.
Definition at line 2586 of file bayespputils.py.
def lalinference.bayespputils.KDTreeVolume.split_dim | ( | self | ) |
Returns the dimension along which this level of the kD-tree splits.
Definition at line 2593 of file bayespputils.py.
def lalinference.bayespputils.KDTreeVolume.bounds | ( | self | ) |
Returns the coordinates of the lower-left and upper-right corners of the bounding box for this tree: low_left, up_right.
Definition at line 2600 of file bayespputils.py.
def lalinference.bayespputils.KDTreeVolume.volume | ( | self | ) |
Returns the volume of the bounding box of the tree.
Definition at line 2606 of file bayespputils.py.
def lalinference.bayespputils.KDTreeVolume.integrate | ( | self, | |
f, | |||
boxing = 64 |
|||
) |
Returns the integral of f(objects) over the tree.
The optional boxing parameter determines how deep to descend into the tree before computing f.
Definition at line 2618 of file bayespputils.py.
def lalinference.bayespputils.KDTreeVolume.operate | ( | self, | |
f, | |||
g, | |||
boxing = 64 |
|||
) |
Operates on tree nodes exceeding boxing parameter depth.
Definition at line 2630 of file bayespputils.py.
def lalinference.bayespputils.KDTreeVolume.search | ( | self, | |
coordinates, | |||
boxing = 64 |
|||
) |
takes a set of coordinates and searches down through the tree untill it gets to a box with less than 'boxing' objects in it and returns the box bounds, number of objects in the box, and the weighting.
Definition at line 2641 of file bayespputils.py.
def lalinference.bayespputils.KDTreeVolume.fillNewTree | ( | self, | |
boxing = 64 , |
|||
isArea = False |
|||
) |
copies tree structure, but with KDSkeleton as the new nodes.
Definition at line 2652 of file bayespputils.py.