swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

AVLSet test programs available (was Re: need some house keeping advice


From: Paul Johnson
Subject: AVLSet test programs available (was Re: need some house keeping advice
Date: Thu, 14 Sep 2000 17:01:51 -0500

"Marcus G. Daniels" wrote:
> 
> If you symlink the whole directory and cd into that then you are in
> that directory, and a commit there will do the right thing.

OK, I think I have it working.  The VPATH command in the Makefile tells
it where to look for source files that are not in the current directory. 

I have been eager to learn more about data structures and I've been
pursuing that by trying to enhance Swarm's Set and OrderedSet classes by
using the AVL tree library that is in Swarm's misc directory.  I'm using
these AVL based collections right now in several projects, and so I was
asking my house keeping question about how to keep things organized.

I now have 2 classes, AVLSet, based on avl_tree, and AVLTRSet, based on
avltr_tree. 
These classes will work as drop in replacements, and they can create
indexes and do all the usual things that Swarm collections do.  They
should offer considerably faster performance, however, than the Swarm
Set and Ordered Set.  Well, if you try it, let me know. I'd like to make
special thanks to Ben Pfaff, the AVL_Tree author, who provided the code
and helped me at several junctures in this exercise.

If you download the package:

http://lark.cc.ukans.edu/~pauljohn/Swarm/MySwarmCode/AVLTest.tar.gz

you will get two test programs in two directories, avl and avltr, and in
each there is a directory called Classes/AVL where the AVL classes of
mine are copied. (duplicated, sorry).

If you have Swarm-2.1.1, you can only use the AVLSet, because the
avltr_tree.h is not in that swarm. However, if you have the newest
devel-Swarm (my RPM or your own) then you can try the AVLTRSet.  

The right threaded tree (avltr_tree) has some advantages when it comes
to finding the next item and deleting items without damaging an index
that is defined on the tree.  

These classes have, as far as I can see, virtually full compliance with
the Swarm collections library commands.  As the demo programs show,they
can add, find, delete, spawn indexes, and so forth.  They don't do
totally everything because they are currently subclassed from
SwarmObject, because the Swarm library blocks me from subclassing from
Collections_any (at least I think it does, it seems to) so I can't make
a total test yet.  When I get some time, I will ask Marcus to help me
test these classes in the Swarm library itself, i.e., to make the Set
and OrderedSet classes subsets of AVLTRSet.  I don't understand some
details in the swarm library yet,but I will.

If you want, you can inspect these programs in their one-giant-file of
WorkingExampleCode format:

http://lark.cc.ukans.edu/~pauljohn/SwarmFaq/WorkingExampleCode/objc/avlusage3.m
http://lark.cc.ukans.edu/~pauljohn/SwarmFaq/WorkingExampleCode/objc/avlusage4.m

I cannot describe what frustration was involved in this, but now I
understand pointers so much more clearly I can almost describe them to
students :)

-- 
Paul E. Johnson                       email: address@hidden
Dept. of Political Science            http://lark.cc.ukans.edu/~pauljohn
University of Kansas                  Office: (785) 864-9086
Lawrence, Kansas 66045                FAX: (785) 864-5700

                  ==================================
   Swarm-Support is for discussion of the technical details of the day
   to day usage of Swarm.  For list administration needs (esp.
   [un]subscribing), please send a message to <address@hidden>
   with "help" in the body of the message.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]