OBJECT-ORIENTED PROGRAMMING Sather Provides Nonproprietary Access to Object-Oriented Programming

Stephen M. Omohundro

Sather supports strong typing, garbage collection, object-oriented dispatch, multiple inheritance, and parameterized types

odern scientific com­ ware components. More and more oped to meet the needs of research puting is placing ever models use complex graph-based projects at the International Comput­ more stringent re­ structures such as neural networks er Science Institute (lCSI) , which quirements on the au­ for some portion of the representa­ required a simple, efficient, nonpro­ thors of scientific code, tiop. These tasks are far more like prietary, object-oriented language. and on the languages general-purpose computing than tra­ ICSI is involved in several areas that and programming environments that ditional scientific computing. The require the construction of complex they use. At one time, most scientists appropriate software tools are corre­ software for computationally inten­ were happy with systems that could spondingly more like the tools devel­ sive tasks. Examples include a gen­ efficiently execute relatively simple oped for general-purpose tasks. eral-purpose connectionist simulator, repetitive operations on fixed-sized Object-oriented programming a high-level vision system based on arrays. The tools appropriate for that has been one of the most notable complex geometric data structures, task are woefully inadequate for the recent developments in modern pro­ the support software for a high-speed challenges posed by the computa­ gramming languages. Unfortunately, paranel computing engine for speech tional sophistication of recent algor­ it is often associated with reduced recognition, and CAD tools for inte­ ithms for scientific computing. computational efficiency, and so has grated-circuit design. Such challenges take many not seemed appropriate for scientific We investigated several existing forms. For example, modern finite­ computing. This article describes a languages, including ++,6 Objec­ element code must adaptively change new language, "Sather," which was tive C,7 Eiffel,4,s Self,S Smalltalk,9 the structure of the underlying grid, designed to retain the powerful bene­ and CLOS.IO Only C++ was effi­ dynamically adding and deleting fits of object-oriented programming cient enough for our needs, but its nodes during a computation. Com­ without sacrificing efficiency.I,2,3 overall complexity and lack of gar­ plex geometry algorithms are re­ Sather was derived from the bage collection, object type tags quired for efficient manipulation and language Eiffel,4,5 and is designed to (needed for persistency and object visualization of geometric structures. be very efficient and simple, while distribution), and parameterized Modern nonlinear optimization tech­ supporting object-oriented dispatch, types, led us to begin our work with niques utilize many interacting soft- strong typing, mUltiple inheritance, Eiffel. Our experience with Eiffel parameterized types, garbage collec­ allowed us to identify the features Stephen M. Omohundro is a research scientist at The International Computer Science Institute. tion, and a clean syntax. Each of these that were essential for our purposes. 1947 Center Sr.. Suite 600. Berkeley, CA 94704; aspects will be described in turn in We required a nonproprietary com­ e-mail: [email protected]. this article. Sather was initially devel­ piler, however, to serve as a base for

