Tuesday, July 28, 2009

C++ code blocks needs help from you about matrix (50x50 multiplication)?

who knows about matrix in c++ code blocks??


please help me with my project.Just a simple one, please!


I have no time to do it co'z I have an outreach prog. to facilitate and it's too far and so many things to do.





I need to do a 50 by 50 multiplication matrix and please include guide about your prog. for me to trace it.by the way I"ll need it tomorrow.%26lt;%26lt;Thank You%26gt;%26gt;...





Your help will be much appreciated:--]

C++ code blocks needs help from you about matrix (50x50 multiplication)?
do you mean "50 by 50 multiplication matrix" like you wrote, or do you mean "50 by 50 matrix multiplication". They are quite different things and with programming you have to be very accurate and explicit in how you specify things.





To multiply matrices A and B and put the result in C, you write code like this. Replace the leading dots with spaces. (They're just to do the indenting since yahoo answers deletes it.)





#define N 50





double A[N][N];


double B[N][N];


double C[N][N];





for (i = 0; i %26lt; N; ++i)


{


....for (j = 0; j %26lt; N; ++j)


....{


........C[i][j] = 0;


........for (k = 0; k %26lt; N; ++k)


............C[i][j] += A[i][k] * B[k][j];


....}


}
Reply:I'll give you a little clue then you finish it.





for (y=0;y%26lt;50;y++){


for (x=0;x%26lt;50x++){


/* add code here*/


}


}





:D


No comments:

Post a Comment