XXX makes things slower, perhaps has bug ?!
static glp_prob *best_prob;
static AdjWord *best_adjmatrix;
static glp_prob *best_prob;
static AdjWord *best_adjmatrix;
+static int n_over_best, m_over_best;
static int *weight;
static unsigned printcounter;
static int *weight;
static unsigned printcounter;
static void set_best(double new_best) {
best = new_best;
n_over_best = floor(n / best);
static void set_best(double new_best) {
best = new_best;
n_over_best = floor(n / best);
+ m_over_best = floor(m / best);
}
/*----- multicore support -----*/
}
/*----- multicore support -----*/
setlinebuf(stderr);
weight = calloc(sizeof(*weight), m); assert(weight);
n_over_best = INT_MAX;
setlinebuf(stderr);
weight = calloc(sizeof(*weight), m); assert(weight);
n_over_best = INT_MAX;
static int totalfrags;
static bool maxhamweight_ok(void) {
static int totalfrags;
static bool maxhamweight_ok(void) {
- double maxminsize = (double)m / maxhamweight;
- return maxminsize > best;
+ return maxhamweight <= m_over_best;
}
static bool preconsider_ok(int nwords, bool doprint) {
}
static bool preconsider_ok(int nwords, bool doprint) {
for (i=0, totalfrags=0; i<nwords; i++) {
int frags = count_set_adj_bits(adjmatrix[i]);
PRINTF("%"PRADJ" ", adjmatrix[i]);
for (i=0, totalfrags=0; i<nwords; i++) {
int frags = count_set_adj_bits(adjmatrix[i]);
PRINTF("%"PRADJ" ", adjmatrix[i]);
- double maxminsize = (double)m / frags;
- if (maxminsize <= best) {
+ if (frags > m_over_best) {
PRINTF(" too fine");
goto out;
}
PRINTF(" too fine");
goto out;
}