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

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

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

File size: 3.0 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 p2;
43        double p1;              // start and stop of the outer index
44        double binWidth;
45        double grid;
46        waveHndl bwavH; // bin wave
47        waveHndl zwavH; // z coordinate. ALL are expected to be DP waves
48        waveHndl ywavH; // y coordinate.
49        waveHndl xwavH; // x coordinate.
50        void* tp;                       //unused void for threadsafe functions
51        double result;
52}BinParam, *BinParamPtr;   
53
54// Parameters passed from Igor to the function, in reverse order of the parameter list
55// result is the last parameter, always.
56typedef struct BinSLDParam {
57        double p2;
58        double p1;              // start and stop of the outer index
59        double binWidth;
60        double grid;
61        waveHndl PSFidH;        // psf id matrix, this is 2D
62        waveHndl SLDLookH;      // SLD lookup wave, this is 1D
63        waveHndl bwavH; // bin wave, this is 2D
64        waveHndl rhowavH;               //rho @ XYZ
65        waveHndl zwavH; // z coordinate. ALL are expected to be DP waves
66        waveHndl ywavH; // y coordinate.
67        waveHndl xwavH; // x coordinate.
68        void* tp;                       //unused void for threadsafe functions
69        double result;
70}BinSLDParam, *BinSLDParamPtr;   
71
72
73// Parameters passed from Igor to the function, in reverse order of the parameter list
74// result is the last parameter, always.
75typedef struct SobolParam {
76        waveHndl bwavH; // result wave
77        double nIn;             // initialization, or dimension - this is really an int
78        //      void* tp;                       //unused void for threadsafe functions
79        double result;
80}SobolParam, *SobolParamPtr;   
81
82
83
84#include "XOPStructureAlignmentReset.h"
85
86
87double PhiQR(double qval, double rval);
88double XYZDistance(double x1, double x2,double y1, double y2,double z1, double z2);
89int DebyeSpheresX(AltiParamsPtr p);
90int maxDistanceX(DistParamPtr p);
91int binDistanceX(BinParamPtr p);
92int binSLDDistanceX(BinSLDParamPtr p);
93int SobolX(SobolParamPtr p);
94
Note: See TracBrowser for help on using the repository browser.