[debutant]Probleme bizarre dans ma fonction multiply matrix
Bonjour,
Lorsque je multiplie ces 2 matrices A B C obtient toujours une valeur incoherente xeample :
fot k=0 A[i][k]=0.000000 and B[k][j]=0.490393 :C[i][j]=6024231862103210248374154
205547462656.000000
B=
Citation:
0.353553 0.490393 0.461940 0.415735 0.353553 0.277785 0.191342 0.097545
0.353553 0.415735 0.191342 -0.097545 -0.353553 -0.490393 -0.461940 -0.277785
0.353553 0.277785 -0.191342 -0.490393 -0.353553 0.097545 0.461940 0.415735
0.353553 0.097545 -0.461940 -0.277785 0.353553 0.415735 -0.191342 -0.490393
0.353553 -0.097545 -0.461940 0.277785 0.353553 -0.415735 -0.191342 0.490393
0.353553 -0.277785 -0.191342 0.490393 -0.353553 -0.097545 0.461940 -0.415735
0.353553 -0.415735 0.191342 0.097545 -0.353553 0.490393 -0.461940 0.277785
0.353553 -0.490393 0.461940 -0.415735 0.353553 -0.277785 0.191342 -0.097545
A=
Citation:
0 255 255 255 255 255 255 255
1 255 255 255 255 255 255 255
2 255 255 255 255 255 255 255
3 255 255 255 255 255 255 255
4 255 255 255 255 255 255 255
5 255 255 255 255 255 255 255
6 255 255 255 255 255 255 255
7 255 255 255 255 255 255 255
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| void multiply( float A[8][8],float B[8][8],float C[8][8])
{
int i,j,k;
for (i=0;i<8;i++)
{
for (j=0;j<8;j++)
{
for (k=0;k<8;k++)
{
C[i][j]+=1;//(A[i][k])*2;//(B[k][j]);
if(i==0 && j==1)
{
printf("fot k=%d A[i][k]=%f and B[k][j]=%f :C[i][j]=%f \n",k,A[i][k],B[k][j],C[i][j]);
}
}
}
}
return ;
} |
si quelau un a une idee ...