Changeset 2f5c6d4 in sasmodels for sasmodels/models/barbell.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/barbell.c

    r26141cb r2f5c6d4  
    55        double bell_radius, double radius, double length, 
    66        double theta, double phi); 
     7 
     8#define INVALID(v) (v.bell_radius < v.radius) 
    79 
    810//barbell kernel - same as dumbell 
     
    5860          double bell_radius, double radius, double length) 
    5961{ 
    60     // Exclude invalid inputs. 
    61     if (bell_radius < radius) return NAN; 
    6262    const double h = -sqrt(bell_radius*bell_radius - radius*radius); 
    6363    const double half_length = 0.5*length; 
     
    100100    const double alpha = acos(cos_val); // rod angle relative to q 
    101101 
    102     // Exclude invalid inputs. 
    103     if (bell_radius < radius) return NAN; 
    104102    const double h = -sqrt(square(bell_radius) - square(radius)); 
    105103    const double half_length = 0.5*length; 
Note: See TracChangeset for help on using the changeset viewer.