source: sans/XOP_Dev/MonteCarlo/DebyeSpheres.h @ 789

Last change on this file since 789 was 789, checked in by srkline, 12 years ago

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 size: 2.9 KB
Line 
1/*
2 *
3 *  Created by Steve Kline on Tue Dec 15 2009.
4 *  Copyright (c) 2009 NCNR. All rights reserved.
5 *
6 */
7
8//#include <Carbon/Carbon.h>
9#include <stdio.h>
10
11// All structures passed to Igor are two-byte aligned.
12#include "XOPStructureAlignmentTwoByte.h"
13
14// Parameters passed from Igor to the function, in reverse order of the parameter list
15// result is the last parameter, always.
16typedef struct AltiParams {
17    double       grid;          // effective c-to-c distance between spheres = 0.62*Rprimary
18    double   Rprimary;  //primary sphere radius
19        waveHndl rhowavH;       // rho at xyz!!!
20        waveHndl zwavH; // z coordinate. ALL are expected to be DP waves
21        waveHndl ywavH; // y coordinate.
22        waveHndl xwavH; // x coordinate.
23    double qval;        // q-value.
24        void* tp;                       //unused void for threadsafe functions
25        double result;
26}AltiParams, *AltiParamsPtr;   
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
83double PhiQR(double qval, double rval);
84double XYZDistance(double x1, double x2,double y1, double y2,double z1, double z2);
85int DebyeSpheresX(AltiParamsPtr p);
86int maxDistanceX(DistParamPtr p);
87int binDistanceX(BinParamPtr p);
88int binSLDDistanceX(BinSLDParamPtr p);
89int SobolX(SobolParamPtr p);
90
Note: See TracBrowser for help on using the repository browser.