LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-01-2007, 10:26 AM   #1
ztdep
Member
 
Registered: Jul 2005
Posts: 219

Rep: Reputation: 31
free code for the "sparse matrix multiplicatino"


Hi:
Friends. I need a package in c or fortran to perfome the operations of sparse matrix, especially multiplicatino.

would you please give me some advice on that.
Regards
 
Old 04-01-2007, 02:58 PM   #2
kev82
Senior Member
 
Registered: Apr 2003
Location: Lancaster, England
Distribution: Debian Etch, OS X 10.4
Posts: 1,263

Rep: Reputation: 51
I don't think you will be able to find much for general sparse matrices, because the algorithm would work very differently for different types of sparseness. For example you would code an algorithm very differently to deal with diagonal/tri-diagonal matrices and matrices which are constructed as the disjoint union of submatrices.

For a general sparse matrix (one with many zeroes, but placed uniformally randomly), I would probably store the zeros as bitmasks and then for each element in the answer matrix, intersect(and) the row bitmasks from the first matrix and the column bitmasks for the second matrix to find out which elements need to be multipled. Things you should also consider are zero rows in the left matrix and zero colums in the right matrix as these will lead to zero rows and columns in your output.

Only you know the properties of the matrices you are working with, so write a few different algorithms and generate lots and lots of random matrices with the properties yours will have, and see which methods are faster.

If you don't want to do the implementation yourself then there is some LU factorisation of sparse matrices in GMPLIB (I think) and there is also a lot of stuf in NAG (obviously) but it is not free.
 
Old 04-01-2007, 11:10 PM   #3
ztdep
Member
 
Registered: Jul 2005
Posts: 219

Original Poster
Rep: Reputation: 31
Thank you very much
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Differences between the "free" and "paid" versions eraser Linux - General 4 11-18-2015 06:30 PM
LXer: In response to "Free Code For Sale: The New Business of Open Source" LXer Syndicated Linux News 0 04-28-2006 11:33 PM
Can you explain the difference between "Free Software (GNU)" and "Open Source"? vharishankar General 5 03-03-2005 09:40 AM
Kylix OE "generating font matrix" JimKyle Linux - Software 3 10-29-2002 11:52 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:56 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration