Changeset c8902ac in sasmodels


Ignore:
Timestamp:
Dec 6, 2016 1:21:08 PM (7 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, core_shell_microgels, costrafo411, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
447e9aa
Parents:
1e13e35
Message:

rename j0,j1,jn to cephes_jx to avoid conflict with j0/j1/jn in math.h on some systems

Location:
sasmodels/models/lib
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/lib/sas_J0.c

    r1596de3 rc8902ac  
    5555#if FLOAT_SIZE>4 
    5656//Cephes double precission 
    57 double j0(double x); 
     57double cephes_j0(double x); 
    5858 
    5959 constant double PPJ0[8] = { 
     
    147147  }; 
    148148 
    149 double j0(double x) 
     149double cephes_j0(double x) 
    150150{ 
    151151    double w, z, p, q, xn; 
     
    186186#else 
    187187//Cephes single precission 
    188 float j0f(float x); 
     188float cephes_j0f(float x); 
    189189 
    190190 constant float MOJ0[8] = { 
     
    221221 }; 
    222222 
    223 float j0f(float x) 
     223float cephes_j0f(float x) 
    224224{ 
    225225    float xx, w, z, p, q, xn; 
     
    257257 
    258258#if FLOAT_SIZE>4 
    259 #define sas_J0 j0 
     259#define sas_J0 cephes_j0 
    260260#else 
    261 #define sas_J0 j0f 
     261#define sas_J0 cephes_j0f 
    262262#endif 
  • sasmodels/models/lib/sas_J1.c

    r1596de3 rc8902ac  
    4242#if FLOAT_SIZE>4 
    4343//Cephes double pression function 
    44 double j1(double x); 
     44double cephes_j1(double x); 
    4545 
    4646constant double RPJ1[8] = { 
     
    106106    0.0 }; 
    107107 
    108 double j1(double x) 
     108double cephes_j1(double x) 
    109109{ 
    110110 
     
    144144#else 
    145145//Single precission version of cephes 
    146 float j1f(float x); 
     146float cephes_j1f(float x); 
    147147 
    148148constant float JPJ1[8] = { 
     
    179179    }; 
    180180 
    181 float j1f(float x) 
     181float cephes_j1f(float x) 
    182182{ 
    183183 
     
    211211 
    212212#if FLOAT_SIZE>4 
    213 #define sas_J1 j1 
     213#define sas_J1 cephes_j1 
    214214#else 
    215 #define sas_J1 j1f 
     215#define sas_J1 cephes_j1f 
    216216#endif 
    217217 
  • sasmodels/models/lib/sas_JN.c

    r1596de3 rc8902ac  
    5050#if FLOAT_SIZE > 4 
    5151 
    52 double jn( int n, double x ); 
    53 double jn( int n, double x ) { 
     52double cephes_jn( int n, double x ); 
     53double cephes_jn( int n, double x ) { 
    5454 
    5555    // PAK: seems to be machine epsilon/2 
     
    7575 
    7676    if( n == 0 ) 
    77         return( sign * j0(x) ); 
     77        return( sign * cephes_j0(x) ); 
    7878    if( n == 1 ) 
    79         return( sign * j1(x) ); 
     79        return( sign * cephes_j1(x) ); 
    8080    if( n == 2 ) 
    81         return( sign * (2.0 * j1(x) / x  -  j0(x)) ); 
     81        return( sign * (2.0 * cephes_j1(x) / x  -  cephes_j0(x)) ); 
    8282 
    8383    if( x < MACHEP ) 
     
    112112 
    113113    if( fabs(pk) > fabs(pkm1) ) 
    114         ans = j1(x)/pk; 
     114        ans = cephes_j1(x)/pk; 
    115115    else 
    116         ans = j0(x)/pkm1; 
     116        ans = cephes_j0(x)/pkm1; 
    117117 
    118118    return( sign * ans ); 
     
    121121#else 
    122122 
    123 float jnf(int n, float x); 
    124 float jnf(int n, float x) 
     123float cephes_jnf(int n, float x); 
     124float cephes_jnf(int n, float x) 
    125125{ 
    126126    // PAK: seems to be machine epsilon/2 
     
    146146 
    147147    if( n == 0 ) 
    148         return( sign * j0f(x) ); 
     148        return( sign * cephes_j0f(x) ); 
    149149    if( n == 1 ) 
    150         return( sign * j1f(x) ); 
     150        return( sign * cephes_j1f(x) ); 
    151151    if( n == 2 ) 
    152         return( sign * (2.0 * j1f(x) / x  -  j0f(x)) ); 
     152        return( sign * (2.0 * cephes_j1f(x) / x  -  cephes_j0f(x)) ); 
    153153 
    154154    if( x < MACHEP ) 
     
    189189 
    190190    if( r > ans )  /* if( fabs(pk) > fabs(pkm1) ) */ 
    191         ans = sign * j1f(x)/pk; 
     191        ans = sign * cephes_j1f(x)/pk; 
    192192    else 
    193         ans = sign * j0f(x)/pkm1; 
     193        ans = sign * cephes_j0f(x)/pkm1; 
    194194    return( ans ); 
    195195} 
     
    197197 
    198198#if FLOAT_SIZE>4 
    199 #define sas_JN jn 
     199#define sas_JN cephes_jn 
    200200#else 
    201 #define sas_JN jnf 
     201#define sas_JN cephes_jnf 
    202202#endif 
Note: See TracChangeset for help on using the changeset viewer.