Changeset 2773c66 in sasmodels for sasmodels/kernel_iq.c


Ignore:
Timestamp:
Sep 8, 2018 10:29:05 AM (6 years ago)
Author:
Torin Cooper-Bennun <torin.cooper-bennun@…>
Branches:
master, core_shell_microgels, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
ba51e00
Parents:
b763f9d (diff), c88f983 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'beta_approx' into beta_approx_new_R_eff

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/kernel_iq.c

    rc57ee9e r2773c66  
    192192    QACRotation *rotation, 
    193193    double qx, double qy, 
    194     double *qa_out, double *qc_out) 
     194    double *qab_out, double *qc_out) 
    195195{ 
     196    // Indirect calculation of qab, from qab^2 = |q|^2 - qc^2 
    196197    const double dqc = rotation->R31*qx + rotation->R32*qy; 
    197     // Indirect calculation of qab, from qab^2 = |q|^2 - qc^2 
    198     const double dqa = sqrt(-dqc*dqc + qx*qx + qy*qy); 
    199  
    200     *qa_out = dqa; 
     198    const double dqab_sq = -dqc*dqc + qx*qx + qy*qy; 
     199    //*qab_out = sqrt(fabs(dqab_sq)); 
     200    *qab_out = dqab_sq > 0.0 ? sqrt(dqab_sq) : 0.0; 
    201201    *qc_out = dqc; 
    202202} 
Note: See TracChangeset for help on using the changeset viewer.