22 #ifndef _LALATOMICDATATYPES_H 23 #define _LALATOMICDATATYPES_H 26 #include <lal/LALConfig.h> 27 #include <lal/LALStddef.h> 29 #if defined(__cplusplus) 60 #ifndef _NO_INT8_BY_LAL 66 #define XLAL_INIT_MEM(x) memset(&(x), 0, sizeof((x))) 69 #define XLAL_INIT_DECL(var, ...) var __VA_ARGS__; XLAL_INIT_MEM(var) 72 #define XLAL_NUM_ELEM(x) ( sizeof((x)) / sizeof((x)[0]) ) 74 #define XLAL_LAST_ELEM(x) (x)[ XLAL_NUM_ELEM(x) - 1 ] 87 #define LAL_INT8_C(c) INT64_C(c) 99 #define LAL_UINT8_C(c) UINT64_C(c) 109 #if !defined(__cplusplus) 110 # if __STDC_VERSION__ >= 199901L || (defined(__GNUC__) && !defined(__STRICT_ANSI__)) 111 # define _LAL_C99_COMPLEX_NUMBERS_ 115 #ifdef _LAL_C99_COMPLEX_NUMBERS_ 122 #define crectf(re, im) (((REAL4)(re)) + _Complex_I*((REAL4)(im))) 123 #define crect(re, im) (((REAL8)(re)) + _Complex_I*((REAL8)(im))) 124 #define cpolarf(r, th) (((REAL4)(r)) * cexpf(crectf(0, th))) 125 #define cpolar(r, th) (((REAL8)(r)) * cexp(crect(0, th))) 142 #include <gsl/gsl_complex.h> 149 COMPLEX8 z; GSL_SET_COMPLEX(&z, re, im);
return z;
153 COMPLEX16 z; GSL_SET_COMPLEX(&z, re, im);
return z;
157 COMPLEX8 z; GSL_SET_COMPLEX(&z, r*cos(th), r*sin(th));
return z;
161 COMPLEX16 z; GSL_SET_COMPLEX(&z, r*cos(th), r*sin(th));
return z;
164 #define crealf(z) GSL_REAL(z) 165 #define cimagf(z) GSL_IMAG(z) 166 #define creal(z) GSL_REAL(z) 167 #define cimag(z) GSL_IMAG(z) 178 #elif defined(__cplusplus) #define cpolar(r, th)
Construct a COMPLEX16 from polar modulus and argument.
#define crectf(re, im)
Construct a COMPLEX8 from real and imaginary parts.
int16_t INT2
Two-byte signed integer.
char CHAR
One-byte signed integer, see Headers LAL(Atomic)Datatypes.h for more details.
float complex COMPLEX8
Single-precision floating-point complex number (8 bytes total)
unsigned char UCHAR
One-byte unsigned integer, see Headers LAL(Atomic)Datatypes.h for more details.
float REAL4
Single precision real floating-point number (4 bytes).
uint64_t UINT8
Eight-byte unsigned integer; on some platforms this is equivalent to unsigned long int instead...
double REAL8
Double precision real floating-point number (8 bytes).
unsigned char BOOLEAN
Boolean logical type, see Headers LAL(Atomic)Datatypes.h for more details.
uint32_t UINT4
Four-byte unsigned integer.
uint16_t UINT2
Two-byte unsigned integer.
#define cpolarf(r, th)
Construct a COMPLEX8 from polar modulus and argument.
double complex COMPLEX16
Double-precision floating-point complex number (16 bytes total)
#define crect(re, im)
Construct a COMPLEX16 from real and imaginary parts.
int32_t INT4
Four-byte signed integer.
int64_t INT8
Eight-byte signed integer; on some platforms this is equivalent to long int instead.