00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00029 #ifndef __CCP4_TYPES
00030 #define __CCP4_TYPES
00031
00032 #include "ccp4_sysdep.h"
00033
00034 typedef unsigned short uint16;
00035 #ifdef SIXTEENBIT
00036 typedef unsigned long uint32;
00037 #else
00038 typedef unsigned int uint32;
00039 #endif
00040 typedef float float32;
00041 typedef unsigned char uint8;
00042
00046 union float_uint_uchar {
00047 float32 f;
00048 uint32 i;
00049 uint8 c[4];
00050 };
00051
00053 typedef char *pstr;
00054
00055
00056
00057 #ifndef FALSE
00058 #define FALSE 0
00059 #define TRUE 1
00060 #endif
00061
00065 typedef struct { double r;
00066 double i;
00067 } COMPLEX;
00072 typedef struct { double r;
00073 double phi;
00074 } POLAR;
00076
00077
00081 #ifndef SQR
00082 #define SQR(x) ((x)*(x))
00083 #endif
00084
00089 #ifndef DEGREE
00090 #define DEGREE(x) ((((x < 0)?(x)+2*M_PI:(x))*360)/(2*M_PI))
00091 #endif
00092
00097 #ifndef RADIAN
00098 #define RADIAN(x) ((((x<0)?(x)+360:(x))*2*M_PI)/360)
00099 #endif
00100
00104 #ifndef MAX
00105 #define MAX(x, y) (((x)>(y))?(x):(y))
00106 #endif
00107
00111 #ifndef MIN
00112 #define MIN(x, y) (((x)<(y))?(x):(y))
00113 #endif
00114
00118 #ifndef ABS
00119 #define ABS(x) (((x)<0)?-(x):(x))
00120 #endif
00121
00125 #ifndef SIGN
00126 #define SIGN(x) (((x)<0)?-1:1)
00127 #endif
00128
00129 #endif
00130
00131
00132
00133
00134
00135