NAMD
TestArray.h
Go to the documentation of this file.
1 #ifndef TEST_ARRAY_H
2 #define TEST_ARRAY_H
3 
4 #include <type_traits>
5 
6 void NAMD_die(const char *);
7 
9  const char *filename,
10  const char *label,
11  const void *array,
12  int elemsize,
13  int length,
14  int isfp
15  );
16 
31 template <typename T>
33  const char *filename,
34  const char *label,
35  const T *array,
36  int length
37  ) {
38  if ( ! std::is_arithmetic<T>::value ) {
39  NAMD_die("Called TestArray_write with non-aritmetic type");
40  }
41  int isfp = std::is_floating_point<T>::value;
42  return TestArray_write_helper(filename, label,
43  (const void *)array, sizeof(T), length, isfp);
44 }
45 
46 #endif
int TestArray_write_helper(const char *filename, const char *label, const void *array, int elemsize, int length, int isfp)
Definition: TestArray.C:10
void NAMD_die(const char *err_msg)
Definition: common.C:85
int TestArray_write(const char *filename, const char *label, const T *array, int length)
Definition: TestArray.h:32