Changeset 994d77f in sasmodels for sasmodels/models/sphere.py


Ignore:
Timestamp:
Oct 30, 2014 12:33:53 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:
ef2861b
Parents:
d087487b
Message:

Convert double to float rather than using real

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/sphere.py

    r19dcb933 r994d77f  
    8686# This should perhaps be volume normalized? 
    8787form_volume = """ 
    88     return REAL(1.333333333333333)*M_PI*radius*radius*radius; 
     88    return 1.333333333333333*M_PI*radius*radius*radius; 
    8989    """ 
    9090 
    9191Iq = """ 
    92     const real qr = q*radius; 
    93     real sn, cn; 
     92    const double qr = q*radius; 
     93    double sn, cn; 
    9494    SINCOS(qr, sn, cn); 
    95     const real bes = qr==REAL(0.0) ? REAL(1.0) : REAL(3.0)*(sn-qr*cn)/(qr*qr*qr); 
    96     const real fq = bes * (sld - solvent_sld) * form_volume(radius); 
    97     return REAL(1.0e-4)*fq*fq; 
     95    const double bes = qr==0.0 ? 1.0 : 3.0*(sn-qr*cn)/(qr*qr*qr); 
     96    const double fq = bes * (sld - solvent_sld) * form_volume(radius); 
     97    return 1.0e-4*fq*fq; 
    9898    """ 
    9999 
     
    101101Iqxy = """ 
    102102    // never called since no orientation or magnetic parameters. 
    103     return REAL(-1.0); 
     103    //return -1.0; 
     104    return Iq(sqrt(qx*qx + qy*qy), sld, solvent_sld, radius); 
    104105    """ 
    105106 
Note: See TracChangeset for help on using the changeset viewer.