444 COMPUTERS IN PHYSICS. VOL 6. NO.5. SEP/OCT 1992 Physics Academic - develeping a parallel object-oriented classes. This can simplify the debug­ language to run on new experimental ging process tremendously, and lead Software parallel hardware. to far greater reliability. Sather was developed to incorpo­ It is important to understand the PEER-REVIEWED rate the features of Eiffel that were benefits that object-oriented pro­ EDUCATIONAL SOFTWARE essential to us as well as others aimed gramming gives over traditional sub­ Published by the American Institute of Physics at enhancing efficiency and simpli­ routine libraries, which also aim to in cooperation with city. The initial Sather compiler was support reuse. A subroutine library American Physical Society written in Sather over the summer of makes it easy for newly-written code American Association ofPhysicB Teachers 1990. The compiler generates porta­ to make calls on old code, but does ble C code and links easily with not make it easy to get old code to call SCOIEDISIWUIIO! existing C code. In June 1991, ICSI new code. For example, one might made the language publicly available write a visualization package that by anonymous FTP over the Internet displays data on a certain kind of (from."ftp.icsLberkeley.edu" in the display by making calls on display United States, "ftp.gmd.de" in Eu­ interface routines. At some later time, rope, "lynx.csis.dit.csiro.au" in Aus­ one wishes to have the package tralia, and "sra.co.jp" in Japan). The display its output on a new kind of release includes documentation, a display. Without an object-oriented compiler, a symbolic debugger, a approach there is no easy way to get GNU emacs programming environ­ the previously written visualization ment, and several hundred library routines to make calls to the new GRADEBOOK classes. Within a few weeks of the display interface. release, several hundred research Another example might be a Russell A. Stevens groups from around the world had system that makes use of a matrix to obtained copies. Since that time new hold information. One might later GRADEBOOK provides class development has become an decide to use a sparse representation teachers with a fast, convenient international cooperative effort. for the matrix, and want to avoid way to record student scores and having to rewrite all the code that Why Object-Oriented Computing? compute grades automatically. operates on the matrix. In each of Some of the options are plus-or- . The primary desired benefit from these examples one. might want the minus grading, weighting scores object-oriented languages is the abi­ code sometimes to operate on one in up to ten categories, handling lity to effectively reuse code. In type of display or matrix, and some­ incomplete grades, granting extra Sather, one writes a program as a times on the other. In fact, the actual collection of modules called kind of display or matrix may not be credit, dropping low scores, and "classes." Each class should encapsu­ known until the calls are made. issuing interim reports. late a well-defined abstraction. If We use the term "object-orient­ The program can combine classes these abstractions are chosen careful­ ed dispatch" to refer to this late when calculating distributions ly, they can be used in a variety of choice of which code to actually and display the result in histo­ situations. For example, the Sather execute. In Sather, each class defines library has a vector class that encap­ the structure of corresponding "ob­ grams. Scores can be organized sulates the common operations on jects." The class corresponding to an on summary sheets or as indi­ vectors (e.g., addition, dot product, object defines its "type." Objects are vidual records for students. tensor product, etc.). An obvious chunks of memory that are dynami­ Includes 58-page User's Manual. benefit is that less code needs to be cally allocated while the program is written for an application if it can use running, and which h~lVe a set of For the IBM PC classes that have already been writ· routines associated with them. These ten. An even more important benefit routines form the "interface" to the is that the resulting code is often object, and are defined in its corre­ $149.95 with a ten-copy site license better written, more reliable, and sponding class. For example, the class $39.95 for members of AlP Member easier to debug. This is because DISPLAY_l might have an interface Societies programmers are willing to put more defined by the routines draw_line care and thought into writing and and draw_circle. Any code that debugging code that will be used in performs actions on an object of this TO ORDER many projects. In a good object­ type must do so via these routines. Order using Visa, MC, AmEx, check, or oriented environment, programming We might later define a class DIS­ institutional PO. Specify 3.5" or 5.25" format. should feel like gluing together pre­ PLAY_2 that also defines the routines S/H $3.50 for first item ($7.50 foreign) and $.75 existing building blocks to perform draw_line and draw_circle, but for each additional item. for a different kind of display. A TASL new functions. In such a setting one Box 8202, NCSU • Raleigh, NC 27695-8202 can be confident that most bugs will variable disp can be declared to hold lie in the 10% or so of newly-written objects of either of these types. Call Toll-Free (800) 955-TASL (919) 515-7447/FAX (919) 515-2682 code, and not in the 90% of the code When a call like disp.draw made up by well-tested library _1 ine is made, the actual type of the Ask for details of AlP's SATISFACTION GUARANTEE Circle number 11 on Reader Service Card

