X-Git-Url: https://ruin.nu/git/?p=germs.git;a=blobdiff_plain;f=src%2Fgenealgorithms.h;h=4c938e394bd42fa1ea3eb710239811dd32277e99;hp=4c519a7e3167a40384893a86dea243f20d1ac6d9;hb=e7953f0050007cd1999d64d985d0a063b9ddc99b;hpb=3db2f8d8f21614408dfd072cc45e618c7905461f diff --git a/src/genealgorithms.h b/src/genealgorithms.h index 4c519a7..4c938e3 100644 --- a/src/genealgorithms.h +++ b/src/genealgorithms.h @@ -25,6 +25,14 @@ class GeneOrder; +struct Component{ + Component(int b,int e,int s):begin(b),end(e),sign(s){} + int begin; + int end; + int sign; +}; +typedef std::pair Interval; + /** * Returns the length of the longest increasing sequence and the longest * decreasing sequence. @@ -35,5 +43,20 @@ std::pair longestSequences(const GeneOrder& go); */ std::vector > robinsonSchensted(const GeneOrder& go); +/** + * Counts the number of cycles in the gene order. + */ +int countCycles(const GeneOrder& go); + +/** + * Finds the components in the gene order. + */ +std::vector findComponents(const GeneOrder& go); + +/** + * Find intervals. + */ +std::vector findIntervals(const GeneOrder& go); + #endif