Organization: Penn State University
Date: Mon, 11 Jan 1993 10:15:11 EST
From: H. D. Knoble <HDK@psuvm.psu.edu>
Newsgroups: comp.lang.fortran
Subject: Re: inverse matrix

The original poster asked:
>I've often wondered about _Numerical Recipes_.  The physicists here
>swear by it.  Could you recommend to me a good text or reference for
>algorithms to do these common matrix operations?  Are there any
>freely-available robust algorithms for matrix inversion...

The physicists there, with some exceptions, are like physicists most places -
they know their answers to about three places and only use computer algorithms
to get a few more places:-) Actually Numerical Recipes are not very good in
general except for pedagogical purposes to study raw classical methods.

Following is the precaution I put in our (VM/CMS) "Help" display for
Numerical Recipes when the book was published:

    "Precaution

    While these algorithms are especially useful for pedagogical
    purposes, we disagree with the authors that numerical computations
    can be "cookbooked" by even professional programmers not
    thoroughly seasoned and extensively trained in the field of
    numerical and seminumerical computations.  Commercial numerical
    software such as IMSL and NAG libraries take into considerations
    computational difficulties and singularities arising in use of
    their individual algorithms; thus IMSL and NAG are called "robust"
    algorithms because they have been designed, implemented, and
    tested to give either correct answers or a "numerical
    difficulties" warning.  Thus while it is possible to derive
    numerically wrong answers from algebraically correct algorithms,
    this possibility has been minimized in commercial packages such as
    these by applying the theories of numerical computations that have
    been developed by the community of experts over the years.

    Numerical Recipes algorithms are not robust in this sense.  While
    a general caveat is given, there are several instances where the
    authors of Numerical Recipes do not give the casual scientific
    reader, who may have a need for a specific algorithm, specific
    precautions cogent to algorithms in that particular arena.  The
    authors of Numerical Recipes do give excellent robust numerical
    software bibliographies.  As such we offer the mechanism below
    pointing to availability of "Numerical Recipes" here as useful
    teaching tools rather than "production" programs suitable for
    general research computing.  ..."

To answer the question of where to look, excellent Reference works are:

1) NUMERICAL METHODS, Software and Analysis by John Rice, McGraw-Hill,
   ISBN 0-07-052208-1, 1983, 483 Pages. This is an 8.5" by 11" text which
   groups numerical methods by purpose (e.g., Matrices and Linear Equations
   is Chapter 6) and gives numerical methods, when to use each, precautions,
   illconditioned and well-conditioned cases, etc., and and paragraphs of
   annotated bibliography of code sources. This is one of the most, if not
   the most, qualified works.

2) COMPUTER SOLUTION OF LINEAR EQUATIONS, by George Forsythe and Cleve Moler,
   Prentice-Hall, LCCCN: 67-18915, 1967, 148 pages. This is a good theory
   text which shows (even 25 years ago) how computer implementations using
   naive FORmula TRANslation can be break down numerically.

3) COMPUTER METHODS FOR MATHEMATICAL COMPUTATIONS, by George Forsythe,
   Michael Malcolm, and Cleve Moler, Prentice Hall, ISBN 0-13-165332-6, 1977,
   259 Pages. Develops good Fortran code in a student environment. Source
   code accompanying this text book is available on Netlib (see below).

As one poster (Dodson) pointed out, one hardly ever needs to compute a matrix
inverse. The above reference and he are really saying to look into what you
are doing a little closer.

As far as free code is concerned, I suggest that you look at Reference (1)
above carefully (Even a good algorithm is only as good as it's input).  Then
look at ACM Algorithm 408 and LINPACK and ITPACK, all of which are available
on NETLIB.  To use NETLIB one sends email message(s) (subcommands) to a Netlib
server.  If you've never used it send the one-line, one-word, email prose:
HELP            to NETLIB at RESEARCH.ATT.COM  or  NETLIB at ORNL.GOV
or NETLIB at NAC.NO (three sites with essentially the same source codes).
From: dr@hpcuhe.cup.hp.com (Dick Rupp)
Date: Thu, 7 Jan 1993 00:33:45 GMT
Subject: Opinions Wanted on Optimizer Options
Organization: Hewlett Packard, Cupertino