Changeset 60eab2a in sasmodels for sasmodels/kernel_iq.c
- Timestamp:
- Mar 24, 2016 6:12:07 AM (8 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:
- 380e8c9
- Parents:
- e69b36f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/kernel_iq.c
r69aa451 r60eab2a 16 16 17 17 typedef struct { 18 #if MAX_PD > 0 18 19 int32_t pd_par[MAX_PD]; // id of the nth polydispersity variable 19 20 int32_t pd_length[MAX_PD]; // length of the nth polydispersity weight vector … … 21 22 int32_t pd_stride[MAX_PD]; // stride to move to the next index at this level 22 23 int32_t pd_isvol[MAX_PD]; // True if parameter is a volume weighting parameter 24 #endif // MAX_PD > 0 23 25 int32_t par_offset[NPARS]; // offset of par values in the value & weight vector 24 26 int32_t par_coord[NPARS]; // polydispersity coordination bitvector … … 52 54 double *pvec = (double *)(&local_values); // Alias named parameters with a vector 53 55 54 local int offset[NPARS]; // NPARS excludes scale/background 55 56 #if 0 // defined(USE_SHORTCUT_OPTIMIZATION) 56 #if MAX_PD > 0 57 57 if (problem->pd_length[0] == 1) { 58 #endif // MAX_PD > 0 58 59 // Shouldn't need to copy!! 59 60 60 for (int k=0; k < NPARS; k++) { 61 61 pvec[k] = values[k+2]; // skip scale and background … … 67 67 #endif 68 68 for (int i=0; i < nq; i++) { 69 const double scattering = CALL_IQ(q, i, local_values); 70 result[i] = values[0]*scattering/volume + values[1]; 69 double scattering = CALL_IQ(q, i, local_values); 70 if (volume != 0.0) scattering /= volume; 71 result[i] = values[0]*scattering + values[1]; 71 72 } 72 73 return; 73 } 74 printf("falling through\n"); 75 #endif 74 #if MAX_PD > 0 75 } 76 77 // polydispersity loop index positions 78 local int offset[NPARS]; // NPARS excludes scale/background 76 79 77 80 printf("Entering polydispersity\n"); … … 177 180 } 178 181 } 179 printf("rad len %f %f\n",local_values.radius, local_values.length);180 182 #ifdef INVALID 181 183 if (INVALID(local_values)) continue; … … 199 201 } 200 202 201 //Makes a normalization av ialable for the next round203 //Makes a normalization available for the next round 202 204 result[nq] = norm; 203 205 result[nq+1] = vol; … … 216 218 } 217 219 } 220 #endif // MAX_PD > 0 218 221 }
Note: See TracChangeset
for help on using the changeset viewer.