Springer-Verlag, New York, 2001, ISBN: 0-387-98990-0, 450 pages, $49.95.

Paperback reprint, ISBN: 978-1461265665, New York, September 2012, $124.00 (details)

view cover Order or see reader's reviews at Amazon.com

2012 Softcover Edition

Preface, Table of Contents, and Chapter 1: | postscript file and PDF file |

Sample source code in the book: | zip file (116KB) (last updated: 2001-09-05) |

Errors in the book: | Errata (last updated: 2002-11-15) |

Besides introducing basic and advanced features of C++, the book contains an introduction and C++ programs for many numeric methods such as polynomial interpolation, numerical integration, direct and iterative algorithms for solving systems of linear equations in real and complex domains, methods for solving nonlinear equations, ordinary and partial differential equations with real and complex coefficients. These methods are fundamental in scientific and engineering computing.

This book gives numerous examples and techniques on how to reduce (C and Fortran style) run-time overhead and improve program efficiency and elegancy. Such techniques include function objects, deferred evaluation for operator overloading, expression templates, template metaprograms, and replacing certain virtual functions by templates. It also introduces tools on how to manage source files, create libraries, and debug and profile programs.

The book can be used as a textbook for students in science and engineering and a reference book for experienced scientific C++ programmers.

- C++'s object oriented and general programming features enable the programmer to write few codes and support an evolving process of code development. For example, One version of C++ program of preconditioned conjugate gradient and GMRES methods can be used for full (storing every entry of a matrix), banded (zero entries outside of a band along the main diagonal are not stored to save memory), and sparse (only non-zero entries of a matrix are stroed to save memory) matrices, and for real and complex single, double, long double precisions. It would require 18 versions in Fortran 77 or Fortan 90. Six versions of C code may do it, but will be much less efficient. If one later decides to add a symmetric (only store lower triangular part of a matrix to save memory) matrix storage format, then 6 more versions of Fortan code (for real, complex, and single, double, long double precisions) need be added. The same C++ program for conjugat gradient and GMRES methods still can handle this situation without any change. C++ code of preconditioned conjugat gradient and GMRES methods are given in Chapter 11 (last chapter) of the book, which work for full, banded, sparse, and other matrices in real and complex domains.
- C++ has features (compound assignment operators, templates, function objects, high performance computing library such as valarray) that can be faster than Fortran 77 and C. For example, passing a pointer to a function as an argument to another function can be avoided in many C++ programs by using templates, which can improve the speed of execution by a factor of 2 on many compilers and machines. Running time comparisons with C and Fortran style function passing are done in various places of the book.
- C++ provides standard libraries on data structures such as vector, set, list, map, stack, queue, valarray, and on algorithms such as sort() and find(). They come with any standard C++ compiler and can be much more efficient, convenient, and portable than codes written a typical or expert programmer. For example, using these libraries, it is much easier to write finite element programs on unstructured grids and grid generation programs in C++ than in Fortran and C. A disussion of these standard libraries and algorithms are given in various chapters of the book.
- C++ programs resemble numerical algorithms more than in Fortran or C. For exmaple, we can write v = v1 + v2 for vector addition and v1 = m*v2 for (sparse, banded, or full) matrix-vector multiplication. The C++ code for the conjugate gradient method (for solving linear systems of algebraic equations) looks very much like the algorithm, which enhances readibility and maintainability. Besides, such operator overloading from built-in types to user-defined types can be done without sacrifice of run-time speed (see Chapter 6 of the book).

C++ Books and Resources

Bjarne Stroustrup, The C++ Programming Language (Third Edition), Addison-Wesley, 1997, ISBN 0-201-88954-4.

David Vandevoorde, C++ Solutions Addison-Wesley,1998, ISBN 0-201-30965-3. (This book provides answers to Bjarne Stroustrup's book above)

Lippman, Stanley B. and Josee Lajoie, C++ Primer, 4rd ed. Reading, Mass. Addison-Wesley, 2005. ISBN: 9780201721485.

ISO/ANSI C++ Standards

ANSI C info