*
* We search all possible adjacency matrices, and for each one we run
* GLPK's simplex solver. We represent the adjacency matrix as an
- * array of bitmaps.
+ * array of bitmaps: one word per input stick, with one bit per output
+ * stick.
*
* However, there are a couple of wrinkles:
*
* nondecreasing in array order.
*
* Once we have a solution, we also avoid considering any candidate
- * which involves dividing one of the output sticks into so many
+ * which involves dividing one of the input sticks into so many
* fragment that the smallest fragment would necessarily be no bigger
* than our best solution. That is, we reject candidates where any of
* the hamming weights of the adjacency bitmap words are too large.
glp_set_obj_coef(prob, X_minimum, 1);
for (i=0; i<n; i++) {
- for (j=0, jbit=1; j<m; j++, jbit<<=1) {
+ FOR_BITS(j,m) {
if (!(adjmatrix[i] & jbit))
continue;
/* x_total_i += x_minimum */