Changeset a6f9577 in sasmodels for sasmodels/kernel_iq.c


Ignore:
Timestamp:
Mar 21, 2016 7:40:25 AM (8 years ago)
Author:
Paul Kienzle <pkienzle@…>
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:
9f4409a
Parents:
39cc3be
Message:

restore support for simple polydispersity (incomplete)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/kernel_iq.c

    r39cc3be ra6f9577  
    1818 
    1919typedef struct { 
    20     int32_t pd_par[MAX_PD];     // index of the nth polydispersity variable 
     20    int32_t pd_par[MAX_PD];     // id of the nth polydispersity variable 
    2121    int32_t pd_length[MAX_PD];  // length of the nth polydispersity weight vector 
    2222    int32_t pd_offset[MAX_PD];  // offset of pd weights in the par & weight vector 
     
    2525    int32_t par_offset[NPARS];  // offset of par values in the par & weight vector 
    2626    int32_t par_coord[NPARS];   // polydispersity coordination bitvector 
    27     int32_t fast_coord_index[NPARS]; // index of the fast coordination parameters 
     27    int32_t fast_coord_pars[NPARS]; // ids of the fast coordination parameters 
    2828    int32_t fast_coord_count;   // number of parameters coordinated with pd 1 
    2929    int32_t theta_var;          // id of spherical correction variable 
    30     int32_t fast_theta;         // true if spherical correction depends on pd 1 
    3130} ProblemDetails; 
    3231 
     
    5554  double *pvec = (double *)(&local_pars);  // Alias named parameters with a vector 
    5655 
    57   local int offset[NPARS-2]; 
     56  local int offset[NPARS];  // NPARS excludes scale/background 
    5857 
    5958#if 1 // defined(USE_SHORTCUT_OPTIMIZATION) 
     
    155154        spherical_correction = fabs(cos(M_PI_180*pvec[problem->theta_var])); 
    156155      } 
    157       if (!problem->fast_theta) { 
     156      if (problem->theta_var == problem->pd_par[0]) { 
    158157        weight *= spherical_correction; 
    159158      } 
     
    167166      if (problem->pd_isvol[0]) vol_weight *= wi; 
    168167      for (int k=0; k < problem->fast_coord_count; k++) { 
    169         pvec[problem->fast_coord_index[k]] 
    170             = pars[offset[problem->fast_coord_index[k]]++]; 
    171       } 
    172       if (problem->fast_theta) { 
     168        pvec[problem->fast_coord_pars[k]] 
     169            = pars[offset[problem->fast_coord_pars[k]]++]; 
     170      } 
     171      if (problem->theta_var ==problem->pd_par[0]) { 
    173172        weight *= fabs(cos(M_PI_180*pvec[problem->theta_var])); 
    174173      } 
Note: See TracChangeset for help on using the changeset viewer.