Changeset 510e7ad in sasview for sansmodels/src/sans/models


Ignore:
Timestamp:
Mar 10, 2011 9:40:05 AM (13 years ago)
Author:
Jae Cho <jhjcho@…>
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:
d4bf55e9
Parents:
729bcf6
Message:

made correct way of slit_smear w/ height and width non zeros

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sansmodels/src/sans/models/c_smearer/smearer.cpp

    r642b259 r510e7ad  
    265265                                                // At the edge of each sub_width. weight += u(at q_high bin) - u(0), where u(0) = 0, 
    266266                                                // and weighted by (2.0* npts_w -1.0)once for each q. 
    267                                                 if (q == q_j) { 
    268                                                         if (k==0) 
    269                                                                 (*weights)[i*nbins+j] += (sqrt(fabs((q_high)*(q_high)-q_shift * q_shift)))/q_0 * (2.0*double(npts_w)-1.0); 
     267                                                //if (q == q_j) { 
     268                                                if (q_low <= q_shift && q_high > q_shift) { 
     269                                                        //if (k==0) 
     270                                                                (*weights)[i*nbins+j] += (sqrt(fabs((q_high)*(q_high)-q_shift * q_shift)))/q_0;// * (2.0*double(npts_w)-1.0); 
    270271                                                } 
    271272                                                // For the rest of sub_width. weight += u(at q_high bin) - u(at q_low bin) 
    272                                                 else if (u > 0.0){ 
     273                                                else{// if (u > 0.0){ 
    273274                                                        (*weights)[i*nbins+j] += (sqrt(fabs((q_high)*(q_high)- q_shift * q_shift))-sqrt(fabs((q_low)*(q_low)- q_shift * q_shift)))/q_0 ; 
    274275                                                } 
     
    298299                        // Compute the fraction of the Gaussian contributing 
    299300                        // to the q_j bin between q_jmin and q_jmax 
    300                         double value =  erf( (q_jmax-q)/(sqrt(2.0)*width[i]) ); 
     301                        long double value =  erf( (q_jmax-q)/(sqrt(2.0)*width[i]) ); 
    301302                value -= erf( (q_jmin-q)/(sqrt(2.0)*width[i]) ); 
    302303                (*weights)[i*nbins+j] += value; 
Note: See TracChangeset for help on using the changeset viewer.