Changeset 2f5c6d4 in sasmodels for sasmodels/models/capped_cylinder.c


Ignore:
Timestamp:
Jul 25, 2016 10:38:21 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:
a3a0c5c
Parents:
a4280bd
Message:

move valid parameter test to macro

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/capped_cylinder.c

    r26141cb r2f5c6d4  
    44double Iqxy(double qx, double qy, double sld, double solvent_sld, 
    55    double radius, double cap_radius, double length, double theta, double phi); 
     6 
     7#define INVALID(v) (v.cap_radius < v.radius) 
    68 
    79// Integral over a convex lens kernel for t in [h/R,1].  See the docs for 
     
    7981          double radius, double cap_radius, double length) 
    8082{ 
    81     // Exclude invalid inputs. 
    82     if (cap_radius < radius) return NAN; 
    8383    const double h = sqrt(cap_radius*cap_radius - radius*radius); 
    8484    const double half_length = 0.5*length; 
     
    121121    const double alpha = acos(cos_val); // rod angle relative to q 
    122122 
    123     // Exclude invalid inputs. 
    124     if (cap_radius < radius) return NAN; 
    125123    const double h = sqrt(cap_radius*cap_radius - radius*radius); 
    126124    const double half_length = 0.5*length; 
Note: See TracChangeset for help on using the changeset viewer.