X-Git-Url: https://ruin.nu/git/?p=germs.git;a=blobdiff_plain;f=src%2Fgenesorter.cpp;h=1e199843a1a5ecedcbf692fc6da5117dafa4ce8e;hp=5f8699c62d0991f504520713d18a517fc555a01f;hb=3401199b1ce268dd6465f09abf6264592b989140;hpb=d0abe1592fcbb10f4ac303e7b66c384624d4d439 diff --git a/src/genesorter.cpp b/src/genesorter.cpp index 5f8699c..1e19984 100644 --- a/src/genesorter.cpp +++ b/src/genesorter.cpp @@ -24,12 +24,18 @@ #include "sortaction.h" #include "reverseaction.h" +#include "genealgorithms.h" + using namespace std; -GeneSorter::ActionList GeneSorter::sort(const GeneOrder& go1){ +GeneSorter::ActionList GeneSorter::sort(const GeneOrder& go){ return ActionList(); } -GeneSorter::ActionList GeneSorter::safeActions(const GeneOrder& go1){ - return ActionList(); +GeneSorter::ActionList GeneSorter::safeActions(const GeneOrder& go){ + if (countCycles(go) == go.size() - 1) + return ActionList(); + ActionList al; + al.push_back(ActionPointer(new ReverseAction(2,3))); + return al; }