COMPUTERS IN PHYSICS, VOL. 6, NO.5, SEP/OCT 1992 445 object held in disp is checked, and descendant of VECTOR in the hierar­ many object-oriented language~, ob­ the appropriate choice of draw chy. Object-oriented dispatching is jects of these types have tags or tag _line code is chosen to execute. This only performed on the second kind of bits that specify their type. At run­ provides wonderful flexibility, be­ declaration. When the type is precise­ time, extra tag-checking code must cause one can cause new code to be ly specified, the compiler generates run in addition to any operations called by old code by defining a new direct calls, which are exactly as performed on the objects. This is nice class with the same interface as an efficient as corresponding C code from the point of view of conceptual existing class. Unfortunately, it re­ would be. purity, but is simply not acceptable duces computational efficiency be­ The Sather compiler is itself a for the performance goals of Sather. cause the code must check an object's large program written in Sather, and In Sather, objects declared to be of type and use· that to select the uses a lot of dispatching. Each of the these basic types are guaranteed to instructions to execute. Sather uses nodes in the Sather code trees uses actually hold them. This allows the several techniques to minimize the dispatching on its children (e.g., each compiler to generate code with no tag cost of this checking. type of statement and each type of checking. In addition to saving the expression is represented by a sepa­ cost of the check, it allows the wide Why Strong Typing? rate object type). The performance variety of optimizations that modern In languages like Smalltalk, any vari­ consequences of dispatching were compilers provide. Much scientific able can hold any object. In Sather, studied by comparing a version in computing code intensively computes every variable is declared to be of a which all references are dispatched to with such types, and in Sather the specific type, and this declaration the standard version. II The use of result is as efficient as in C. restricts the objects that can be held explicit typing causes an 11.3% re­ by the variable. There are both con­ duction in execution time and ap­ Why Multiple Inheritance? ceptual and computational benefits to proximately one-tenth the number of Many object-oriented languages sup­ this. It helps the compiler to generate dispatches. port only "single inheritance," which efficient code, because it puts restric­ The Sather type. system is strong­ means that each class can have only tions on what can occur during er than that of most languages, be­ one direct parent in type hierarchy. execution. It helps the programmer, cause it allows more distinctions to be Natural types in the world, however, because it provides a conceptual specified. It therefore has more ofthe are more complex. The hierarchy of structure for organizing and under­ benefits and pitfalls of strong typing. sets of object is typically a "directed standing the code. The declared type Strong typing offers not only compu­ acyclic graph" (DAG), in which of a routine argument delimits what tational efficiency, but also concep­ classes can have more than one direct values may be legally passed. All tual advantages. The compiler is able ancestor. For example, in a simula­ Sather classes are organized into a to perform stronger type checking, tion task one might have a class for hierarchy, and this hierarchy is used and so catches errors that would not CHARGED_OBJECTS, which defines a to determine which objects a variable be caught with weaker typing. It also variable for the charge, and one for can hold. A class is called a "descen­ allows Sather classes to be structured MOVING_OBJECTS, which defines a dant" ofanother class ifit lies below it in ways that more naturally reflect variable for the velocity. Because in the class hierarchy. the represented concepts. ELECTRON objects are both charged The Sather is even For example, a simple two-di­ and moving, they naturally descend stronger than those of other strongly mensional geometry system might from both classes. We would like to typed object-oriented languages. In have a .class POLYGON with descen­ be able to apply to electrons all code most languages, if a variable is de­ dants TRIANGLE and SQUARE. It that works on charged objects, as well clared to be of type T, it can legally might be important for the POLYGON as all code that applies to moving hold any object for which the type is a class to define a routine add_ver­ objects. If one is restricted to single descendant OfT in the type hierarchy. tex, which increases the number of inheritance, one would either have to This is often very useful in that it sides by one. Such a routine is not require that all charged objects move allows new subtypes to be defined and appropriat-e for the descendant classes or that all moving objects have a acted upon by existing code. It also TRIANGLE and SQUARE, because charge. In Sather, each class can introduces computational inefficiency they have a fixed number of sides. In inherit from an arbitrary number of and conceptual ambiguity. There are Sather, these classes can undefine this other classes. many situations in which the type of inherited routine. If a variable de­ object that a variable can hold is clared to be a POLYGON could hold a Why Parameterized Types? precisely known by the programmer. TRIANGLE at runtime, the compiler One central feature of the Sather Sather allows one to distinguish could not check the possible applica­ design is the use of parameterized between variables that can only hold tion of the illegal routine add_ver­ classes. These are classes with one or objects of a particular type and. tex to a TRIANGLE object. Because more type parameters for which val­ variables that can hold any descen­ Sather allows one to declare variables ues are specified when the class is dant of a declared type. The declara­ that can only hold POLYGON objects, used. For example, the array class is tion v: VECTOR means that the vari­ add_vertex may be'applied to them declared as ARRAY{T}. When used, able v can only hold objects of type with complete safety. however, the type variable T is speci­ VECTOR. The declaration v: $VEC­ This distinction is also relevant fied to be the type contained in the TOR means that the variable v can to the basic types representing inte­ array. Thus, ARRAY{INT} declares an hold objects of type VECTOR or any gers, characters, real numbers, etc. In array of integers and ARRAY{STR}

