Changeset e3a9733 in sasmodels
- Timestamp:
- Dec 23, 2015 10:05:05 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:
- cde11f0f
- Parents:
- 644430f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/kernel_template.c
rc138211 re3a9733 5 5 # define USE_OPENCL 6 6 #endif 7 8 #define USE_KAHAN_SUMMATION 0 7 9 8 10 // If opencl is not available, then we are compiling a C function … … 185 187 const double qxi = qx[i]; 186 188 const double qyi = qy[i]; 189 #if USE_KAHAN_SUMMATION 190 double accumulated_error = 0.0; 191 #endif 187 192 #ifdef IQXY_OPEN_LOOPS 188 193 double ret=0.0, norm=0.0; … … 207 212 // rather than theta in this correction. Current code uses cos(theta) 208 213 // so that values match those of sasview. 209 #if def IQXY_HAS_THETA214 #if defined(IQXY_HAS_THETA) // && 0 210 215 const double spherical_correction 211 = (Ntheta>1 ? fabs(cos(M_PI_180* theta))*M_PI_2:1.0);212 ret += spherical_correction * weight * scattering;216 = (Ntheta>1 ? fabs(cos(M_PI_180*phi))*M_PI_2:1.0); 217 const double next = spherical_correction * weight * scattering; 213 218 #else 214 ret += weight * scattering; 219 const double next = weight * scattering; 220 #endif 221 #if USE_KAHAN_SUMMATION 222 const double y = next - accumulated_error; 223 const double t = ret + y; 224 accumulated_error = (t - ret) - y; 225 ret = t; 226 #else 227 ret += next; 215 228 #endif 216 229 norm += weight;
Note: See TracChangeset
for help on using the changeset viewer.