aboutsummaryrefslogtreecommitdiff
path: root/src/solvers/h48
diff options
context:
space:
mode:
Diffstat (limited to 'src/solvers/h48')
-rw-r--r--src/solvers/h48/gendata_h48.h20
1 files changed, 8 insertions, 12 deletions
diff --git a/src/solvers/h48/gendata_h48.h b/src/solvers/h48/gendata_h48.h
index 48d5582..b1ae38c 100644
--- a/src/solvers/h48/gendata_h48.h
+++ b/src/solvers/h48/gendata_h48.h
@@ -104,8 +104,8 @@ STATIC size_t gendata_h48k2_realcoord(gendata_h48_arg_t *);
104STATIC void gendata_h48k2_dfs(h48k2_dfs_arg_t *arg); 104STATIC void gendata_h48k2_dfs(h48k2_dfs_arg_t *arg);
105STATIC void * gendata_h48k2_runthread(void *); 105STATIC void * gendata_h48k2_runthread(void *);
106STATIC tableinfo_t makeinfo_h48k2(gendata_h48_arg_t *); 106STATIC tableinfo_t makeinfo_h48k2(gendata_h48_arg_t *);
107STATIC void getdistribution_h48( 107STATIC void getdistribution_h48(const uint8_t *,
108 const uint8_t *, uint64_t [static 21], uint8_t, uint8_t); 108 uint64_t [static INFO_DISTRIBUTION_LEN], uint8_t, uint8_t);
109 109
110STATIC uint32_t *get_cocsepdata_ptr(const void *); 110STATIC uint32_t *get_cocsepdata_ptr(const void *);
111STATIC uint8_t *get_h48data_ptr(const void *); 111STATIC uint8_t *get_h48data_ptr(const void *);
@@ -671,14 +671,14 @@ makeinfo_h48k2(gendata_h48_arg_t *arg)
671STATIC void 671STATIC void
672getdistribution_h48( 672getdistribution_h48(
673 const uint8_t *table, 673 const uint8_t *table,
674 uint64_t distr[static 21], 674 uint64_t distr[static INFO_DISTRIBUTION_LEN],
675 uint8_t h, 675 uint8_t h,
676 uint8_t k 676 uint8_t k
677) { 677) {
678 uint8_t val; 678 uint8_t val;
679 int64_t i, h48max; 679 int64_t i, h48max;
680 680
681 memset(distr, 0, 21 * sizeof(uint64_t)); 681 memset(distr, 0, INFO_DISTRIBUTION_LEN * sizeof(uint64_t));
682 682
683 h48max = H48_COORDMAX(h); 683 h48max = H48_COORDMAX(h);
684 for (i = 0; i < h48max; i++) { 684 for (i = 0; i < h48max; i++) {
@@ -725,12 +725,13 @@ size_t
725gendata_h48_derive(uint8_t h, const void *fulltable, void *buf) 725gendata_h48_derive(uint8_t h, const void *fulltable, void *buf)
726{ 726{
727 size_t cocsepsize, h48size; 727 size_t cocsepsize, h48size;
728 uint8_t val_full, val_derive, val_new, *h48full, *h48derive; 728 uint8_t val_full, val_derive, *h48full, *h48derive;
729 int64_t i, j, h48max; 729 int64_t i, j, h48max;
730 gendata_h48_arg_t arg; 730 gendata_h48_arg_t arg;
731 tableinfo_t cocsepinfo, fulltableinfo; 731 tableinfo_t cocsepinfo, fulltableinfo;
732 732
733 /* Initializing values in case of error */ 733 /* Initializing values in case of error */
734 /* TODO cleanup this */
734 fulltableinfo.bits = 2; 735 fulltableinfo.bits = 2;
735 fulltableinfo.base = 8; 736 fulltableinfo.base = 8;
736 737
@@ -777,15 +778,10 @@ gendata_h48_derive(uint8_t h, const void *fulltable, void *buf)
777 j = i >> (int64_t)(11-h); 778 j = i >> (int64_t)(11-h);
778 val_full = get_h48_pval(h48full, i, arg.k); 779 val_full = get_h48_pval(h48full, i, arg.k);
779 val_derive = get_h48_pval(h48derive, j, arg.k); 780 val_derive = get_h48_pval(h48derive, j, arg.k);
780 val_new = MIN(val_full, val_derive); 781 set_h48_pval(h48derive, j, arg.k, MIN(val_full, val_derive));
781 set_h48_pval(h48derive, j, arg.k, val_new);
782 } 782 }
783 783
784 h48max = H48_COORDMAX(h); 784 getdistribution_h48(h48derive, arg.info.distribution, h, arg.k);
785 for (i = 0; i < h48max; i++) {
786 val_derive = get_h48_pval(h48derive, i, arg.k);
787 arg.info.distribution[val_derive]++;
788 }
789 785
790 if (!writetableinfo(&arg.info, buf)) { 786 if (!writetableinfo(&arg.info, buf)) {
791 LOG("gendata_h48_derive: could not write info for table\n"); 787 LOG("gendata_h48_derive: could not write info for table\n");

Generated with cgit - Back to sebastiano.tronto.net