Ignore:
Timestamp:
Feb 16, 2011 5:39:25 PM (12 years ago)
Author:
srkline
Message:

Adding Threadsafe declarations to Debye Sphere functions to allow binning of distances to be threaded.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sans/XOP_Dev/MonteCarlo/DebyeSpheres.c

    r789 r790  
    241241    int npt,numBins,binIndex; 
    242242        double grid,binWidth,val; 
     243        int p1,p2; 
    243244         
    244245         
     
    283284    npt = (int) WavePoints(p->xwavH);   //wavePoints returns long, number of XYZ points 
    284285    numBins = (int) WavePoints(p->bwavH);       //wavePoints returns long, number of points in bin wave 
     286        p1 = (int) p->p1; 
     287        p2 = (int) p->p2; 
     288         
    285289         
    286290        xv = WaveData(p->xwavH);                //xyz locations 
     
    293297         
    294298        //do the i!=j double loop,       
    295         for(i=0;i<npt;i+=1) { 
     299        for(i=p1;i<p2;i+=1) { 
    296300                for(j=(i+1);j<npt;j+=1) { 
    297301                        val = XYZDistance(xv[i],xv[j],yv[i],yv[j],zv[i],zv[j])*grid; 
     
    329333    int npt,numBins,binIndex; 
    330334        double grid,binWidth,val,retVal; 
     335        int p1,p2; 
     336 
    331337         
    332338// for accessing the 2D wave data to write the results   
     
    418424        PSFid = WaveData(p->PSFidH);                    //this one is 2D 
    419425         
     426        p1 = (int) p->p1; 
     427        p2 = (int) p->p2; 
     428         
    420429        grid = p->grid; 
    421430        binWidth = p->binWidth; 
    422431         
    423432        //do the i!=j double loop,       
    424         for(i=0;i<npt;i+=1) { 
     433        for(i=p1;i<p2;i+=1) { 
    425434                for(j=(i+1);j<npt;j+=1) { 
    426435                        val = XYZDistance(xv[i],xv[j],yv[i],yv[j],zv[i],zv[j])*grid; 
Note: See TracChangeset for help on using the changeset viewer.