diff options
author | Magnus Lundborg <lundborg.magnus@gmail.com> | 2014-07-21 13:56:54 (GMT) |
---|---|---|
committer | Magnus Lundborg <lundborg.magnus@gmail.com> | 2014-07-23 22:17:52 (GMT) |
commit | 1a09f345860834fb1c2005e65948fa296b201e8b (patch) | |
tree | fb25ea8a08d34fa2ca2298792ef8e559841932a7 /src/compression/bwt.c | |
parent | 3e2c4306bba827d5b1d3444d5fb9a81e4b2a88bb (diff) |
Improved TNG compression speed.
Change-Id: I71c66c6b534cb402048dcd75e008d3db4bd3fb71
Diffstat (limited to 'src/compression/bwt.c')
-rw-r--r-- | src/compression/bwt.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/compression/bwt.c b/src/compression/bwt.c index 66d3ecf..681d66b 100644 --- a/src/compression/bwt.c +++ b/src/compression/bwt.c @@ -1,7 +1,7 @@ /* This code is part of the tng compression routines. * - * Written by Daniel Spangberg - * Copyright (c) 2010, 2013, The GROMACS development team. + * Written by Daniel Spangberg and Magnus Lundborg + * Copyright (c) 2010, 2013-2014 The GROMACS development team. * * * This program is free software; you can redistribute it and/or @@ -162,8 +162,9 @@ void Ptngc_comp_to_bwt(unsigned int *vals, int nvals, indices[i]=i; /* Find the length of the initial repeating pattern for the strings. */ /* First mark that the index does not have a found repeating string. */ - for (i=0; i<nvals; i++) - nrepeat[i]=0U; + + memset(nrepeat, 0U, sizeof(unsigned int) * nvals); + #ifdef SHOWIT printf("nvals is %d\n",nvals); #endif @@ -312,8 +313,9 @@ void Ptngc_comp_from_bwt(unsigned int *input, int nvals, int index, unsigned int *c=warnmalloc(0x10000*sizeof *c); unsigned int *p=warnmalloc(nvals*sizeof *p); unsigned int sum=0; - for (i=0; i<0x10000; i++) - c[i]=0; + + memset(c, 0, sizeof(unsigned int) * 0x10000); + for (i=0; i<nvals; i++) { p[i]=c[input[i]]; |