Ignore:
Timestamp:
Feb 10, 2011 1:33:02 PM (12 years ago)
Author:
srkline
Message:

Added XOP-ized functions for doing the distance-binned Debye Spheres calculation. Two versions are added, one that includes the SLDs and one that does not.

Also added a pseudo-random sequence generator, SobolX, that will generate pseudo-random 2D or 3D distributions. This fills space more uniformly than a random generation.

File:
1 edited

Legend:

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

    r758 r789  
    99#include <stdio.h> 
    1010 
     11// All structures passed to Igor are two-byte aligned. 
     12#include "XOPStructureAlignmentTwoByte.h" 
     13 
    1114// Parameters passed from Igor to the function, in reverse order of the parameter list 
    1215// result is the last parameter, always. 
     
    1518    double   Rprimary;  //primary sphere radius 
    1619        waveHndl rhowavH;       // rho at xyz!!! 
    17         waveHndl zwavH; // z coordinate. ALL are expected to be SP waves 
     20        waveHndl zwavH; // z coordinate. ALL are expected to be DP waves 
    1821        waveHndl ywavH; // y coordinate. 
    1922        waveHndl xwavH; // x coordinate. 
     
    2225        double result; 
    2326}AltiParams, *AltiParamsPtr;    
    24   
    25   
     27 
     28 
     29// Parameters passed from Igor to the function, in reverse order of the parameter list 
     30// result is the last parameter, always. 
     31typedef struct DistParam { 
     32        waveHndl zwavH; // z coordinate. ALL are expected to be DP waves 
     33        waveHndl ywavH; // y coordinate. 
     34        waveHndl xwavH; // x coordinate. 
     35//      void* tp;                       //unused void for threadsafe functions 
     36        double result; 
     37}DistParam, *DistParamPtr;    
     38 
     39// Parameters passed from Igor to the function, in reverse order of the parameter list 
     40// result is the last parameter, always. 
     41typedef struct BinParam { 
     42        double binWidth; 
     43        double grid; 
     44        waveHndl bwavH; // bin wave 
     45        waveHndl zwavH; // z coordinate. ALL are expected to be DP waves 
     46        waveHndl ywavH; // y coordinate. 
     47        waveHndl xwavH; // x coordinate. 
     48        //      void* tp;                       //unused void for threadsafe functions 
     49        double result; 
     50}BinParam, *BinParamPtr;    
     51 
     52// Parameters passed from Igor to the function, in reverse order of the parameter list 
     53// result is the last parameter, always. 
     54typedef struct BinSLDParam { 
     55        double binWidth; 
     56        double grid; 
     57        waveHndl PSFidH;        // psf id matrix, this is 2D 
     58        waveHndl SLDLookH;      // SLD lookup wave, this is 1D 
     59        waveHndl bwavH; // bin wave, this is 2D 
     60        waveHndl rhowavH;               //rho @ XYZ 
     61        waveHndl zwavH; // z coordinate. ALL are expected to be DP waves 
     62        waveHndl ywavH; // y coordinate. 
     63        waveHndl xwavH; // x coordinate. 
     64        //      void* tp;                       //unused void for threadsafe functions 
     65        double result; 
     66}BinSLDParam, *BinSLDParamPtr;    
     67 
     68 
     69// Parameters passed from Igor to the function, in reverse order of the parameter list 
     70// result is the last parameter, always. 
     71typedef struct SobolParam { 
     72        waveHndl bwavH; // result wave 
     73        double nIn;             // initialization, or dimension - this is really an int 
     74        //      void* tp;                       //unused void for threadsafe functions 
     75        double result; 
     76}SobolParam, *SobolParamPtr;    
     77 
     78 
     79 
     80#include "XOPStructureAlignmentReset.h" 
     81 
     82 
    2683double PhiQR(double qval, double rval); 
    2784double XYZDistance(double x1, double x2,double y1, double y2,double z1, double z2); 
    2885int DebyeSpheresX(AltiParamsPtr p); 
     86int maxDistanceX(DistParamPtr p); 
     87int binDistanceX(BinParamPtr p); 
     88int binSLDDistanceX(BinSLDParamPtr p); 
     89int SobolX(SobolParamPtr p); 
     90 
Note: See TracChangeset for help on using the changeset viewer.