# BH2.1

## An Implementation of the Bestvina-Handel Algorithm

UPDATE Dec 27, 2002: The code bh21_2002.tar has a few modifications to allow it to compile with g++ version 3.2.
It also fixes an error in line 36 of Set.H:

    //const default_block_size=5;
    const int default_block_size=5;

The tar file will unpack into a directory BH2.1_2002. cd into that directory and type "make" to build the executable "stepBH". See the documentation in the file "README".

Here is the (now superseded, older) code, bh21.tar.

When you have downloaded the tar file, "tar xvf" it, and see the README file in the directory BH2.1.

6/28/99: Please note that the scope rule for "for" loops has changed with the new ANSI draft standard for C++. If your compiler conforms to this standard, you will have to set some flag so that it will compile the following:

    int main()
    {	for(int i=0; i<7; ++i ) {}
    	for(    i=0; i<7; ++i ) {}
    	return 0;
    }

For Sun WorkShop Compilers 5.0, the flag is "-compat". The new SGI MIPSpro Compilers, Version 7.2.1, actually require you to specify "-LANG:ansi-for-init-scope=on" to get the new scope rule, so no change is necessary.

11/12/99. Note from Nathan Dunfield: The code will compile under gcc 2.95.* if you use the command:

    g++ -fguiding-decls -fno-for-scope -o testBH stepBH.c

(The flag -fno-for-scope deals with the variable declaration inside for loops problem. The flag -fguiding-decls is needed to for lines such as: Set.H, Line 75: class ostream & operator <<(ostream &, const Set &); which is no longer ANSI compliant.).

We are very eager to hear of, and fix, any bugs you detect. Please send bug reports, and any questions or comments you might have, to ringland@acsu.buffalo.edu.

Please also send mail to ringland@acsu.buffalo.edu if you would like to be informed about bugs, bug fixes, and other updates. Otherwise, it would be advisable to check this page again from time to time. Here is the record of updates.

The code can be compiled succesfully using the current native C++ compilers (CC) of Sun and Silicon Graphics. (The Gnu compilers (g++) earlier than 2.8.1 will not work because of the way they implement templates.)

We gratefully acknowledge that this work was supported in part by the AFSOR and the Center for Automation Research at the University of Maryland, and NSF grant No.DMS 9200881.

Last updated 5/24/96.