]> ruin.nu Git - germs.git/blobdiff - src/genealgorithms.cpp
inital commit of componenttree with associated changes
[germs.git] / src / genealgorithms.cpp
index f1e66aaa1cce5a2b9a1c3cf7b62c4c75351f4ee1..174c6f7b0414277b006b562f2736a83077db9fb7 100644 (file)
@@ -20,6 +20,7 @@
 
 #include "genealgorithms.h"
 #include "geneorder.h"
+#include "componenttree.h"
 
 #include <algorithm>
 #include <set>
@@ -146,7 +147,7 @@ std::vector<Component> findComponents(const GeneOrder& go){
                        s = Sdir.top();
                }
                if (go[i] > 0 && dir[i] == dir[s] && static_cast<Gene>(i - s) == p[i] - p[s])
-                       components.push_back(Component(p[s],p[i],(s+1 == i ? 0 : os[s])));
+                       components.push_back(Component(p[s],p[i],(s+1 == i ? 0 : os[s]),s,i));
 
                //Reverse
                if (p[i-1] < p[i])
@@ -162,7 +163,7 @@ std::vector<Component> findComponents(const GeneOrder& go){
                        s = Srev.top();
                }
                if (go[i] < 0 && rev[i] == rev[s] && static_cast<Gene>(i - s) == p[s] - p[i])
-                       components.push_back(Component(-p[s],-p[i],(s+1 == i ? 0 : os[s])));
+                       components.push_back(Component(-p[s],-p[i],(s+1 == i ? 0 : os[s]),s,i));
 
                //Update stacks
                if (go[i] > 0)