bglenden@colobus.cv.nrao.edu (Brian Glendenning)

Re: Books on Numerical Computation in C++?

National Radio Astronomy Observatory Sat, 5 Mar 1994 04:27:40 GMT
Newsgroups:
comp.lang.c++
References:
<2l5pgg$11j@dartvax.dartmouth.edu>
Here's a mini-review of a book with a (similar) theme I wrote a while
back:
------------------------------------------------------------------------
From: bglenden@colobus.CV.NRAO.EDU (Brian Glendenning)
Subject: Mini-"review": Scientific C++
Date: Wed, 1 Dec 93 12:36:28 EST


I've recently skim-read:

"Scientific C++: Building Numerical Libraries the Object-Oriented Way"
by Guido Buzzi-Ferraris (Addison-Wesley). ISBN 0-201-63192-X

This is an introductory text that works its way up through some fairly
involved and realistic examples. I think it might be a good text book
for someone coming from a FORTRAN background. Caveat: I can't judge
introductory texts any more.

There are a couple of errors in the text I noticed:
	1) When deleting an array (allocated from new) of any type the 
	syntax is "delete [] ptr", not "delete ptr" or "delete [100] ptr"
	2) It incorrectly states that you can't discriminate between
	prefix and postfix ++ and -- when you are overloading these
	operators (i.e. distinguish between ++i and i++), which you can
	now do.

The book doesn't cover all aspects of C++; for instance, it doesn't
discuss multiple inheritance or templates. It takes a "bottom up"
approach to the language; you are well into the book before classes
are mentioned. It discusses the C parts of the language first, then
the object-oriented parts. Opinions will differ if this is the best
approach.

Of course people will differ on whether his approaches are always the
best ones. For instance, in his sparse matrix class accessing an
undefined element on the rhs of an expression will cause a new
elemeent (with the value 0.0) to be inserted, rather than just
returning a 0.0 without allocating storage (which could be done by
using a proxy class). Also, not all of his guidelines are ones that
I'd adopt. Still, all his examples and suggestions are reasonable
ones. People will always argue about what is "best".

It is nice reading a C++ text that talks about efficient numerical
computation, and also has examples that are more interesting to most
of us than the usual stacks, queues, etc (instead it uses examples
like matrix classes). This might be a worthwhile addition to your
library.

Brian

--
       Brian Glendenning - National Radio Astronomy Observatory
bglenden@nrao.edu          Charlottesville Va.           (804) 296-0286