446 COMPUTERS IN PHYSICS, VOL. 6, NO.5, SEPtOCT 1992 Physics Academic .. declares an array of strings. Parame­ designed to generate far less garbage terization supports a very common than is typical in languages such as ~l:!ftware and important form of reuse. In Small talk or Lisp. conjunction with Sather's strong typ­ PEER-REVIEWED ing it causes no increase in perfor­ The Implementation EDUCATIONAL SOFTWARE mance overhead. The Sather compiler was itself written Published by the American Institute of Physics To achieve this high perfor­ in Sather by Chu-Cheow Lim, and in cooperation with mance, it was decided to generate has been operational for about two American Physical Society separate code for each instantiation of years. It compiles into C code and is American Association of Physics Teachers a parameterized class. This allows the therefore easily portable to a wide code to compile in the targets of calls. variety of machines. The implementa­ The increase in the size of the code tion is described in detail in Ref. 13. It does not appear to be substantial. is a fairly large program with about Typically, there are a few small 30,000 lines of code in 183 classes. classes such as LIST{T} that cause (This compiles into about 70,000 the generation ofmany instantiations, lines of C code.) As such, it provides but most classes are not so replicated. a very nice example on which to test The compiler determines the minimal out concepts for structuring large set of self-consistent instantiations programs. required. It also recognizes instantia­ The authors of Ref. II extensive­ tions which are only used for class ly studied the performance of the inheritance, and does not generate Sather compiler on both the MIPS PHYSICS corresponding code. and Sun Sparc architectures. Because SIMULATION the Sather compiler uses C code as an Why Garbage Collection? intermediate language, the quality of PROGRAMS.,A The languages derived from C are the executable code depends on the typically not "garbage collected." match of the C code templates used Robert H. GoodV This means that the programmer is by the Sather compiler to the optimi­ California State U.-Hayward responsible for explicitly creating and zations employed by the C compiler. destroying objects. Unfortunately, Compiled Sather code runs within PHYSICS SIMULATION these memory-management issues of­ 10% of the performance of hand­ PROGRAMS is a set of eight ten cut across the natural abstraction written C code on the MIPS machine, independent programs that help boundaries. Usually, the objects in a and is essentially as fast as hand­ introductory physics students class do not have enough information written C code on the Sparc architec­ learn about wave motion, chain to determine when they are no longer tures. On a series of benchmark tests referenced, and the classes which use (including examples such as Towers reactions, Maxwell's demon, those objects should not be bothered of Hanoi, 8 Queens, etc.) Sather radiation from accelerating with low-level memory-allocation is­ performed slightly better than C++ charges, and the optics of light sues. In addition, memory manage­ and several times better than Eiffel. through a thin lens The programs ment done by the programmer is the are suitable for lectures or source of two of the most common 'rhe Libraries nonstructured, exploration­ kinds of bug. If a programmer inad­ The Sather libraries currently contain oriented, individual study at vertently frees up the space for an several hundred classes, and new ones various levels. object which is still being referenced, are continually being written. Even­ a later call may find the memory in an tually, we hope to have efficient, well­ Includes 54-page User's Manual. inconsistent state. These so-called written classes in every area of com­ Far the IDM PC and Apple II "dangling pointers" are often difficult puter science. The libraries are cov­ pilckage includes both versions to track down, because they frequent­ ered by an unrestrictive license, ly cause errors in code which is far which encourages the sharing of soft­ removed from the offending state­ ware and crediting of authors, with­ $149.95 with a ten"copy site license $39.95 for members of AlP Member ment. The second error is to forget to out prohibiting use in proprietary and Societies free up the space occupied by objects commercial projects. Currently, there that are no longer referenced. This are classes for basic data structures, causes "memory leaks," in which a numerical algorithms, geometric al­ TO ORDER program uses up more and more gorithms, graphics, grammar manip­ Order using Visa, MC, AmEx, check, or memory until it crashes. This kind of ulation, image processing, statistics, institutional PO. Specify 3.5" or 5.25" format. error is also difficult to find and track user interfaces, and connectionist S/H $3.50 for first item ($7.50 foreign) and $.75 for each additional item. down. Instead of user deallocation, simulations. TASL Sather uses a "garbage collector."12 Many interesting issues have Box 8202, NCSU • Raleigh, NC 27695-8202 This feature automatically tracks arisen in the design of efficient and down unused objects and reclaims the widely usable abstractions. We will Call Toll-Free (800) 955-TASL (919) 515-7447IFAX (919) 515-2682 space they use. To further enhance describe two sets of classes that are performance, the Sather libraries are relevant to scientific computing. The Ask for details of AlP's SATISFACTION GUARANTEE Circle number 12 on Reader Service Card

