Changeset c25f1fa in sasview for sansmodels/src/sans/models
- Timestamp:
- Nov 30, 2011 3:06:10 PM (13 years ago)
- Branches:
- master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- 533e745
- Parents:
- a807ffd
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sansmodels/src/sans/models/c_extensions/onion.c
ra807ffd rc25f1fa 9 9 // some details can be found in sld_cal.c 10 10 double so_kernel(double dp[], double q) { 11 constint n = dp[0];11 int n = dp[0]; 12 12 double scale = dp[1]; 13 13 double rad_core0 = dp[2]; … … 20 20 double pi; 21 21 double r0 = 0.0; 22 const array_size = n+2; 23 24 double sld_out[array_size]; 25 double slope[array_size]; 26 double sld_in[array_size]; 27 double thick[array_size]; 28 double A[array_size]; 29 int fun_type[array_size]; 30 22 23 double *sld_out; 24 double *slope; 25 double *sld_in; 26 double *thick; 27 double *A; 28 int *fun_type; 29 30 sld_out = (double*) malloc(n+2); 31 slope = (double*) malloc(n+2); 32 sld_in = (double*) malloc(n+2); 33 thick = (double*) malloc(n+2); 34 A = (double*) malloc(n+2); 35 fun_type = (int*) malloc(n+2); 31 36 32 37 for (i =1; i<=n; i++){ … … 164 169 f2 *= scale; 165 170 f2 += background; 171 172 free(sld_out); 173 free(slope); 174 free(sld_in); 175 free(thick); 176 free(A); 177 free(fun_type); 178 166 179 return (f2); 167 180 }
Note: See TracChangeset
for help on using the changeset viewer.