Among the wide variety of books concerned with numerical methods, to date only a handful consider implementation of algorithms in the C++ language. Moreover, most of these books treat the subject of object-oriented programming at a fairly abstract level. Therefore an introductory book such as this is a welcome addition. The author, Lord Flowers, is a former rector of Imperial College, London, an eminent nuclear physicist, professor and a member of a number of commissions concerned with the care of the environment. The first half of the book prepares the ground for the numerical methods presented later. It concentrates on elements of the C++ language, describes the use of classes, and introduces numerical preliminaries.
The first two chapters of the book are a gentle lead-in to C++, focusing on those areas that are common to C++ and C such as types (including pointers), operators, control statements and the use of functions. Features of C++ which make it a "better C", such as the use of the const keyword, are presented. Some concepts which are not available in C, such as reference variables, have also been elucidated. The style of presentation may be difficult to follow for a newcomer to C++ without previous exposure to C, as some of the more terse C/C++ syntax is introduced rather early. Some more substantial examples of code, introduced earlier, might have made the concepts easier to absorb.
The use of classes, which is at the heart of the implementation of the object-oriented paradigm, is introduced in Chapter 5 with the example of a class for the manipulation of complex numbers. Subsequent chapters contain basic definitions of string, vector and matrix classes, the last two of which are essential for numerical methods. The mechanism for the construction of classes and the derivation of classes from base classes is conveyed clearly. The concept of polymorphism, which is the other plank on which the object oriented paradigm rests, has not been touched upon however.
For the benefit of people who dislike a "black box" approach to programming, the author has indicated how a class to perform input/output in C++ may be designed. The exercise is a useful encouragement to delve into implementation details that are normally avoided. There is also a chapter on how a graphics package may be designed. The particular graphics primitives used are those of Borland Turbo C++, the compiler system used by the author. The package should however extend fairly easily to other compiler systems. It is noteworthy that complex, string, vector and stream classes have all been defined in the emerging C++ standard.
The preface to the book expresses the hope that the book would be of interest to "computing scientists who wish to see how C++ can be used in earnest for numerical computation". For this to be really so, the concept of class would have to be extended to include higher level classes needed for numerical computations, such as classes for solving systems of linear equations or partial differential equations. There is a large amount of documented software available on the Internet and commercially which addresses some of the issues involved, although there is not yet consensus on the design of such high-level classes. The book does not mention the existence of this software.
The second half of the book introduces some principal areas of numerical analysis with chapters on the direct and iterative solution of linear systems, eigenvalue problems, interpolation and data-fitting, differentiation and integration, orthogonal polynomials and differential equations. The author addresses a wide range of topics with verve and enthusiasm but the coverage is a little uneven. Some numerical methods presented are classical but though they may have educational interest, they are outdated for the purposes of serious computation and the author does not warn readers about this.
Two examples - first, chapters 10 and 11 contain a detailed discussion of the solution of linear equations, including error analysis, perturbation theory and iterative refinement. But there is also a section (10.6) on unsymmetric tridiagonal equations which does not mention the possible need for interchanges. Second, chapter 12 on iterative methods discusses Gauss-Jacobi, Gauss-Seidel and SOR without a hint that there might be other methods that are more suitable for practical purposes.
One novel topic is the use of lists and recursion to program the Fast Fourier transform. It is an effective way of arriving quickly at a working program, and the author is frank about the overhead incurred.
The preface says that the book is primarily intended for undergraduate students in science and engineering. However, there are no formal exercises to reinforce the concepts introduced in the text. Readers are occasionally invited to experiment for themselves; but experimentation is made more difficult than it need be as the software described is not included in an accompanying disk. There are few references and little discussion of the gap between the code fragments in the book and good quality, reliable and robust software. In short, it is difficult to envisage the book being used as a course text. However, a bright student embarking on a course of independent work could learn much from it.
Shah Datardina is C library group leader at the Numerical Algorithms Group Ltd, Oxford.
An Introduction to Numerical Methods
Author - B. H. Flowers
ISBN - 0 19 853863 4
Publisher - Clarendon Press, Oxford
Price - £29.50
Pages - 491