Commit 6544fab3 authored by Charles Bouillaguet's avatar Charles Bouillaguet
Browse files

better verbosity and sanity checks

parent 70d9e5e6
......@@ -688,6 +688,7 @@ int main(int argc, char **argv)
hnrows, hncols, hnnz, (double) nnz / nrows, skipped);
}
log(0, "Sanity check\n");
/* check empty cols & rows */
int nempty_rows = 0;
for (int i = 0; i < nrows; i++) {
......@@ -699,13 +700,22 @@ int main(int argc, char **argv)
scratch[Uj[p]] = 1;
}
}
if (nempty_rows == 0)
log(1, " - no empty rows (OK)\n");
else
errx(1, " - %d empty rows (KO)!\n", nempty_rows);
int ntouched_cols = 0;
for (int j = 0; j < ncols; j++)
ntouched_cols += scratch[j];
log(1, " - %d / %d empty rows / columns\n", ncols - ntouched_cols, nempty_rows);
if (ntouched_cols == ncols)
log(1, " - no empty column (OK)\n");
else
errx(1, " - %d empty columnss (KO)!\n", ncols - ntouched_cols);
if (nrows > ncols)
log(0, "Sanity check: %d extra rows (OK)\n", nrows - ncols);
log(1, " - %d extra rows (OK)\n", nrows - ncols);
else
errx(1, "ERROR : more columns than rows (%d extra columns)", ncols - nrows);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment