Changeset 3c97ff0 in sasmodels for sasmodels/models/cylinder.c


Ignore:
Timestamp:
Jan 6, 2016 7:23:47 PM (8 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, core_shell_microgels, costrafo411, magnetic_model, release_v0.94, release_v0.95, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
3f832f9
Parents:
74667d3
Message:

code tidying

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/cylinder.c

    ref2861b r3c97ff0  
    3333        // translate a point in [-1,1] to a point in [lower,upper] 
    3434        //const double alpha = ( Gauss76Z[i]*(upper-lower) + upper + lower )/2.0; 
    35         const double alpha = 0.5*(Gauss76Z[i]*M_PI_2 + M_PI_2); 
     35        const double alpha = M_PI_4*(Gauss76Z[i] + 1.0); 
    3636        double sn, cn; 
    3737        SINCOS(alpha, sn, cn); 
    3838        // For a bit of efficiency, we are moving the 2 V delta rho constant 
    39         // factor, 2Vd, out of the loop, so this is fq/2Vd rather than fq. 
     39        // factor, 2Vdrho, out of the loop, so this is fq/2Vdrho rather than fq. 
    4040        const double fq = _cyl(qr*sn, qh*cn); 
    4141        total += Gauss76Wt[i] * fq * fq * sn; 
     
    4343    // translate dx in [-1,1] to dx in [lower,upper] 
    4444    //const double form = (upper-lower)/2.0*total; 
    45     const double twovd = 2.0*(sld-solvent_sld)*form_volume(radius, length); 
    46     return 1.0e-4 * twovd * twovd * total * M_PI_4; 
     45    const double twoVdrho = 2.0*(sld-solvent_sld)*form_volume(radius, length); 
     46    return 1.0e-4 * twoVdrho * twoVdrho * total * M_PI_4; 
    4747} 
    4848 
Note: See TracChangeset for help on using the changeset viewer.