X-Git-Url: https://ruin.nu/git/?p=germs.git;a=blobdiff_plain;f=src%2Fgenealgorithms.cpp;h=b2d7fa6132b0463ee9a1b1cdf8f240bddf1204f9;hp=154df354bc346592f53a1373b49bbc1c72a0b79d;hb=3db2f8d8f21614408dfd072cc45e618c7905461f;hpb=74e3465418ae60633025efb581e399308ffdf4b1 diff --git a/src/genealgorithms.cpp b/src/genealgorithms.cpp index 154df35..b2d7fa6 100644 --- a/src/genealgorithms.cpp +++ b/src/genealgorithms.cpp @@ -26,27 +26,10 @@ using namespace std; std::pair longestSequences(const GeneOrder& go){ + vector > v = robinsonSchensted(go); + return pair(v[0].size(),v.size()); } - -/* -robSche2 :: [Int] -> [[Int]] -> [[Int]] -robSche2 [] ys = ys -robSche2 (x:xs) ys = robSche2 xs $ robSche4 x ys - -robSche3 :: Int -> [Int] -> (Maybe Int,[Int]) -robSche3 x ys = let yless = [y | y <- ys, y < x] in - let ymore = [y | y <- ys, y > x] in - case ymore of - [] -> (Nothing, yless++[x]) - (y:ys) -> (Just y, yless++(x:ys)) - -robSche4 :: Int -> [[Int]] -> [[Int]] -robSche4 x [] = [[x]] -robSche4 x (y:ys) = case robSche3 x y of - (Nothing, y) -> y:ys - (Just x, y) -> y:robSche4 x ys -*/ std::vector > robinsonSchensted(const GeneOrder& go){ vector > v; for (GeneOrder::iterator i = go.begin(); i != go.end(); ++i){