Changes in / [39c2de9:0168844] in sasmodels


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/kernel_iq.c

    r70530778 r7c35fda  
    8484  out_spin = clip(out_spin, 0.0, 1.0); 
    8585  // Previous version of this function took the square root of the weights, 
    86   // under the assumption that 
     86  // under the assumption that  
    8787  // 
    8888  //     w*I(q, rho1, rho2, ...) = I(q, sqrt(w)*rho1, sqrt(w)*rho2, ...) 
     
    188188    QACRotation *rotation, 
    189189    double qx, double qy, 
    190     double *qab_out, double *qc_out) 
     190    double *qa_out, double *qc_out) 
    191191{ 
     192    const double dqc = rotation->R31*qx + rotation->R32*qy; 
    192193    // 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; 
    197197    *qc_out = dqc; 
    198198} 
Note: See TracChangeset for help on using the changeset viewer.