Commit a8680173 authored by Leo P. Singer's avatar Leo P. Singer
Browse files

Fix wrong loop termination condition

Original: 116fb529b26eaadb0f05f7680a9a42e958e8cc35
parent 74d9bf80
......@@ -873,12 +873,12 @@ bayestar_pixel *bayestar_sky_map_toa_phoa_snr(
}
double max_accum2[3] = {-INFINITY, -INFINITY, -INFINITY};
for (long isample = 0; isample < 3; isample ++)
for (unsigned long isample = 0; isample < nsamples; isample ++)
for (unsigned char k = 0; k < 3; k ++)
if (accum2[isample][k] > max_accum2[k])
max_accum2[k] = accum2[isample][k];
double sum_accum2[3] = {0, 0, 0};
for (long isample = 0; isample < 3; isample ++)
for (unsigned long isample = 0; isample < nsamples; isample ++)
for (unsigned char k = 0; k < 3; k ++)
sum_accum2[k] += exp(accum2[isample][k] - max_accum2[k]);
for (unsigned char k = 0; k < 3; k ++)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment