Changeset 398aa94 in sasmodels
- Timestamp:
- Apr 6, 2016 5:19:56 PM (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:
- ee8f734
- Parents:
- 3fb3449
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/kernel_iq.c
r5ff1b03 r398aa94 84 84 85 85 const double norm = CALL_VOLUME(local_values); 86 const double scale = values[0]; 87 const double background = values[1]; 86 88 #ifdef USE_OPENMP 87 89 #pragma omp parallel for … … 90 92 for (int i=0; i < nq; i++) { 91 93 double scattering = CALL_IQ(q, i, local_values); 92 result[i] = values[0]*scattering/norm + values[1];94 result[i] = (norm>0. ? scale*scattering/norm + background : background); 93 95 } 94 96 return; … … 203 205 } 204 206 205 // Make normalization available for the next round207 // Accumulate norm. 206 208 result[nq] += norm; 207 209 208 210 // End of the PD loop we can normalize 209 211 if (pd_stop >= problem->total_pd) { 212 const double scale = values[0]; 213 const double background = values[1]; 210 214 #ifdef USE_OPENMP 211 215 #pragma omp parallel for 212 216 #endif 213 217 for (int i=0; i < nq; i++) { 214 result[i] = values[0]*result[i]/norm + values[1];218 result[i] = (norm>0. ? scale*scattering/norm + background : background); 215 219 } 216 220 }
Note: See TracChangeset
for help on using the changeset viewer.