Changes in / [39c2de9:0168844] in sasmodels
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/kernel_iq.c
r70530778 r7c35fda 84 84 out_spin = clip(out_spin, 0.0, 1.0); 85 85 // Previous version of this function took the square root of the weights, 86 // under the assumption that 86 // under the assumption that 87 87 // 88 88 // w*I(q, rho1, rho2, ...) = I(q, sqrt(w)*rho1, sqrt(w)*rho2, ...) … … 188 188 QACRotation *rotation, 189 189 double qx, double qy, 190 double *qa b_out, double *qc_out)190 double *qa_out, double *qc_out) 191 191 { 192 const double dqc = rotation->R31*qx + rotation->R32*qy; 192 193 // Indirect calculation of qab, from qab^2 = |q|^2 - qc^2 193 const double dqc = rotation->R31*qx + rotation->R32*qy; 194 const double dqab_sq = -dqc*dqc + qx*qx + qy*qy; 195 //*qab_out = sqrt(fabs(dqab_sq)); 196 *qab_out = dqab_sq > 0.0 ? sqrt(dqab_sq) : 0.0; 194 const double dqa = sqrt(-dqc*dqc + qx*qx + qy*qy); 195 196 *qa_out = dqa; 197 197 *qc_out = dqc; 198 198 }
Note: See TracChangeset
for help on using the changeset viewer.