From: Ricardo Markiewicz Date: Wed, 23 Jun 2004 02:59:21 +0000 (+0000) Subject: Subo esto que tira mucha fruta, pero ayuda a visualizar las cosas X-Git-Tag: svn_import~83 X-Git-Url: https://git.llucax.com/z.facultad/75.06/jacu.git/commitdiff_plain/680e5a7fe45a3d3aedb27d618e5072af672415f9 Subo esto que tira mucha fruta, pero ayuda a visualizar las cosas --- diff --git a/src/blocksorting/bs.c b/src/blocksorting/bs.c index 59a0de9..b95b74b 100644 --- a/src/blocksorting/bs.c +++ b/src/blocksorting/bs.c @@ -102,7 +102,7 @@ void bs_solve(char *in, char *out, t_BlockSort *bs, Uint32 *k, Uint32 leido) /* Guardo el k y el tamaño en el array */ memcpy(out, &leido, sizeof(Uint32)); memcpy(out+sizeof(Uint32), k, sizeof(Uint32)); - + printf("%ld -> %ld\n", *k, *(Uint32 *)(out+sizeof(Uint32))); bs->len = l; } diff --git a/src/jacu.c b/src/jacu.c index d0deb90..bc56a41 100644 --- a/src/jacu.c +++ b/src/jacu.c @@ -115,9 +115,16 @@ int main(int argc, char* argv[]) /* Hago el BS */ bs_solve(data, salida, bs, &k, i); - printf("BS k=%ld\n", k); - printf("PageSize = %ld\n", i); + printf("BS k=%ld\n", *(Uint32 *)(salida+sizeof(Uint32))); + printf("PageSize = %ld\n", *(Uint32 *)salida); + printf("Antes de MTF = %ld [", i); + { + int ii; + for(ii=0; ii<(i+sizeof(Uint32)); ii++) + printf("(%c)", salida[ii+sizeof(Uint32)]); + printf("]\n"); + } /* Le aplico el MTF, salteo el tamaño del bloque para que no se pierda. */ mtf = jacu_mtf(salida+sizeof(Uint32), i+sizeof(Uint32), &z, &z_len); @@ -140,15 +147,21 @@ int main(int argc, char* argv[]) if ((len = zg_group(&zg, buff, mtf[j]))) fwrite(buff, 1, len, fp_out); } else { /* Guardo el PageSize */ - fwrite(&i, sizeof(Uint32), 1, fp_out); + fwrite(salida, sizeof(Uint32), 1, fp_out); /* Guardo el Z len y el Z */ fwrite(&z_len, sizeof(int), 1, fp_out); fwrite(z, z_len, sizeof(char), fp_out); /* Guardo la salida del MTF */ - for(j=sizeof(Uint32); j 0) { block = malloc(block_size*sizeof(char)+sizeof(Uint32)); orig = malloc(block_size*sizeof(char)); - fread(block, block_size, sizeof(char), fp_in); + fread(block, block_size+sizeof(Uint32), sizeof(char), fp_in); + printf("Antes MTF_inv = ["); + { + int ii; + for(ii=0; ii