COMPUTERS IN PHYSICS, VOL. 6, NO.5, SEP/OCT 1992 447 first represents mappings from one toys to build up arbitrarily complex vided. In addition, like vector maps, a vector space to another. Examples of maps which still obey the defining variety of combining classes is pro­ such mappings are those produced by interface. vided to construct new generators. connectionist networks, linear least­ We found a similar approach to Examples include classes that gener­ squares fitters, and statistical nonlin­ be useful in the random-number gen­ ate new samples by summing the ear regression techniques. In the eration classes. We wanted a class outputs of two generators modulo 1 Sather library, each of these classes RANDOM which could produce ran­ and classes that form new generators inherits from the class VECTOR_MAP. dom samples from a variety of differ­ by randomly permuting the outputs . This class defines the interface for ent probability distributions (e.g., of other ones. such operations as determining the normal, binomial, gamma, Poisson, dimension of the input and output geometric). Such samples are gener­ The Future spaces, computing the image of a ally produced by manipulating sam­ In this article, we have described vector under the mapping, and mis­ ples from an underlying generator aspects of the design and implementa­ cellaneous operations such as com­ that produces real valued random tion of Sather,· and how they are puting the mean square error for a set samples uniformly distributed in the related to the· goals of achieving code of training examples. unit interval. There are often differing encapsulation, reusability, efficiency Once such an abstraction is de­ requirements for such an underlying and portability. The Sather language fined, there are a whole set of "func­ generator, however. For most appli­ provides powerful features such as torial" combining classes which may cations, speed considerations domi­ parameterized classes and object-ori­ be defined to construct more complex nate, and a linear congruential gener­ ented dispatch, which are essential to maps. For example COMPOSITION ator is sufficient. achieving code encapsulation and re­ _VECTORMAP{Ml, M2} represents the For certain critical applications, usability. The language is small, sim­ mapping which is a composition of however, we do not care so much ple, and efficient. As we continue two maps of types Ml and M2. about speed, but we do require ex­ actively to develop classes and lan­ Another class PRODUCT_VECTOR tremely high-quality samples. We guage tools, important new class _MAP{Ml , M2} forms the product of therefore structured the library abstractions become apparent. The two maps, while SUBSET_VECTOR classes so that objects of type RANDOM current distribution includes X Win­ _MAP maps a vector to a permutation have an attribute of type RANDOM dows user interface classes and··· a of. some of its components, and _GEN, which holds the underlying symbolic debugger. We are working CONSTANT _VECTOR_MAP represents generator. This is dispatched to re­ on higher-level user-interface abstrac­ a constant output vector. These trieve uniform random variates. A tions and extended language tools classes may be combined like Tinker- variety of basic generators is pro­ such as an interpreter.

