examples/omp/benchmarks/kastors-1.1/strassen/src/strassen.c
static int compare_matrix(int n, REAL *A, int an, REAL *B, int bn)
{
    int i, j;
    REAL c;

    for (i = 0; i < n; ++i)
        for (j = 0; j < n; ++j) {
            /* compute the relative error c */
            c = ELEM(A, an, i, j) - ELEM(B, bn, i, j);
            if (c < 0.0)
                c = -c;
            c = c / ELEM(A, an, i, j);
//	    printf("C: %f   A: %f   B: %f\n", c, ELEM(A, an, i, j), ELEM(B, bn, i, j));
            if (c > EPSILON)
                return 0;
        }

    return 1;
}
/*
 * Compare two matrices.  Print an error message if they differ by
 * more than EPSILON.
 */
Compare two matrices.  Print an error message if they differ by
more than EPSILON.
Compare two matrices . Print an error message if they differ by more than EPSILON .
static int compare_matrix(int n, REAL *A, int an, REAL *B, int bn)
{
    int i, j;
    REAL c;
    for (i = 0; i < n; ++i)
        for (j = 0; j < n; ++j) {
            c = ELEM(A, an, i, j) - ELEM(B, bn, i, j);
            if (c < 0.0)
                c = -c;
            c = c / ELEM(A, an, i, j);
            if (c > EPSILON)
                return 0;
        }
    return 1;
}
static int compare_matrix ( int n , REAL * A , int an , REAL * B , int bn ) { int i , j ; REAL c ; for ( i = 0 ; i < n ; ++ i ) for ( j = 0 ; j < n ; ++ j ) { c = ELEM ( A , an , i , j ) - ELEM ( B , bn , i , j ) ; if ( c < 0.0 ) c = - c ; c = c / ELEM ( A , an , i , j ) ; if ( c > EPSILON ) return 0 ; } return 1 ; }
Compare two matrices.
Compare two matrices .
/* compute the relative error c */ //	    printf("C: %f   A: %f   B: %f\n", c, ELEM(A, an, i, j), ELEM(B, bn, i, j));