summaryrefslogtreecommitdiff
path: root/src/compression/tng_compress.c
diff options
context:
space:
mode:
authorDaniel Spangberg <daniels@kemi.uu.se>2013-05-17 16:54:01 (GMT)
committerDaniel Spangberg <daniels@kemi.uu.se>2013-05-17 16:54:01 (GMT)
commitecf039adfd38ba1a95b94f1bdc22f01928cb81c5 (patch)
treeeb3ee60ed08cc65fe02b103e4bf9fe34750c63b1 /src/compression/tng_compress.c
parent6ae393dbe7ffda9c2340503c82d062cb8d7c6f41 (diff)
Added conversion from unpacked integers to float/double.
Added tests for recompression (uncompress to int, compress int) Added tests for conversion from unpacked integers to float/double.
Diffstat (limited to 'src/compression/tng_compress.c')
-rw-r--r--src/compression/tng_compress.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/compression/tng_compress.c b/src/compression/tng_compress.c
index ed3fca9..1219f6a 100644
--- a/src/compression/tng_compress.c
+++ b/src/compression/tng_compress.c
@@ -1764,6 +1764,20 @@ int DECLSPECDLLEXPORT tng_compress_uncompress_int(char *data,int *posvel, unsign
return 1;
}
+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)
+{
+ unquantize(posvel_double,natoms,nframes,PRECISION(prec_hi,prec_lo),posvel_int);
+}
+
+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)
+{
+ unquantize_float(posvel_float,natoms,nframes,(float)PRECISION(prec_hi,prec_lo),posvel_int);
+}
+
static char *compress_algo_pos[TNG_COMPRESS_ALGO_MAX]={
"Positions invalid algorithm",
"Positions stopbits interframe",
contact: Jan Huwald // Impressum