Newsgroups: comp.lang.apl
Path: watmath!watserv2.uwaterloo.ca!torn!spool.mu.edu!sdd.hp.com!elroy.jpl.nasa.gov!jato!csi!sam
From: sam@csi.jpl.nasa.gov (Sam Sirlin)
Subject: Re: Matrix Inverse in APL2
Message-ID: <1993Jan12.182324.6959@csi.jpl.nasa.gov>
Originator: sam@kalessin
Sender: usenet@csi.jpl.nasa.gov (Network Noise Transfer Service)
Nntp-Posting-Host: kalessin
Organization: Jet Propulsion Laboratory, Pasadena, CA
References:  <C0puI4.Mv6@undergrad.math.waterloo.edu>
Date: Tue, 12 Jan 1993 18:23:24 GMT
Lines: 47


In article <C0puI4.Mv6@undergrad.math.waterloo.edu>, bdcrafto@cayley.uwaterloo.ca (Brad Crafton) writes:
|> HELP!!  For a project I'm doing for work I require a routine to take the
|> Inverse of a very large matrix (in the order of 1000x1000).  

You should be sure you really want the inverse and not a solution to a
linear system of equations. They are somewhat different problems.

|> The 
|> Matrix Inverse function tends to bomb out at even a 10x10 matrix.

Wow! What are you using? Must be pretty bogus. Is APL2 really that
unreliable? On all machines? What do you mean by bomb out... does it
complain about singularity, is the problem ill conditioned, and do you
know there really is an inverse that it doesn't find?

|> I am assuming that some sort of Gaussian Elimination routine is
|> needed.  Is there somewhere where I could find a pre-written routine?

The best routines for full matrices are in LINPACK or the newer
LAPACK. These are written in fortran and are available free over the
net (try archie... one of the ATT nodes I think has them). Note that
there are various simplifications depending on whether or not the
matrix is symmetric, complex, etc. The LINPACK manual should be in
you're library and you need to read it to understand more about what
you're doing. 

|> I realize that for a matrix so large, it would probably take a LONG
|> time to run.  But could anyone guestimate what kind of time I'm
|> looking at?  Minutes?  Hours?  If it means anything, most of the
|> entries in the matrix will be zero.

The inverse is (in general) an n^3 problem. So you can extrapolate for
you're machine. Sounds like you have a sparse system. I'm not familiar
with routines for such, but they do exist and are likely to be
enormously more efficient and accurate (try looking for sparspack or
something like it). The current matlab includes sparse stuff. Since
the complexity increases so fast, it should be obvious to you that
reducing the dimension could make a dramatic difference.

You're system is big enough that you should spend some time on this,
to make sure that the answers you get are not just garbage.

-- 
Sam Sirlin
Jet Propulsion Laboratory         sam@kalessin.jpl.nasa.gov

