examples/omp/benchmarks/kastors-1.1/jacobi/src/poisson.c
double r8mat_rms(int matrix_size, int matrix_size2, double *a_) {
    double (*a)[matrix_size][matrix_size] = (double (*)[matrix_size][matrix_size])a_;
    int i;
    int j;
    double v;

    v = 0.0;

    for (j = 0; j < matrix_size; j++) {
        for (i = 0; i < matrix_size; i++) {
            v = v + (*a)[i][j] * (*a)[i][j];
        }
    }
    v = sqrt(v / (double) (matrix_size * matrix_size));

    return v;
}
/* R8MAT_RMS returns the RMS norm of a vector stored as a matrix. */
R8MAT_RMS returns the RMS norm of a vector stored as a matrix.
R8MAT_RMS returns the RMS norm of a vector stored as a matrix .
double r8mat_rms(int matrix_size, int matrix_size2, double *a_) {
    double (*a)[matrix_size][matrix_size] = (double (*)[matrix_size][matrix_size])a_;
    int i;
    int j;
    double v;
    v = 0.0;
    for (j = 0; j < matrix_size; j++) {
        for (i = 0; i < matrix_size; i++) {
            v = v + (*a)[i][j] * (*a)[i][j];
        }
    }
    v = sqrt(v / (double) (matrix_size * matrix_size));
    return v;
}
double r8mat_rms ( int matrix_size , int matrix_size2 , double * a_ ) { double ( * a ) [ matrix_size ] [ matrix_size ] = ( double ( * ) [ matrix_size ] [ matrix_size ] ) a_ ; int i ; int j ; double v ; v = 0.0 ; for ( j = 0 ; j < matrix_size ; j ++ ) { for ( i = 0 ; i < matrix_size ; i ++ ) { v = v + ( * a ) [ i ] [ j ] * ( * a ) [ i ] [ j ] ; } } v = sqrt ( v / ( double ) ( matrix_size * matrix_size ) ) ; return v ; }
R8MAT_RMS returns the RMS norm of a vector stored as a matrix.
R8MAT_RMS returns the RMS norm of a vector stored as a matrix .