forked from marcuspetschlies/cvc
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathio_utils.h
More file actions
37 lines (30 loc) · 1.29 KB
/
io_utils.h
File metadata and controls
37 lines (30 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#ifndef _IO_UTILS_H
#define _IO_UTILS_H
namespace cvc {
#ifndef isnan
# define isnan(x) \
(sizeof (x) == sizeof (long double) ? isnan_ld (x) \
: sizeof (x) == sizeof (double) ? isnan_d (x) \
: isnan_f (x))
#endif
typedef void* (*copy_function)(void* out_ptr, void* in_ptr, int nmemb);
int isnan_f (float x);
int isnan_d (double x);
int isnan_ld (long double x);
void byte_swap(void *ptr, int nmemb);
void byte_swap_double(void *ptr, int nmemb);
inline void* byte_swap_assign(void * out_ptr, void * in_ptr, int nmemb);
inline void* byte_swap_assign_singleprec(void * out_ptr, void * in_ptr, int nmemb);
inline void* byte_swap_assign_single2double(void * out_ptr, void * in_ptr, int nmemb);
inline void* single2double(void * out_ptr, void * in_ptr, int nmemb);
inline void* byte_swap_assign_double2single(void * out_ptr, void * in_ptr, int nmemb);
inline void* double2single(void * out_ptr, void * in_ptr, int nmemb);
int big_endian();
int write_ildg_format_xml(char *filename, LimeWriter * limewriter, const int precision);
void single2double_cm(double * const R, float * const S);
void double2single_cm(float * const S, double * const R);
void zero_spinor(double * const R);
void byte_swap64(void * ptr, int nmemb);
void byte_swap64_v2(double *ptr, unsigned int nmemb);
}
#endif