* The arguments must be ordered so that n > m:
* n is the number of (more, shorter) input matches of length m
* m is the number of (fewer, longer) output matches of length n
+ *
+ * Options:
+ * -j<jobs> run in parallel on <jobs> cores
+ * -b<best> search only for better than <best>
*/
/*
* <=> frags < | n / best |
* _ _
* <=> frags <= | n / best | - 1
+ *
+ * But best values from glpk are slightly approximate, so we
+ * subtract a fudge factor from our target.
*/
- n_max_frags = ceil(n / best) - 1;
- m_max_frags = ceil(m / best) - 1;
+ double near_best = best * 0.98 - 0.02;
+ n_max_frags = ceil(n / near_best) - 1;
+ m_max_frags = ceil(m / near_best) - 1;
}
/*----- multicore support -----*/
static void report(void) {
fprintf(stderr, "\n");
+ if (best_adjmatrix) {
+ int i;
+ fprintf(stderr," ");
+ for (i=0; i<n; i++) fprintf(stderr, " %"PRADJ, best_adjmatrix[i]);
+ fprintf(stderr," OK\n");
+ }
+ printf("%d into %d: ", n, m);
if (best_prob) {
double min = glp_get_obj_val(best_prob);
double a[n][m];
continue;
a[x][y] = min + glp_get_col_prim(best_prob, i);
}
- printf("%d into %d: min fragment %g [%s]\n", n, m, min, VERSION);
+ printf("min fragment %g", min);
for (i = 0; i < n; i++) {
for (j = 0; j < m; j++) {
if (a[i][j])
printf("\n");
}
}
+ printf(" [%s]\n", VERSION);
if (ferror(stdout) || fclose(stdout)) { perror("stdout"); exit(-1); }
}
while ((opt = getopt(argc,argv,"j:")) >= 0) {
switch (opt) {
case 'j': ncpus = atoi(optarg); break;
+ case 'b': set_best(atof(optarg)); break;
case '+': assert(!"bad option");
default: abort();
}