+static void
+bitmatrix_print (const char *title, bitsetv matrix)
+{
+ size_t i, j;
+ size_t size = bitset_size (matrix[0]);
+
+ /* Title. */
+ fprintf (stderr, "%s BEGIN\n", title);
+
+ /* Column numbers. */
+ fputs (" ", stderr);
+ for (i = 0; i < size; ++i)
+ putc (i / 10 ? '0' + i / 10 : ' ', stderr);
+ putc ('\n', stderr);
+ fputs (" ", stderr);
+ for (i = 0; i < size; ++i)
+ fprintf (stderr, "%d", i % 10);
+ putc ('\n', stderr);
+
+ /* Bar. */
+ fputs (" .", stderr);
+ for (i = 0; i < size; ++i)
+ putc ('-', stderr);
+ fputs (".\n", stderr);
+
+ /* Contents. */
+ for (i = 0; i < size; ++i)
+ {
+ fprintf (stderr, "%2d|", i);
+ for (j = 0; j < size; ++j)
+ fputs (bitset_test (matrix[i], j) ? "1" : " ", stderr);
+ fputs ("|\n", stderr);
+ }
+
+ /* Bar. */
+ fputs (" `", stderr);
+ for (i = 0; i < size; ++i)
+ putc ('-', stderr);
+ fputs ("'\n", stderr);
+
+ /* End title. */
+ fprintf (stderr, "%s END\n\n", title);