diff options
author | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2019-04-27 18:02:58 -0400 |
---|---|---|
committer | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2019-04-27 18:02:58 -0400 |
commit | 7f7bfc7789c7c0d5b8a8daeda82b349ee1ea52a0 (patch) | |
tree | db215fb3e4d69036e78e4a6db685bbbb29116c90 /src | |
parent | 63dd7320fbef9c9a95bf6953770072baf735c34e (diff) | |
download | fuse_networks-7f7bfc7789c7c0d5b8a8daeda82b349ee1ea52a0.tar.gz fuse_networks-7f7bfc7789c7c0d5b8a8daeda82b349ee1ea52a0.tar.bz2 fuse_networks-7f7bfc7789c7c0d5b8a8daeda82b349ee1ea52a0.zip |
fixed problems with the current cutoff
Diffstat (limited to 'src')
-rw-r--r-- | src/measurements.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/measurements.cpp b/src/measurements.cpp index 5a79bd7..bf053e9 100644 --- a/src/measurements.cpp +++ b/src/measurements.cpp @@ -187,6 +187,9 @@ void ma::post_fracture(network &n) { auto post_cracks = find_minimal_crack(G, n); std::vector<unsigned> component(boost::num_vertices(G)); unsigned num = boost::connected_components(G, &component[0]); + if (post_cracks.size() > 2 || post_cracks.size() == 0) { + throw badcycleex; + } unsigned crack_component = component[n.G.dual_edges[post_cracks.front().second.front()].v[0]]; std::vector<std::list<graph::coordinate>> components(num); |