Victor R. Volkman received a BS in Computer Science from Michigan Technological University. He has been a frequent contributor to The C Users Journal since 1987. He is currently employed as Senior Analyst at H.C.I.A. of Ann Arbor, Michigan. He can be reached by dial-in at the HAL 9000 BBS (313) 663-4173 or by Usenet mail to [email protected]
Of course, the CUG does not claim to be the exclusive distributor of anything in its library. This means that these archives are frequently available from many online sources, including FTP servers, Compuserve, and dial-up BBSes. These online sources often have older versions or sometimes just patches. What CUG guarantees is that each archive is completely intact, and fully authorized for distribution.
- C++SIM (CUG#394): Simula-style class libraries for discrete event process based simulation.
- Input-Edit, SORTLIST AVL, and Typing Tutor (CUG #395): multi-platform user-input line editor, AVL balanced binary tree, and typing instructor for Curses
- NNUTILS (CUG #396): neural net source library & tutorial
C++SIM uses inheritance throughout the design to an even greater extent than already provided by Simula. C++SIM's use of inheritance allows you to add new functionality without affecting the overall system structure. Thus, C++SIM provides for a more flexible and expandable simulation package.
C++SIM provides the following classes: Process, ProcessList, ProcessIterator, ProcessCons, Random, Element & Head, thread, lwp_thread, and gnu_thread.
C++SIM includes a 20-page paper entitled "Construction and Use of a Simulation Package in C++." This paper is available in PostScript format only. The paper describes the class hierarchy itself as well as how to further refine the simulation package.
The simulation package requires a threads package and currently works only with the Sun lightweight process library or the included GNU thread package. The thread library is the only system-specific code, so porting the remainder of the code to other UNIX workstations should be easy. C++SIM compiles with Cfront 2.1 and Cfront 3.0.1 and GNU g++ 2.3.3
The C++SIM license grants permission to use, copy, modify, and distribute the program for evaluation, teaching and/or research purposes only and without fee. The University of Newcastle upon Tyne copyright and permission notice must appear on all copies and supporting documentation, and similar conditions are imposed on any individual or organization to whom the program is distributed.
Other packages, such as GNU's readline, have greater capability but are also substantially larger. Input-edit is small (1200 source lines) and quite portable because it uses neither stdio nor any termcap features. For example, Input-edit only uses \b to backspace and \007 to ring the bell on errors. Since Input-edit cannot edit multiple lines, it scrolls long lines left and right on the same line.
Input edit is written in K&R C and can run on any UNIX system (BSD, SYSV or POSIX), AIX, and XENIX, as well as non-UNIX systems such as MS-DOS with MSC, Borland Turbo C, or djgpp, OS/2 with gcc (EMX), and DEC VAX-11 VMS. Porting Input-Edit to new systems consists mainly of altering the package's character read function to read a character when it is typed without echo.
1. All elements are of a single fixed size.
2. Each element is associated with a unique key value.
3. The set of key values has a well-defined "less than, greater than" relation.
Symbol tables and dictionary applications are excellent candidates for the sorted list data structure. This implementation of a sorted list data structure employs an AVL tree. AVL trees were invented by Adelson-Velskii and Landis in 1962. Specifically, Karas draws on algorithms presented by Horowitz and Sahni in Fundamentals of Data Structures (Computer Science Press). The add, find, and delete operations on an AVL tree have worst-case O (n) time complexity. SORTLIST version 1.1 (released 8/25/93) is now available on CUG volume #395.
Each NNUTILS subdirectory contains a different example application with six standard C source files and a main program. The source is written in ANSI-compliant C and developed primarily under Borland C++ 3.1. Accordingly, the CUG distribution includes DOS executables and project files for each implementation. Because the code is ANSI compliant, all of the examples work with GNU C under UNIX. Building executables with GNU C is simple enough without makefiles, so none are included.
Briefly, here's a summary of problem sets included with NNUTILS:
- NNTEST1: A network with one input node and one output node.
- NNTEST2: A network using the "logistic" activation function (as opposed to a linear function).
- NNXOR: A network implementation of the famous Exclusive-Or problem.
- NNSIM1: A generic feed-forward network with back propagation.
- NNWHERE: A 5x5 retina is presented with shapes it must classify correctly.
- NNWHAT: A continuation of above where shapes can assume any position.
- NNEVOLVE: A feed-forward, back-propagation supervised net.
- NNSIM2: Simulates a competitive learning network with a Hebbian learning algorithm.
- NNRECUR1: A recurrent net with back propagation, and a kind of supervised learning called Self-Correlating, where the input patterns serve as their own output patterns.
References MacLennan, Bruce J., Principles of Programming Languages: Design, Evaluation, and Implementation. New York: H.H. Rhinehart, and Winston. 1983.