Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2009-06

sparse matrix storage method

3 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Alain Michaud

Hi,

would someone know of a procedure for solving a system of linear equations using a SPARSE MATRIX storage model.

if one uses the usual: array [1..10000;1..10000] of "mostly_zeroes" then
this is a really big waist of memory.

I am thinking of using: Tlist instead, but I would not like to reinvent the wheel! I would apreciate if someone could give me a tip.

Thank you

Alain

Reply by email

Mehmet Erol Sanliturk
to Alain Michaud
Alain Michaud wrote 16 lines
Hi, would someone know of a procedure for solving a system of linear equations using a SPARSE MATRIX storage model. if one uses the usual: array [1..10000;1..10000] of "mostly_zeroes" then this is a really big waist of memory. I am thinking of using: Tlist instead, but I would not like to reinvent the wheel! I would apreciate if someone could give me a tip. Thank you Alain

In the web site
http://www.netlib.org/
you may find both C and Fortran programs about sparse matrices , ( I do not know whether there exist Pascal programs for sparse matrices , you may search . )
I think , the above site is the best source of sparse matrix computation sources .

In < Data Structures with Pascal > books , there may exist sparse matrix computation procedures .

You may see the following sites .
I could not find any procedure for sparse matrices here , but existing algorithms may be useful :

http://pagesperso-orange.fr/jean-pierre.moreau/
http://www.delphiforfun.org/Programs/Delphi_Techniques/GaussianElimination.htm

The following sites are about numerical computation languages . They are open source projects . In their sources it may be possible to find sparse matrix computation related sources ( They are not programmed in Pascal ) :

http://www.gnu.org/software/octave/
http://www.r-project.org/
http://numexp.org/
http://www.scilab.org/

The following site is about mathematics subjects :

http://www.mathtools.net/

Thank you very much .

Mehmet Erol Sanliturk

Reply by email

Tom Verhoeff
to Alain Michaud: would someone know of a procedure for solving a system of linear equations using a SPARSE…
Alain Michaud wrote 9 lines
would someone know of a procedure for solving a system of linear equations using a SPARSE MATRIX storage model. if one uses the usual: array [1..10000;1..10000] of "mostly_zeroes" then this is a really big waist of memory. I am thinking of using: Tlist instead, but I would not like to reinvent the wheel! I would apreciate if someone could give me a tip.

Alain,

I have attached a program (matrix.pas) to compare a full matrix against a sparse matrix implementation (using singly linked lists with pointers) for multiplication time. The surprising thing for me was that (back then in 1995), the turnover point is at about 75% of nonzero (i.e. 25% zero) elements (see mat-out.txt). This was actually a programming assignment for our second-year students.

Note, however, that compring storage needs to be done carefully because of the overhead in pointers and indexes.

The program is written in Turbo Pascal, but it should not be hard to run it using FPC.

Best regards,

Tom

E-MAIL: T.Verhoeff @ TUE.NL | Dept. of Math. & Comp. Science PHONE: +31 40 247 41 25 | Technische Universiteit Eindhoven FAX: +31 40 247 54 04 | PO Box 513, NL-5600 MB Eindhoven http://www.win.tue.nl/~wstomv/ | The Netherlands

Reply by email