PHYSICS OF CLIMATE THE MOST COMPREHENSIVE AND CONTEMPORARY LOOK AT CLIMATE AS AN INTEGRATED PHYSICAL SYSTEM The global upper air network. ..satellite data ...nonlinear mathematical models .... Using the tools that have breathed new life into the study of ~limate, this ground break­ ing work demonstrates how environmental phenomena worldwide interact in a single unified system. With more than 220 drawings, charts, and graphs, PHYSICS OF CLIMATE offers you the best current understanding of the Earth's climate svstem. ,.~ -- ~ , ~)-X;~ :;t;", "A superb reference .... Belongs on the shelf ofanyone .f/ \ I seriously interested in meteorology an~ climatology." !~! "<: \~ -Curt Covey and Karl Taylor, PhySICS Today Ifr.f ~ ~!~l'.-- ll~ Ir------~ . For faster service call toll free 1-800-488-BOOK - --~t : To order, mail to: American Institute of Physics c/o AlDC • 64 Depot Road. Colchester, VT 05446 : PHYSICS OF CLIMATE I 0 Check enclosed (U.S. dollars only) 0 Mastercard 0 Visa American Express : I J. P. Peixoto, University of Lisbon, and Qty Edition ISBN Price Total I A. H. Oort, National Oceanic and Card No. I Cloth ()"88318-711-6 $95.00 I Atmospheric Administration I Sigl'lllfure (Required on all aedil ClIrU orders) I Paper 0-88318-712-4 $45.00 I I "A modern treatment ofthe nature Na~ I Subtotal ___ I and theory ofclimate." I In!ititutioniifappjicable) Shipping: 52.75 for lst book ($7.50 I From the foreword by Edward N. Lorenz, MIT I foreign), 5.75 for each additional book- ___ I I AMERICAN Marketing and Sales Division Canadian residents add 7% GST. ___ I INSTITUTE 335 East 45th Street I !!!PHYSICS New York, NY 10017 C'lty fS"''' 'Zip 9241 TOTAL t ------~

448 COMPUTERS IN PHYSICS, VOL. 6, NO. S, SIP/OCT 1992 Physics Academic _A.nother direction of research is version of an algorithm to be selected the further extension of the Sather according to the machine it is actually -Software language to a parallel multiprocessor running on. It is often the case that environment. The language parallel code development is done on PEER-REVIEWED "pSather,,14 is still being modified, simulators running on serial ma­ EDUCA"nONAL SOFTWARE but an initial version runs on the chines. A powerful object-oriented Published by the American Institute ofPbysics Sequent Symmetry and the Thinking approach is to write both simulator in cooperation with Machines CM-S. As described in Ref. and machine versions of the funda­ American Physical Society 15, the language adds constructs for mental classes in such a way that a American Association ofPhysics Teachers synchronization, locking variables, user's code remains unchanged when and creating and manipulating moving between them. r REAC'rIott TIME Av = 9.25 sec threads. The issues that make object­ Acknowle_gments Ii~L.LI . oriented programming important in a a.i I Ii : serial setting are even more important Many people have contributed to the s. 9 sec 9.5 in parallel programming. Efficient development and design of Sather. I 9.29 secDnds parallel algorithms are often quite would especially like to thank Subutai complex, and so should be encapsu­ Ahmad, Jonathan Bachrach, Jeff lated in well-written library classes. Bilmes, Henry Cejtin, Graham Dum­ Different parallel architectures often pelton, Richard Durbin, Jerry Feld­ requin~ the use ofdifferent algorithms man, Ben Gomes, Chu-Cheow Lim, for optimal efficiency. The object­ Franco Mazzanti, Heinz Schmidt, oriented approach allows the optimal David Stoutamire, and Bob Weiner. PHYSICS DEMOS Julien C. Sprott University of Wisconsin

PHYSICS DEMONSTRATIONS is a collection of ten computer simulations of the physics of motion and sound. Each simula­ tion models a demonstration that a physics teacher in an introduc­ tory college or high-school course might perform. You can vary parameters and freeze the action by pressing a key or clicking a mouse. Topics include reaction time, ballistics, oscillatory motion, waves, resonance, and the Doppler effect. The program can run on its own in a museum mode. Includes 62-page User's Manual.

For the IBM PC

$149.95 with a ten-copy site license $39.95 for members of AlP Member Societies

TO ORDER Order using Visa, MC, AmEx, check, or institutional PO. Specify 3.5" or 5.25" format. S/H $3.50 for first item ($7.50 foreign) and $.75 for each additional item. TASL Box 8202, NCSU • Raleigh, NC 27695-8202 Call Toll-Free (800) 955-T ASL (919) 515~7447 /FAX (919) 515-2682 Ask for details of AIP's SATISFACTION GUARANTEE Circle number 13 on Reader Service Card !IE·PHYSICS Contents III NEWS ..... 439 Object-Oriented Modeling Guides SSC DAQ Designers l­ SPECIAL FEATIlRES E OBJECT-ORIENTED PROGRAMMING 444 Sather Provides Nonproprietary Access to Object-Oriented •CD Programming U STEPHEN M. OMOHUNDRO 450 C++ Proves Useful,in Writing a Tokamak Systems Code SCOTT W. HANEY AND JAMES A. CROTINGER 456 Dynamic Accelerator Modeling Uses Objects in· Eiffel "//,,,...,""'" HIROSHI NISHIMURA

Object ( , ;-.., PEER-REVIEWED PAPERS /··/r·---" 463 Taking the generality out of general relativity R. BERNSTEIN /---1.,,--.. 469 The high-speed single-pass bin sort G. P. CANT " " , i.. , HashTable ( 472 Parametric cubic spline-fitting programs for open and closed curves D.A. SMITH : ,C·--·) "-----1 478 Multifractal scaling in a Sierpinski gasket P. Y. TONG AND K. W. YU 483 Visualizing nonlinear resonance in classical and quantum mechanics C++ Programming MARSHALL BURNS Language ... 450 494 Reaction kinetic surfaces and isosurfaces of the catalytic hydrogenolysis of ethane and its self-poisoning over Ni and Pd feature specification catalysts SANDOR KRISTYAN AND JANOS SZAMOSI ring: BITS 32 - paim 498 Space-time geometries characterized by solutions to the geodesic BPM: BPMS - BPM STRMAG: STRMAC equations KEITH ANDREW AND CHARLES G. FLEMING NoCelem: INTEGER 506 Numeric precision in FORTRAN computing ROGER W. MEREDITH -it ofcell t fitTune (nux: DOUBI 513 The quantum mechanics of a classically chaotic dissipative system -- Fit betatr' CoM. SAVAGE Tune (dir: INTEGER --Getbetat --dir=O fur setCODeps (eps: DOl DEPARTMENTS -SetCOD 441 Calendar "..tr'on {

COVER: Energy spread­ ing versus initial energy, COMPUTERS IN PHYSICS (ISSN 0894-1866 coden CPHYE2) volume 6 number 5. Published bimonthly (6 issues per year) by the American Institute ofPhysics, 500 Sunnyside Blvd., Woodbury, NY 11797. Member subscription rates: $35,00 per year; foreign, $45.00; air with color representing freight to Europe, Asia and rest of Eastern Hemisphere, $55.00. Nonmember Individual subscription rates: United States and possessions, probability, reveals non­ $45.00 per year; Canada, Mexico and rest of Western Hemisphere, $55.00; air freight to Europe, Middle East, North Africa, Asia and rest of linear resonance in Hil­ Eastern Hemisphere, $65.00 per year. Nonmember Tnstitutional subscription rates: United States and possessions, $195.00 per year; Canada, bert space of extreme Mexico and rest of Western Hemisphere, $205.00; air freight to Europe, Middle East, North Africa, Asia and rest of Eastern Hemisphere. $215.00 per year. Back numbers, single copies, $35,00. Second Class Postage Paid at Woodbury, New York, and at additional mailing offices. Stark hydrogen. Paper POSTMASTER: Send address changes to Computers in Physics Subscription Fulfillment, c/o American Institute of Physics, 500 Sunnyside begins on p. 483. Blvd., Woodbury, NY 11797. Copyright @ 1992, American Institute of Physics,

W'BPA COMPUTERS IN PHYSICS, VOL. 6, NO.5, SEP/OCT 1992 435 -. PHYSICS -l!.. •Da

LEWIS M. HOLMES Editor PHIL ROSE Art &, Production &iitor CHRISTINA BOEMIO Assistollt Editor PARAM D. BAJWA Editorial Assistant

UN MILLER. CONNIE NEDOHON Journal Melion Produdion

BEVERLY PORTER Director 0/ Physics Programs EDWARD P. GREELEY Director 0/ Advertising and Exhibits

DEPARTMENT EDITORS A. JOHN MALUNCKRODT. SUSAN R. MC KAY Book Reviews HARVEY GOULD. JAN TOBOCHNIK Computer Simulations DENIS DONNELLY Compute~ in Physics Educali011 WILUAM H. PRESS. SAUL A. TEUKOLSKY Numerical Recipes MARGARET GJERTSEN Product Ref..'iews ROBERT A. DORY SpreoJisheets ROBERT S. WOLFF Visualization

ALLEN ZEYHER Corre.ponden/

ASSOCIATE EDITORS, JOURNAL SECTION BRUCE L. BRANDT Florida Slate University MARK FISCHLER Fermi/ab ALAN H. GLASSER Los Alamos National Lobaratory HARVEY GOULD Clark University ROY LANG NEC Corporation ADVISORY COMMITTEE CHARLES W. MISNER ROBERT R. BORCHERS. Chair RICHARD MATZNER Unive,.Uy 0/ Maryland Lawrence Livermore University of Texos at Austin CUFFORD A. PICK OVER National Lohora!ary IBM Corporation JOSEPH E. LANNUTTI ELAINE.ORAN DON RAGAN Florida Stale University Naua/ Research Laboratory Wayne S/lJu University MYRON MANDELL DIETRICH STAUFFER Maxwell Laboratories JOHN S. RISLEY Cologne University S-Cubed Division North Carolina State University

EDITORIAL OFFICES EDITOR AND JOURNAL SF..cnON: PRODUCTION: ADVERTISING OFFICE American Institute of Physlcs American Institute of Physk-s American Institute of Physics 1630 Connecticut Avenue NW, Suite 750 500 Sunnyside Blvd. 140 E. 45th Street Washington. DC 20009 Woodbury. NY 11797 New York. NY 10017 Tel. (202) 745-1894 Tel. (516) 576-2200 Tel, (212) 661-9260 [email protected] TRB@AIP,ORG Telex 960 9g3 AMINSTPHYS NYK LH4@A,P.BITNET [email protected]

COMPUTERS IN PHYSICS.. VOl.. 6, NO.5, SEP/OCT 1992 437