Changeset b966a96 in sasmodels for sasmodels/kernel_iq.c


Ignore:
Timestamp:
Jul 21, 2016 3:12:18 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:
6a0d6aa
Parents:
32e3c9b
Message:

better line numbers for compiler errors; tinycc support (mostly)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/kernel_iq.c

    r32e3c9b rb966a96  
    2929 
    3030typedef struct { 
    31     PARAMETER_TABLE; 
     31    PARAMETER_TABLE 
    3232} ParameterBlock; 
    3333#endif 
     
    4141static double clip(double value, double low, double high) 
    4242{ 
    43     return (value < low ? low : (value > high ? high : value)); 
     43  return (value < low ? low : (value > high ? high : value)); 
    4444} 
    4545 
     
    5353    double *uu, double *dd, double *ud, double *du) 
    5454{ 
    55     in_spin = clip(in_spin, 0.0, 1.0); 
    56     out_spin = clip(out_spin, 0.0, 1.0); 
    57         *uu = sqrt(sqrt(in_spin * out_spin)); 
    58         *dd = sqrt(sqrt((1.0-in_spin) * (1.0-out_spin))); 
    59         *ud = sqrt(sqrt(in_spin * (1.0-out_spin))); 
    60         *du = sqrt(sqrt((1.0-in_spin) * out_spin)); 
     55  in_spin = clip(in_spin, 0.0, 1.0); 
     56  out_spin = clip(out_spin, 0.0, 1.0); 
     57  *uu = sqrt(sqrt(in_spin * out_spin)); 
     58  *dd = sqrt(sqrt((1.0-in_spin) * (1.0-out_spin))); 
     59  *ud = sqrt(sqrt(in_spin * (1.0-out_spin))); 
     60  *du = sqrt(sqrt((1.0-in_spin) * out_spin)); 
    6161} 
    6262 
    6363// Convert polar to rectangular coordinates. 
    6464static void polrec(double r, double theta, double phi, 
    65     double *x, double *y, double *z) 
     65  double *x, double *y, double *z) 
    6666{ 
    67     double cos_theta, sin_theta, cos_phi, sin_phi; 
    68     SINCOS(theta*M_PI_180, sin_theta, cos_theta); 
    69     SINCOS(phi*M_PI_180, sin_phi, cos_phi); 
    70     *x = r * cos_theta * cos_phi; 
    71     *y = r * sin_theta; 
    72     *z = -r * cos_theta * sin_phi; 
     67  double cos_theta, sin_theta, cos_phi, sin_phi; 
     68  SINCOS(theta*M_PI_180, sin_theta, cos_theta); 
     69  SINCOS(phi*M_PI_180, sin_phi, cos_phi); 
     70  *x = r * cos_theta * cos_phi; 
     71  *y = r * sin_theta; 
     72  *z = -r * cos_theta * sin_phi; 
    7373} 
    7474#endif 
Note: See TracChangeset for help on using the changeset viewer.