A checker(of type double) array is obtained from a gsl_vector in the following way.
for (i=0; i<M; i++)
{
checker[i] = (double)gsl_vector_get(check, i);
printf(" %f", checker[i]);
}
Array checker has [ 3.000000 -3.000000 -11.000000 -5.000000 ]
elements after the above operation (from the output of the above program).
I am facing a weird problem now.
for (i=0; i<M; i++)
{
printf("checker: %f\n", checker[i]);
if(checker[0] == 3.00)
{
printf("Inside If: %f\n", checker[i]);
}
}
The above code outputs
checker: 3.000000
checker: -3.000000
checker: -11.000000
checker: -5.000000
As seen, the if
loop inside for
is not executed. What could be the problem?
Edit: The above problem is gone when I directly copied [ 3.000000 -3.000000 -11.000000 -5.000000 ]
into the checker Array instead of the gsl_vector_get(check,i)
. Check value comes from dgmev
function where a matrix and a vector are multiplied.
Thanks