diff options
author | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2019-05-06 15:00:10 -0400 |
---|---|---|
committer | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2019-05-06 15:00:10 -0400 |
commit | a9275adce368caaeaabc54bf0ca62a20a074e568 (patch) | |
tree | 7a1c4cc79dcb08cbeb8c35885866d9cf71035130 /lib | |
parent | d8f56eb5e7dfa41a21eb67503e570fd768d52109 (diff) | |
download | fuse_networks-a9275adce368caaeaabc54bf0ca62a20a074e568.tar.gz fuse_networks-a9275adce368caaeaabc54bf0ca62a20a074e568.tar.bz2 fuse_networks-a9275adce368caaeaabc54bf0ca62a20a074e568.zip |
changed the way cutoffs function to prevent erros, and added measurement for path length
Diffstat (limited to 'lib')
-rw-r--r-- | lib/include/network.hpp | 2 | ||||
-rw-r--r-- | lib/src/network.cpp | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/include/network.hpp b/lib/include/network.hpp index d95b3c3..6012228 100644 --- a/lib/include/network.hpp +++ b/lib/include/network.hpp @@ -74,7 +74,7 @@ class elastic_network : public network { elastic_network(const graph&, cholmod_common*); elastic_network(const elastic_network&); - void fracture(hooks&, double weight = 0.5, double cutoff = 1e-11); + void fracture(hooks&, double weight = 0.5, double cutoff = 1e-12); current_info get_current_info(); }; diff --git a/lib/src/network.cpp b/lib/src/network.cpp index 0cacdf9..250a38e 100644 --- a/lib/src/network.cpp +++ b/lib/src/network.cpp @@ -296,8 +296,8 @@ void elastic_network::fracture(hooks& m, double weight, double cutoff) { current_info cx = hook_x.solve(fuses); current_info cy = hook_y.solve(fuses); - bool done_x = cx.conductivity < cutoff * G.vertices.size() || cx.conductivity != cx.conductivity; - bool done_y = cy.conductivity < cutoff * G.vertices.size() || cy.conductivity != cy.conductivity; + bool done_x = cx.conductivity < 0.1 / G.edges.size(); + bool done_y = cy.conductivity < 0.1 / G.edges.size(); if (done_x && done_y) { break; |