home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!dtix!darwin.sura.net!jvnc.net!yale.edu!ira.uka.de!chx400!sicsun!elia.epfl.ch
- From: guglielmetti@elia.epfl.ch (Philippe Guglielmetti)
- Newsgroups: comp.lang.pascal
- Subject: Re: Sparse matrices
- Message-ID: <3371@sicsun.epfl.ch>
- Date: 24 Jul 92 13:41:44 GMT
- References: <BrsxF5.DIw@news.cso.uiuc.edu>
- <1992Jul22.234424.3870@usenet.ins.cwru.edu>
- Sender: news@sicsun.epfl.ch
- Organization: Institut d'Automatique IA-DME-EPFL
- Lines: 23
- X-UserAgent: Nuntius v1.0
-
- Another approach is to use a kind of hash-table.
- each non-zero element is implemented as an index (i*columns+j for
- example) and the value itself.All these elements are kept sorted in an
- array. When you want to retrieve element (i,j), compute (number of
- non-zero elements) *(i*columns+j)/(rows*columns) that's roughly the place
- of the element you're looking for in the table. Look if you find it...
- it'll be quick and won't use much memory...
- I've done something like this using Turbo Vision TCollection object which
- allows efficient dynamic size changing and gives lot of useful methods to
- implement the hash-table...
-
- The proposed hashing method is efficient for very sparse matrix with
- randomly distributed non-zero elements, but you could use a different
- hash method if the elements are grouped along the diagonal to reduce the
- number of hash-code collisions.
-
- Philippe Guglielmetti | *** *
- Institut d'Automatique | * *
- Ecole Polytechnique | * ** *** * * * * *
- Federale de Lausanne | * * * * * * * * *
- 1015 Lausanne | *** *** *** * ***
- SWITZERLAND |
- guglielmetti@elia.epfl.ch | SMILE ! Tomorrow will be worse.
-