LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
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 09-21-2004, 03:09 AM   #1
abdobl
LQ Newbie
 
Registered: Sep 2004
Location: Tripoli
Posts: 22

Rep: Reputation: 15
Question Parallel matrix multiplication


Hi every body..

I need a parallel matrix multiplication code in C language,I need it too much,I have searched the google site but it did not work.any help will be appresiated.
abdobl
 
Old 09-21-2004, 04:56 AM   #2
rjlee
Senior Member
 
Registered: Jul 2004
Distribution: Ubuntu 7.04
Posts: 1,990

Rep: Reputation: 67
Modified C++ code from http://www.devarticles.com/c/a/Cplus...g-in-C-plus/4/

I haven't tested this, but it looks like it should work to me.

Calculates l * m, stores result in dest. m_numRows = number of rows in m and number of columns in l. numRows is number of rows in dest, numCols is number of cols in dest. Dimensions are assumed to be correct.

Code:
void matrixmul(double ** dest, double ** l, double ** m, int m_numRows, int numRows, int numCols) {
int r,c,i;
for (r=0;r<numRows;r++) {
for (c=0;c<m_numCols;c++) {
for (i=0;i<numCols;i++) {
dest[r][c]+=l[r][i]*m[i][c];
}
}
}
}
 
Old 09-21-2004, 02:25 PM   #3
clockworks
Member
 
Registered: Dec 2003
Location: texas
Distribution: fedora core 1, fedora core 2
Posts: 37

Rep: Reputation: 15
he's looking for a parallel matrix multiply algorithm.

i got two questions for you...are you using shared memory or message passing? and is this a homework assignment? =P

-- C
 
Old 09-22-2004, 07:11 AM   #4
abdobl
LQ Newbie
 
Registered: Sep 2004
Location: Tripoli
Posts: 22

Original Poster
Rep: Reputation: 15
you are right ,I am looking for parallel matrix multiply algorithm,
I am using sockets with TCP/IP,stream sockets.
this is not a homework,it's step in project Iam working on...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
USB drive, multiplication of mountpoints Jon_Roland Fedora 0 11-07-2005 11:18 PM
floating point multiplication irfanhab Programming 0 12-23-2004 11:13 PM
Matrix Linux ryancoolest Linux - Newbie 2 09-13-2004 09:28 PM
Matrix Linux ryancoolest Linux - Hardware 1 09-13-2004 05:36 AM
The Matrix eresc Linux - Hardware 4 11-28-2003 05:59 PM


All times are GMT -5. The time now is 08:08 AM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration