sw/benchmarks/src/ocean.c
// clear edges after Jacobi or Laplace transformation, if there are no
// neigbours
// BUGFIX: don't forget corners
clear edges after Jacobi or Laplace transformation, if there are no
neigbours
BUGFIX: don't forget corners
clear edges after Jacobi or Laplace transformation if there are no neigbours BUGFIX : don ' t forget corners
void clear_edges(double **z, int lastrow, int lastcol, double val,
    bool n, bool s, bool w, bool e)
{
    int j;
    if (n) {
        for (j=0; j<=lastcol+1; j++) z[0][j] = val;
    }
    if (s) {
        for (j=0; j<=lastcol+1; j++) z[lastrow+1][j] = val;
    }
    if (w) {
        for (j=0; j<=lastrow+1; j++) z[j][0] = val;
    }
    if (e) {
        for (j=0; j<=lastrow+1; j++) z[j][lastcol+1] = val;
    }
}
void clear_edges ( double * * z , int lastrow , int lastcol , double val , bool n , bool s , bool w , bool e ) { int j ; if ( n ) { for ( j = 0 ; j <= lastcol + 1 ; j ++ ) z [ 0 ] [ j ] = val ; } if ( s ) { for ( j = 0 ; j <= lastcol + 1 ; j ++ ) z [ lastrow + 1 ] [ j ] = val ; } if ( w ) { for ( j = 0 ; j <= lastrow + 1 ; j ++ ) z [ j ] [ 0 ] = val ; } if ( e ) { for ( j = 0 ; j <= lastrow + 1 ; j ++ ) z [ j ] [ lastcol + 1 ] = val ; } }
clear edges after Jacobi or Laplace transformation, if there are no
neigbours
BUGFIX: don't forget corners
clear edges after Jacobi or Laplace transformation if there are no neigbours BUGFIX : don ' t forget corners