root / synthbench / euroben-ports / base / C-MPI / mod2am / check.c @ 0:839f52ef7657
History | View | Annotate | Download (760 Bytes)
1 |
#include<math.h> |
---|---|
2 |
#include<float.h> |
3 |
|
4 |
int check( int m, int l, int n, double **c ) |
5 |
// ---------------------------------------------------------------------
|
6 |
// --- Routine 'check' does the correctness check for the matrix-matrix
|
7 |
// multiplication in function 'mxm'. Because of the particular
|
8 |
// data that are generatedin function 'gendat', this check can be
|
9 |
// used.
|
10 |
// ---------------------------------------------------------------------
|
11 |
{ |
12 |
double eps, tvalue = (double)l; |
13 |
int i, j, ok = 0; |
14 |
// ---------------------------------------------------------------------
|
15 |
eps = 2.0*l*l*DBL_EPSILON; |
16 |
for( i = 0; i < m; i++ ) { |
17 |
for( j = 0; j < n; j++ ){ |
18 |
if ( fabs( tvalue - c[i][j] ) > eps ) ok++;
|
19 |
} |
20 |
} |
21 |
return( ok );
|
22 |
} |