Name : perl-Tree-Interval
| |
Version : 0.3.2
| Vendor : obs://build_opensuse_org/devel:languages:perl
|
Release : lp154.1.1
| Date : 2023-01-27 18:44:19
|
Group : Development/Libraries/Perl
| Source RPM : perl-Tree-Interval-0.3.2-lp154.1.1.src.rpm
|
Size : 0.02 MB
| |
Packager : https://www_suse_com/
| |
Summary : Perl implementation of an interval tree
|
Description :
This is a perl implementation of an interval tree for non-overlapping intervals, based on Tree::RedBlack by Benjamin Holzman < bholzmanAATTearthlink.net>. An interval tree is a binary tree which remains \"balanced\" i.e. the longest length from root to a node is at most one more than the shortest such length. It is fairly efficient; no operation takes more than O(log(N)) time.
A Tree::Interval object supports the following methods:
* _Tree::Interval->new()_
Creates a new Interval tree object.
* _root()_
Returns the root node of the tree. Note that this will either be _undef_ if no nodes have been added to the tree, or a Tree::Interval::Node object.
* _cmp(coderef)_
Use this method to set a comparator subroutine. The tree defaults to builtin Perl numerical comparisons. This subroutine should be just like a comparator subroutine to _sort_, except that it doesn\'t do the $a, $b trick; the two elements to compare will just be the first two items on the stack. For example,
sub example_comparator { my ($ka, $kb) = AATT_; return $ka < => $kb; }
* _insert(low, high, value)_
Adds a new node to the tree. The first two arguments are an interval which forms the key of the node, the third is its value and may not be _undef_. Overlapping or duplicate keys are an error. Errors are handled using _die_. Nothing is returned.
* _min()_
Returns the node with the minimal key.
* _max()_
Returns the node with the maximal key.
* _find(key)_
Searches the tree to find the node whose interval contains the given _key_. Returns the value of that node, or _undef_ if a node with that key isn\'t found.
* _values()_
Returns a list of all the node values.
|
RPM found in directory: /packages/linux-pbone/ftp5.gwdg.de/pub/opensuse/repositories/devel:/languages:/perl:/CPAN-T/15.4/noarch |