# Linear Algebra

A Russian ** README ** is here.

Usually, when solving large linear systems of algebraic equations,

determinants are not necessary, but sometimes you still want them to know

(or at least their signs).

Here I present a few well tested packages, familiar to me, which are capable of computing determinants for various matrices (including the sparse ones).

The package was assembled partly through

the new ** Trefor ** , but here is a pure **Fortran** version.

After unpacking the archive ** determ.tgz **

one has to go inside the new directory ** determinant/ ** and type there:

make -f ifcdeterm.mak

-- this is for **ifort**, or

make -f mgfdeterm.mak

-- this is for **gfortran**.

One can embed other compilers in the same makefile (see, for example, the commented variants, uncomment and edit them).

To test the minors of a matrix type:

make -f ifcdeterm.mak alargematr

make -f mgfdeterm.mak alargematr

You will get **xalargematr.exe** and let it run.

Specify the size of the matrix N when prompted. Normally, it works OK up to N ~ 200. For larger N the determinants may become too large, but if the matrix is good and normalized a much larger N can be taken. One has to press "enter" many times (edit the source ** tLargematrAlone.f90 **to remove "call mypause" if you do not want to pause).

When it stops, analyze the file

**compDet015.res** if N = 15

or

**compDet125.res** if N = 125, etc.

In this file, the first three columns give the diagonal minors of the

matrix computed in three different ways (the first two columns are almost one way via **lapack**).

All three answers must match.

I have used different versions of lapack libraries (usually they are installed on

linux machines, but here I collected all the necessary source code from lapack).

There is also a large file **test_mat.f90** from the site

http://people.sc.fsu.edu/~%20jburkardt/f_src/test_mat/test_mat.html

- in my package only a small part of this code is used, but you

can play with other tests (I have inserted only a

TEST_DETERMINANT for AEGERTER).

There is also a file **ma28Timmes.f90** from

http://cococubed.asu.edu/code_pages/burn.shtml

The main program in the package** tLargematrAlone.f90 **-- after the row

238 there the matrix amat (i, k) is filled with random numbers and unities.

I.e. this is a package for an arbitrary matrix. It should work as well for

symmetric matrices, but I have not investigated here special packages for symmetric matrices. The idea is that the special packages

should be faster, but here for N< 200 everything is not bad.

Thus, you need to substitute your matrix in place of my random one if you want to find its minors.

The same J.Burkardt has collected programs for symmetric matrices:

http://people.sc.fsu.edu/~%20jburkardt/f_src/sparsepak/sparsepak.html

They are based on the book by

*Alan George, Joseph W.-H. Liu,
Computer Solution of Large Sparse Positive Definite Matrices*,

Prentice Hall, 1981,

but I do not mastered these programs.

I used these books :

*S. Pissanetsky: Sparse Matrix Technology*

* O. Oesterby, Z. Zlatev: Direct methods for sparse matrices*

* J. Rice - Matrix computations and mathematical software*

SeB - Sergei I. Blinnikov