Re: Boost library inclusion: generic tree containers?

Since the interest level in a generic tree library seems to be high, below is a link to an incomplete tree library/type constructor framework I have been tinkering with. It, perhaps foolishly, tries to present the building blocks for the construction of a large set of different tree types with different balancing and book-keeping requirements. Keep in mind it is not complete, some of the balancing schemes need to be checked, it has no workarounds for broken compilers and for the most part only basic/range insert have been implemented (erase is just a placeholder) http://24.221.194.82:8080/src/trees/index.html There are a number of meta programming techniques used in the library, including execute_if which i brought up in a separate thread, the techniques link via the above link describes a few of them (template parameter mapping, execute_if etc). http://24.221.194.82:8080/src/tc/index.html The above is a start at defining some of the terms and concepts used in type constructors/builders/computers, once meaningful terms are agreed upon the tree documentation will change to use the new terms. Stroustrup on a generic binary tree library: Matt Austern, Bjarne Stroustrup, Mikkel Thorup, and John Wilkinson: Untangling the Balancing and Searching of Balanced Binary Search Trees. Software - Practice & Experience. Vol 33, Issue13. October 2003 (google only has a link to the example code in this paper) Stroustrup on binary tree iterators: http://portal.acm.org/citation.cfm?id=268114 Feedback is appreciated, -Jeff Mirwaisi

On Wed, Feb 23, 2005 at 05:42:12AM -0800, Jeff Mirwaisi <jeff_mirwaisi@yahoo.com> wrote:
It, perhaps foolishly, tries to present the building blocks for the construction of a large set of different tree types with different balancing and book-keeping requirements.
I would like to comment on the possiblities of that library. I already investigated the implementation of jeffs library a few weeks ago. From a very distant view point jeff does aspect oriented programing with c++ templates. All features are implemented using aspects or mutators that modifiy the result of the previous modifications ( the order is important, and maybe still a design issue ). To present the flexibility of that library, I would like to present a case study. At the time of my first deep look, I was looking for a tree type that efficiently stores a set of integers, and usually many of these integers are adjacent. std::set needs a node for every integer, a better solution would be to store ranges of integers in each node. It is really simple to create the merge and split functions needed when inserting and deleting elements is quite easy for these ranges. But as soon as you start adding things like balancing, the code gets really complex. Here is where Jeffs library makes everything simpler, balancing is already implemented, so you just need to hook into the insertion and deletion process of a balanced binary tree, with a pair as key/value type. These hooks can be added by defining typedefs ( so called tags, in the terminology of the library), which notify the fact that there exisits an insertion/deletion hook in the mutator. The provided features are really generic, it is for example possible to redefine the link type, which might be a simple pointer to a node by default. E.g if you try to write a B*-tree for large datasets, you do not want to load the complete tree into the memory, you just want to load a single node at once. So by turning the linktype into a special pointer type you can load parts of the data on demand. boost::rel/rtl could use that library to implement file based tables, by defining a mutator, that turns the plain pointer into a lazy pointer, and a mutator that implements the load and save methods for boost::serialization integration. So I really would like to see that library in boost. From all tree templates I have seen yet, this one is the only one that does not block the developer in any aspect. Maybe we should consider implementing other containers using the techniques presented by Jeff. Regards Andreas Pokorny

"Jeff Mirwaisi" <jeff_mirwaisi@yahoo.com> wrote in message news:20050223134212.28889.qmail@web61002.mail.yahoo.com...
It, perhaps foolishly, tries to present the building blocks for the construction of a large set of different tree types with different balancing and book-keeping requirements.
Hi Jeff - I've started looking through your documentation and design but haven't finished yet. Unfortunately, to truly digest what you're doing, I'm going to have to wait until this weekend. I just wanted to let you know I plan on looking through it thoroughly as soon as I get a chance. That being said, if you have time, I'd be curious to know your thoughts on the direction of the other posts regarding tree structure (Thorsten/Richard) and perhaps a short example on how your tree might be used as a base tree to solve two fundamentally different goals: trees for containment and trees for algorithms. I'll try to get a look-see on your tree implementation as soon as possible, =) Justin
participants (3)
-
Andreas Pokorny
-
Jeff Mirwaisi
-
Justin Gottschlich