/* data.h (C) 1997 Mark A. Livingston */ /* Any non-commercial use of this code is permitted so long as */ /* the above copyright line appears in the file. Please contact */ /* the author regarding permission for commercial use. */ /* Allocation macros for reducing typing */ #define NEWXYZQUAT(n) (q_xyz_quat_type *) malloc((n)*sizeof( q_xyz_quat_type )) #define NEWVEC(n) ( q_vec_type * ) malloc( (n) * sizeof( q_vec_type ) ) #define NEWQUAT(n) ( q_type * ) malloc( (n) * sizeof( q_type ) ) #define NEWDOUBLE(n) ( double * ) malloc( (n) * sizeof( double ) ) /* Addressing macro for centralization */ #define INDEX(i,j,k,x,y,z) ( ( ( i * y + j ) * z ) + k ) /* mathematical macros for the kernel */ #define TWOPI 6.28318530717958647692 #define SQR(a) ( (a) * (a) ) /* the table */ typedef struct { int enoughData; q_vec_type loc; q_xyz_quat_type error; } TableNode; /* function declarations for data.c */ int RejectionTest( ConfigRec *cR, double d1, double d2, double a1, double a2, int *tot ); double KernelValue( double sigma, double dist ); int ReadDataFiles( ConfigRec *cR, q_xyz_quat_type *b, q_xyz_quat_type *a );