|
@ -66,9 +66,9 @@ int main(int argc, char *argv[]) |
|
|
exit(1); |
|
|
exit(1); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (rozmiar <= 0 || rozmiar > 2000) |
|
|
|
|
|
|
|
|
if (rozmiar <= 0) |
|
|
{ |
|
|
{ |
|
|
cerr << "The number of matrix dimension must be in range [1,2000]" << endl; |
|
|
|
|
|
|
|
|
cerr << "The number of matrix dimension must be positive" << endl; |
|
|
exit(1); |
|
|
exit(1); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -150,9 +150,12 @@ int main(int argc, char *argv[]) |
|
|
for (i=0; i<porcja_new; ++i) |
|
|
for (i=0; i<porcja_new; ++i) |
|
|
{ |
|
|
{ |
|
|
vect_c[i] = 0; |
|
|
vect_c[i] = 0; |
|
|
|
|
|
long a_row = i%rozmiar; |
|
|
|
|
|
long vect_col = (i/rozmiar)*rozmiar; |
|
|
for (long k=0; k<rozmiar; ++k) |
|
|
for (long k=0; k<rozmiar; ++k) |
|
|
{ |
|
|
{ |
|
|
vect_c[i] += A[i%rozmiar][k]*vect[(i/rozmiar)*rozmiar+k]; |
|
|
|
|
|
|
|
|
vect_c[i] += A[a_row][k]*vect[vect_col]; |
|
|
|
|
|
++vect_col; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|