It was working fine like this:
Code:
boolean compare_matrices(double *matrixC, double *matrixD, int rows, int cols)^M
{
const double EPSILON = 0.0000000001;
int row, col;
boolean flag = FALSE;
for ( row = 0; row < rows; ++row )
{
for ( col = 0; col < cols; ++col )
{
int i = col * rows + row;
/* if((int)matrixD[i] != (int)matrixC[i]) */
if ( fabs(matrixD[i] - matrixC[i]) > EPSILON)
{
printf("matrixd, %8g, matrixC, %8g \n", matrixD[i], matrixC[i]);
flag = TRUE;
return flag;
}
}
}
return flag;
}
I was using a gcc compiler but needed to switch to an openMP enabled compiler - pgcc from the portland group. But now this doesn't work. Would I need to use some compiler flags here or something?
Thanks,
Colly.