diff options
author | Daniel Spangberg <daniels@kemi.uu.se> | 2013-05-17 16:54:01 (GMT) |
---|---|---|
committer | Daniel Spangberg <daniels@kemi.uu.se> | 2013-05-17 16:54:01 (GMT) |
commit | ecf039adfd38ba1a95b94f1bdc22f01928cb81c5 (patch) | |
tree | eb3ee60ed08cc65fe02b103e4bf9fe34750c63b1 /src/compression/tng_compress.c | |
parent | 6ae393dbe7ffda9c2340503c82d062cb8d7c6f41 (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.c | 14 |
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", |