The file dm.h
In order to maximize transportability of code across different
computers, the file dm.h in diffmic/c/util
provides several definitions.
- It does #include <sys/types.h>
so that one can refer to data
types that (unlike short int, int, or
long int which can vary in size from one compiler/processor
to another) are of known size on any machine,
like u_int16_t for a 16 bit unsigned integer,
and so on.
- It also includes the file endian.h so that
BYTE_ORDER is set to either
LITTLE_ENDIAN=1234 (such as on Intel processors)
or BIG_ENDIAN=4321 (such as on PowerPC and SPARC
processors)1.2.
- Depending on the presence or absence of the preprocessor
#define of DIST_FFT, it either includes
dist_fft.h or fftw3.h (see
Sec. 6.2).
- It defines dm_array_real
which is either float or double, according
to the absence or presence of the preprocessor #define
of DM_ARRAY_DOUBLE as described below.
- It defines dm_array_index_t which is an integer
large enough to index an entire complex 3D array. This is
presently set to u_int32_t. (Should this be set
to size_t?)
- It defines array structures dm_array_complex_struct,
dm_array_real_struct, and dm_array_byte_struct,
as described in Sec. 1.4.5.
- For complex arrays, it defines the macros
c_re() and c_im(), and memory allocation
routines, as described in
Sec. 1.4.4.
- It defines structures dm_adi_struct (see
Sec. 2.2.2), dm_spt_struct (see
Sec. 2.2.6), and dm_itn_struct (see
Sec. 2.2.7) containing parameters relevant
to different data or calculations.
Microscope User
2008-04-30