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

Last change on this file since 623 was 623, checked in by srkline, 13 years ago

Updated the MonteCarlo? code to allow 4 processors, but simply copying the function 4 times, and defining 4 different random number generators. Still can't figure out what the problem is with threading a single version, but not worth the effort. Copy/paste is way faster.

Also added some simple (non-optimized) calculations for using Debye's sphere method. These are largely undocumented at this point - so see the code. These are XOP versions of the old ipf code I've used in the past, and stripped of the now-obsolete AltiVec? code (I now lose the 4x speedup from the vectorization...)

File size: 894 bytes
2 *
3 *  Created by Steve Kline on Tue Dec 15 2009.
4 *  Copyright (c) 2009 NCNR. All rights reserved.
5 *
6 */
8#include <Carbon/Carbon.h>
9#include <stdio.h>
11// Parameters passed from Igor to the function, in reverse order of the parameter list
12// result is the last parameter, always.
13typedef struct AltiParams {
14    DOUBLE       grid;          // effective c-to-c distance between spheres = 0.62*Rprimary
15    DOUBLE   Rprimary;  //primary sphere radius
16        waveHndl rhowavH;       // rho at xyz!!!
17        waveHndl zwavH; // z coordinate. ALL are expected to be SP waves
18        waveHndl ywavH; // y coordinate.
19        waveHndl xwavH; // x coordinate.
20    DOUBLE qval;        // q-value.
21        void* tp;                       //unused void for threadsafe functions
22        DOUBLE result;
23}AltiParams, *AltiParamsPtr;   
26float PhiQR(float qval, float rval);
27float XYZDistance(float x1, float x2,float y1, float y2,float z1, float z2);
28int DebyeSpheresX(AltiParamsPtr p);
Note: See TracBrowser for help on using the repository browser.