Changeset 3a48772 in sasmodels for sasmodels/models/lib/gfn.c


Ignore:
Timestamp:
Oct 14, 2016 3:23:40 PM (8 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, core_shell_microgels, costrafo411, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
a5b6997
Parents:
b716cc6
Message:

use predefined constants for fractions of pi

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/lib/gfn.c

    r177c1a1 r3a48772  
    1212{ 
    1313    // local variables 
    14     const double pi43=4.0/3.0*M_PI; 
    1514    const double aa = crmaj; 
    1615    const double bb = crmin; 
     
    2019    //const double siq = (uq == 0.0 ? 1.0 : 3.0*(sin(uq)/uq/uq - cos(uq)/uq)/uq); 
    2120    const double siq = sph_j1c(uq); 
    22     const double vc = pi43*aa*aa*bb; 
     21    const double vc = M_4PI_3*aa*aa*bb; 
    2322    const double gfnc = siq*vc*delpc; 
    2423 
    2524    const double ut2 = (trmin*trmin*xx*xx + trmaj*trmaj*(1.0-xx*xx)); 
    2625    const double ut= sqrt(ut2)*qq; 
    27     const double vt = pi43*trmaj*trmaj*trmin; 
     26    const double vt = M_4PI_3*trmaj*trmaj*trmin; 
    2827    //const double sit = (ut == 0.0 ? 1.0 : 3.0*(sin(ut)/ut/ut - cos(ut)/ut)/ut); 
    2928    const double sit = sph_j1c(ut); 
     
    3332    const double result = tgfn*tgfn; 
    3433 
    35     return (result); 
     34    return result; 
    3635} 
Note: See TracChangeset for help on using the changeset viewer.