You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
float k2 = (float)(kx*kx+ky*ky);
if (k2==0) { continue;}
float phiK =0;
if (k2>0) phiK= jxjyatan2[ (ky+Mid-1)*End + kx+Mid-1]; phiK= atan2((float)ky,(float)kx);
I observe first that unless the computation of k2 overflows, it never produces a negative value, and that if it produces exactly zero then the last two lines are not reached.
In that case, it is not necessary to check explicitly at line 1245 whether k2 exceeds 0. More significantly, however, the value copied into phiK from jxjyatan2 is always immediately overwritten by the result of calling atan2(). This probably constitutes only a trivial performance problem as long as the computed index into jxjyatan2 is a valid one, but it begs the question of whether something else was intended here.
An analogous computation of phiQ appears deeper in the same loop nest, at lines 1255-1258. Comments analogous to the above apply to it.
The text was updated successfully, but these errors were encountered:
This is libEM/emdata_transform.cpp:1242-1245:
I observe first that unless the computation of
k2
overflows, it never produces a negative value, and that if it produces exactly zero then the last two lines are not reached.In that case, it is not necessary to check explicitly at line 1245 whether
k2
exceeds 0. More significantly, however, the value copied intophiK
fromjxjyatan2
is always immediately overwritten by the result of callingatan2()
. This probably constitutes only a trivial performance problem as long as the computed index intojxjyatan2
is a valid one, but it begs the question of whether something else was intended here.An analogous computation of
phiQ
appears deeper in the same loop nest, at lines 1255-1258. Comments analogous to the above apply to it.The text was updated successfully, but these errors were encountered: