summaryrefslogtreecommitdiff
path: root/include/compression
diff options
context:
space:
mode:
authorMagnus Lundborg <lundborg.magnus@gmail.com>2013-05-20 07:10:42 (GMT)
committerMagnus Lundborg <lundborg.magnus@gmail.com>2013-05-20 07:10:42 (GMT)
commit74c11f5f2026bb02385763fd96d41d1d6a5f989c (patch)
tree082aabc267ab563cf3feaff0af29bc8ded99ca2e /include/compression
parentc673e2e56c9ab6b4d475467fb752c6fa83d9bc41 (diff)
parent0f36e7de86f181eed7e49eedb3d66a0c6ab6f8cd (diff)
Merge branch 'master' of git.gromacs.org:tng
Merged conflicts. Conflicts: src/lib/tng_io.c
Diffstat (limited to 'include/compression')
-rw-r--r--include/compression/tng_compress.h68
-rw-r--r--include/compression/tng_compress_testing.h.in6
2 files changed, 69 insertions, 5 deletions
diff --git a/include/compression/tng_compress.h b/include/compression/tng_compress.h
index eefcfaa..0858952 100644
--- a/include/compression/tng_compress.h
+++ b/include/compression/tng_compress.h
@@ -19,11 +19,13 @@
#endif /* win32... */
#endif /* not defined USE_WINDOWS */
+#ifndef DECLSPECDLLEXPORT
#ifdef USE_WINDOWS
#define DECLSPECDLLEXPORT __declspec(dllexport)
-#else
+#else /* USE_WINDOWS */
#define DECLSPECDLLEXPORT
-#endif
+#endif /* USE_WINDOWS */
+#endif /* DECLSPECDLLEXPORT */
#ifdef __cplusplus
extern "C" {
@@ -52,7 +54,16 @@ char DECLSPECDLLEXPORT *tng_compress_pos(double *pos, int natoms, int nframes,
double desired_precision,
int speed, int *algo,
int *nitems);
+
+char DECLSPECDLLEXPORT *tng_compress_pos_float(float *pos, int natoms, int nframes,
+ float desired_precision,
+ int speed, int *algo,
+ int *nitems);
+char DECLSPECDLLEXPORT *tng_compress_pos_int(int *pos, int natoms, int nframes,
+ unsigned long prec_hi, unsigned long prec_lo,
+ int speed,int *algo,
+ int *nitems);
/* The tng_compress_pos_find_algo works the same as tng_compress_pos, but
it performs benchmarking to find the algorithms with the best
@@ -84,6 +95,17 @@ char DECLSPECDLLEXPORT *tng_compress_pos_find_algo(double *pos, int natoms, int
int speed,
int *algo,
int *nitems);
+
+char DECLSPECDLLEXPORT *tng_compress_pos_float_find_algo(float *pos, int natoms, int nframes,
+ float desired_precision,
+ int speed,
+ int *algo,
+ int *nitems);
+
+char DECLSPECDLLEXPORT *tng_compress_pos_int_find_algo(int *pos, int natoms, int nframes,
+ unsigned long prec_hi, unsigned long prec_lo,
+ int speed,int *algo,
+ int *nitems);
/* This returns the number of integers required for the storage of the algorithm
with the best compression ratio. */
@@ -98,6 +120,16 @@ char DECLSPECDLLEXPORT *tng_compress_vel(double *vel, int natoms, int nframes,
double desired_precision,
int speed, int *algo,
int *nitems);
+
+char DECLSPECDLLEXPORT *tng_compress_vel_float(float *vel, int natoms, int nframes,
+ float desired_precision,
+ int speed, int *algo,
+ int *nitems);
+
+char DECLSPECDLLEXPORT *tng_compress_vel_int(int *vel, int natoms, int nframes,
+ unsigned long prec_hi, unsigned long prec_lo,
+ int speed, int *algo,
+ int *nitems);
char DECLSPECDLLEXPORT *tng_compress_vel_find_algo(double *vel, int natoms, int nframes,
double desired_precision,
@@ -105,6 +137,18 @@ char DECLSPECDLLEXPORT *tng_compress_vel_find_algo(double *vel, int natoms, int
int *algo,
int *nitems);
+char DECLSPECDLLEXPORT *tng_compress_vel_float_find_algo(float *vel, int natoms, int nframes,
+ float desired_precision,
+ int speed,
+ int *algo,
+ int *nitems);
+
+char DECLSPECDLLEXPORT *tng_compress_vel_int_find_algo(int *vel, int natoms, int nframes,
+ unsigned long prec_hi, unsigned long prec_lo,
+ int speed,
+ int *algo,
+ int *nitems);
+
/* From a compressed block, obtain information about
whether it is a position or velocity block:
*vel=1 means velocity block, *vel=0 means position block.
@@ -120,11 +164,25 @@ int DECLSPECDLLEXPORT tng_compress_inquire(char *data,int *vel, int *natoms,
*/
int DECLSPECDLLEXPORT tng_compress_uncompress(char *data,double *posvel);
+int DECLSPECDLLEXPORT tng_compress_uncompress_float(char *data,float *posvel);
+
+int DECLSPECDLLEXPORT tng_compress_uncompress_int(char *data,int *posvel, unsigned long *prec_hi, unsigned long *prec_lo);
- /* Compression algorithms (matching the original trajng
- assignments) The compression backends require that some of the
- algorithms must have the same value. */
+/* This converts a block of integers, as obtained from tng_compress_uncompress_int, to floating point values
+ either double precision or single precision. */
+void DECLSPECDLLEXPORT tng_compress_int_to_double(int *posvel_int,unsigned long prec_hi, unsigned long prec_lo,
+ int natoms,int nframes,
+ double *posvel_double);
+void DECLSPECDLLEXPORT tng_compress_int_to_float(int *posvel_int,unsigned long prec_hi, unsigned long prec_lo,
+ int natoms,int nframes,
+ float *posvel_float);
+
+
+/* Compression algorithms (matching the original trajng
+ assignments) The compression backends require that some of the
+ algorithms must have the same value. */
+
#define TNG_COMPRESS_ALGO_STOPBIT 1
#define TNG_COMPRESS_ALGO_TRIPLET 2
#define TNG_COMPRESS_ALGO_BWLZH1 8
diff --git a/include/compression/tng_compress_testing.h.in b/include/compression/tng_compress_testing.h.in
new file mode 100644
index 0000000..168764b
--- /dev/null
+++ b/include/compression/tng_compress_testing.h.in
@@ -0,0 +1,6 @@
+#ifndef TNG_COMPRESS_TESTING_H
+#define TNG_COMPRESS_TESTING_H
+
+#define TNG_COMPRESS_FILES_DIR "@TNG_COMPRESS_FILES_DIR@"
+
+#endif
contact: Jan Huwald // Impressum