GIDForums  

Go Back   GIDForums > Computer Programming Forums > C++ Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 02-May-2007, 21:58
kranthi kranthi is offline
New Member
 
Join Date: Jan 2007
Posts: 5
kranthi is on a distinguished road
Post

Sparse Matrix multiplication


Help me in multiply two Sparse Matrices
  #2  
Old 02-May-2007, 22:39
davekw7x davekw7x is offline
Outstanding Member
 
Join Date: Feb 2004
Location: Left Coast, USA
Posts: 5,303
davekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to behold

Re: Sparse Matrix multiplication


Quote:
Originally Posted by kranthi
Help me in multiply two Sparse Matrices
As my old redneck buddy once told me, "If you want to make chicken soup, first you steal a chicken."

So, if you want to multiply two sparse matrices, first you, somehow, come up with two sparse matrices.

In other words, the approach to efficient multiplication of sparse matrices depends (almost) entirely on the precise pattern of sparsity. I mean, there's sparse, and then again there's sparse.

1. What is your assignment?

2. What is it about your assignment that you don't you understand and for which you have some expectation of assistance from a general programming help forum?

3. It could happen (your getting assistance here), but you have to show us something before there is a ghost of a chance that we can show you anything!

Regards,

Dave
Last edited by davekw7x : 02-May-2007 at 23:14.
  #3  
Old 03-May-2007, 02:12
kranthi kranthi is offline
New Member
 
Join Date: Jan 2007
Posts: 5
kranthi is on a distinguished road

Re: Sparse Matrix multiplication


I have already created a sparse matrix using linked list.
Now I'm trying to multiply those matrices.
Help me in writing the algrithm.
  #4  
Old 03-May-2007, 09:51
davekw7x davekw7x is offline
Outstanding Member
 
Join Date: Feb 2004
Location: Left Coast, USA
Posts: 5,303
davekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to behold

Re: Sparse Matrix multiplication


Quote:
Originally Posted by kranthi
I have already created a sparse matrix using linked list.
Now I'm trying to multiply those matrices.
Help me in writing the algrithm.

In the first place, there are lots of people (well, at least one, and probably more) who would like to help you implement whatever algorithm you decide to use. (That is: to make a program that uses that algorithm to solve your problem.)

As far as "writing the algorithm":

I hate to repeat myself, but
Quote:
Originally Posted by davekw7x
the approach...depends (almost) entirely on the precise pattern of sparsity

I'm not sure that "sparsity" is a word, but I hope you get the idea.

Just saying that you have two lists of non-zero matrix element values (and, I assume, their positions in their respective matrices) doesn't give any information at all about how to approach the problem of multiplying the matrices represented by the lists.

So: What is your assignment? (But I asked that already, didn't I.)

If you have absolutely no information about a pattern of sparseness, then just create two matrices corresponding to the sizes of the matrices represented by the lists. Initialize the matrices with all zeros, and then put in the values from your lists. Then multiply the matrices "normally", using the definition of matrix multiplication.

In this case the property of "sparseness" is no help in reducing in the amount of time required to multiply the matrices or the amount of memory required when they are being multiplied, but might reduce the amount of storage required for each one when it is not being operated on.

Regards,

Dave
 
 

Recent GIDBlogProblems with the Navy (Enlisted) by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
C++ Matrix bengaluke C++ Forum 7 03-Feb-2007 22:38
i need help in C++ PLZ its_me C++ Forum 3 04-Dec-2006 22:51
how to initialize a char matrix matrix with empty elements? swedenguy C Programming Language 4 22-Aug-2006 12:43
how to initialize a char matrix matrix with empty elements? swedenguy C Programming Language 1 22-Aug-2006 12:15
Combining Vectors and References Frankg C++ Forum 7 14-Jan-2006 07:17

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 08:01.


vBulletin, Copyright © 2000 - 2010, Jelsoft Enterprises Ltd.