Assert that the number of strongly connected components is in [1 .. nc].

This commit is contained in:
Bård Skaflestad 2012-05-21 18:53:08 +02:00
parent 81b8a3437c
commit 4588c40a30

View File

@ -11,6 +11,7 @@
#endif #endif
#include <algorithm> #include <algorithm>
#include <cassert>
#include <cmath> #include <cmath>
#include <vector> #include <vector>
@ -111,6 +112,9 @@ compute_reorder_sequence_graph(int nc,
flux, ia, ja, work); flux, ia, ja, work);
tarjan (nc, ia, ja, sequence, components, ncomponents, work); tarjan (nc, ia, ja, sequence, components, ncomponents, work);
assert (0 < *ncomponents);
assert (*ncomponents <= nc);
} }