Heath - Scientific Computing (523150), страница 10
Текст из файла (страница 10)
A comprehensive library of mathematical software; the full library is available inFortran, and a subset is available in C. See URL http://www.nag.com.• NAPACK: A collection of software designed to complement the book Applied NumericalLinear Algebra, by Hager [116]. In addition to linear algebra, also contains routines fornonlinear equations, unconstrained optimization, and fast Fourier transforms. Availablefrom netlib.• netlib: A collection of free software from diverse sources available over the Internet.See URL http://www.netlib.org, or send email containing the request “send index” tonetlib@ornl.gov, or ftp to one of several mirror sites, such as netlib.bell-labs.comor netlib2.cs.utk.edu.• NR (Numerical Recipes): A collection of software accompanying the book NumericalRecipes, by Press, Teukolsky, Vetterling, and Flannery [205].
Available in C and Fortraneditions.• NUMAL: A collection of software developed at the Mathematisch Centrum, Amsterdam.Also available in Algol and Fortran, but most readily available in C from the book A22••••CHAPTER 1. SCIENTIFIC COMPUTINGNumerical Library in C for Scientists and Engineers, by Lau [162].PORT: A collection of software developed at Bell Laboratories. Some portions are availablefrom netlib, but other portions must be obtained commercially and licensed for use. Seethe port directory in netlib for further information.SLATEC: A collection of software compiled by a consortium of U.S.
government laboratories. Available from netlib.SOL: A collection of software for optimization and related problems from the SystemsOptimization Laboratory at Stanford University. For further information, see URLhttp://www.stanford.edu/~saunders/brochure/brochure.html.TOMS: A collection of software appearing in ACM Transactions on Mathematical Software(formerly Collected Algorithms of the ACM). Available from netlib. The algorithms areidentified by number (in order of appearance) as well as by name.1.4.2Scientific Computing EnvironmentsThe software libraries just listed contain subroutines that are meant to be called by userwritten programs, usually in a conventional programming language such as Fortran or C.An increasingly popular alternative for scientific computing is interactive environments thatprovide powerful, conveniently accessible, built-in mathematical capabilities, often combined with sophisticated graphics and a very high-level programming language designed forrapid prototyping of new algorithms.One of the most widely used such computing environments is MATLAB, which is a proprietary commercial product of The MathWorks, Inc.
(see URL http://www.mathworks.com).MATLAB, which stands for MATrix LABoratory, is an interactive system that integrates extensive mathematical capabilities, especially in linear algebra, with powerful scientific visualization, a high-level programming language, and a variety of optional “toolboxes” thatprovide specialized capabilities in particular applications, such as signal processing, image processing, control, system identification, optimization, and statistics.
There is alsoa MATLAB interface for the NAG mathematical software library mentioned in Section 1.4.1.MATLAB is available for a wide variety of personal computers, workstations, and supercomputers, and comes in both professional and inexpensive student editions. If MATLAB is notavailable on your computer system, there are similar, though less powerful, packages thatare freely available by ftp, including octave (http://www.che.wisc.edu/octave), RLaB(http://rlab.sourceforge.net), and Scilab (http://www-rocq.inria.fr/scilab). Othersimilar commercial products include GAUSS, HiQ, IDL, Mathcad, and PV-WAVE.Another family of interactive computing environments is based primarily on symbolic(rather than numeric) computation, often called computer algebra.
These packages, whichinclude Axiom, Derive, Macsyma, Maple, Mathematica, MuPAD, Reduce, and Scratchpad,provide many of the same mathematical and graphical capabilities, and in addition providesymbolic differentiation, integration, equation solving, polynomial manipulation, and thelike, as well as arbitrary precision arithmetic.Because MATLAB is probably the most widely used of these environments for the typesof problems discussed in this book, specific MATLAB functions, either from the basic environment or from the supplementary toolboxes, are mentioned in the summaries of availablesoftware for each problem category, along with software from the major conventional soft-1.4.
MATHEMATICAL SOFTWARE23ware libraries. Note that MATLAB has recently added symbolic computation to its capabilitiesvia a “symbolic math” toolbox based on Maple.1.4.3Practical Advice on SoftwareThis section contains some practical advice on obtaining and using the software mentionedthroughout the book, especially for the purpose of programming assignments based on thecomputer problems at the end of each chapter.
The computer problems do not depend onany particular software or programming language, and thus many options are available. Thebest choice in a given case will depend on the user’s experience, resources, and objectives.The software cited comes from a variety of sources, including large commercial librariessuch as IMSL and NAG, public repositories of free software such as netlib, and scientificcomputing environments such as MATLAB. Many academic and industrial computing centersand workstation laboratories will have a representative sample of such software alreadyinstalled and available for use.
In any case, ample software is available free via the Internetor at nominal cost from other sources (e.g., accompanying textbooks) for all of the computerproblems in this book. Locating, downloading, and installing suitable software is useful realworld experience, and the skills learned in doing so are an important practical adjunct tothe other skills taught in this book.Perhaps the most important choice is that of a programming language. Fortran is thetraditional language of scientific computing, and the overwhelming majority of existingsoftware libraries and applications codes are in Fortran, although C is catching up fast withrespect to available resources. In working with this book, the Fortran user will benefit fromthe widest variety of available software and from compatibility with the preponderance ofexisting application codes.
In addition, since Fortran is a relatively restrictive language andcompilers for it have had the benefit of many years of tuning, Fortran produces somewhatmore efficient executable code on some computer systems.C is a more versatile and expressive language than Fortran, and currently C is probablythe language most commonly taught in beginning programming courses. C also has theadvantage of being freely available (or at nominal cost) on almost any computer system,whereas Fortran may be unavailable or considerably more expensive in some cases. C haslong been used as a primary language for systems programming, but more recently it hasbecome increasingly popular for scientific programming as well.
If you desire to use Cwith this book, there should be plenty of software available. For example, both majorcommercial libraries, IMSL and NAG, have substantial subsets available in C, and the NR andNUMAL libraries are also available in C at nominal cost (see Section 1.4.1).In addition, on many computer systems it is fairly straightforward to call Fortran routines from C programs. The main differences to watch out for are that the routine namesmay be slightly modified (often with an underscore before and/or after the usual name), allarguments to Fortran subroutines should be passed by address (i.e., as pointers in C), andC and Fortran have opposite array storage conventions (C matrices are stored row-wise,Fortran matrices are stored column-wise).
Finally, one can automatically convert Fortransource code directly into C using the f2c converter that is available free from Bell Laboratories or from netlib, so that Fortran routines obtained via the Internet, for example, caneasily be used with C programs.24CHAPTER 1. SCIENTIFIC COMPUTINGA third choice of programming language that should be seriously considered is an interactive scientific computing environment, such as MATLAB. The user of such an environmentwill enjoy several benefits. User programs will generally be much shorter, because of theelimination of declarations, storage management, and many explicit loops.
In addition, theseenvironments often have built-in functions for many of the problems we will encounter, whichgreatly simplifies the interface with such routines because much of the necessary information(array sizes, etc.) is passed implicitly by the environment. An additional bonus is built-ingraphics, which avoids having to do this separately in a postprocessing phase. Even if youintend to use a standard language such as C or Fortran in the long run, you may still find itbeneficial to learn a package such as MATLAB for its usefulness as a rapid prototyping environment in which new algorithms can be tried out quickly then later recoded in a standardlanguage, if necessary, for greater efficiency or compatibility. If you wish to learn MATLAB, inaddition to the superb tutorial and reference documentation that comes with it you mightalso find one of the many books on MATLAB useful (see [18, 71, 120, 200, 204, 206, 229]).Some of the computer problems in the book call for graphical output.