Skip to content
Snippets Groups Projects
Commit 596d5f1b authored by Daniel Maier's avatar Daniel Maier
Browse files

correlation calc_error

parent c0078554
No related branches found
No related tags found
No related merge requests found
......@@ -41,17 +41,19 @@ void init_array (int m,
static
void calc_error(int m,
DATA_TYPE POLYBENCH_2D(corr,M,M,m,m))
{
int i, j;
double error = 0;
double err = 0;
for (i = 0; i < m; i++)
for (j = 0; j < m; j++) {
error += (corr[i][j] - 1.0)*(corr[i][j] - 1.0);
double e = fabs(corr[i][j] - 1.0);
if(e > 1)
e = 1;
err += e;
}
error /= m*m;
printf("error: %f\n", error);
err /= m*m;
printf("error: %f\n", err);
}
/* DCE code. Must scan the entire live-out data.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment