Changeset 139c528 in sasmodels


Ignore:
Timestamp:
Feb 26, 2016 12:44:42 PM (9 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:
3a45c2c
Parents:
e4d8726
Message:

slightly optimized capped cylinder

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/capped_cylinder.c

    rc138211 r139c528  
    2222    const double upper = 1.0; 
    2323    const double lower = h/cap_radius; // integral lower bound 
     24    const double zm = 0.5*(upper-lower); 
     25    const double zb = 0.5*(upper+lower); 
    2426    // cos term in integral is: 
    2527    //    cos (q (R t - h + L/2) cos(alpha)) 
     
    3638        // translate a point in [-1,1] to a point in [lower,upper] 
    3739        //const double t = ( Gauss76Z[i]*(upper-lower) + upper + lower )/2.0; 
    38         const double t = 0.5*(Gauss76Z[i]*(upper-lower)+upper+lower); 
     40        const double t = Gauss76Z[i]*zm + zb; 
    3941        const double radical = 1.0 - t*t; 
    4042        const double arg = qrst*sqrt(radical); // cap bessel function arg 
Note: See TracChangeset for help on using the changeset viewer.