Changeset 5c1d341 in sasmodels
- Timestamp:
- Jan 20, 2016 9:38:35 AM (9 years ago)
- 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:
- 9eaadb3
- Parents:
- 7ed702f
- Location:
- sasmodels/models
- Files:
-
- 4 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/models/surface_fractal.c
r513efc5 r5c1d341 10 10 double surface_dim, 11 11 double cutoff_length); 12 13 static double _gamln(double q)14 {15 // Lanczos approximation to the Gamma function.16 // Should be refactored out to lib/, if used elsewhere.17 double x,y,tmp,ser;18 double coeff[6]=19 {76.18009172947146, -86.50532032941677,20 24.01409824083091, -1.231739572450155,21 0.1208650973866179e-2,-0.5395239384953e-5};22 int j;23 24 y=x=q;25 tmp = x+5.5;26 tmp -= (x+0.5)*log(tmp);27 ser = 1.000000000190015;28 for (j=0; j<=5; j++) {29 y+=1.0;30 ser += coeff[j]/y;31 }32 return -tmp+log(2.5066282746310005*ser/x);33 }34 12 35 13 static double _surface_fractal_kernel(double q, … … 48 26 //calculate S(q) 49 27 mmo = 5.0 - surface_dim; 50 sq = exp( _gamln(mmo))*sin(-(mmo)*atan(q*cutoff_length));28 sq = exp(lanczos_gamma(mmo))*sin(-(mmo)*atan(q*cutoff_length)); 51 29 sq *= pow(cutoff_length, mmo); 52 30 sq /= pow((1.0 + (q*cutoff_length)*(q*cutoff_length)),(mmo/2.0)); -
sasmodels/models/surface_fractal.py
r513efc5 r5c1d341 90 90 91 91 92 source = ["lib/J1c.c", " surface_fractal.c"]92 source = ["lib/J1c.c", "lib/lanczos_gamma.c", "surface_fractal.c"] 93 93 94 94 demo = dict(scale=1, background=0,
Note: See TracChangeset
for help on using the changeset viewer.