X-Git-Url: https://ruin.nu/git/?p=germs.git;a=blobdiff_plain;f=src%2Freverseaction.h;h=76ab6660da377187420f268ce6dda84825ef3361;hp=0330597a90b775c7da1ed89fb118ee59482e1241;hb=7e811915a713eeef44f03385a1fc1f74a5301c30;hpb=e81855989d0f0e124e0ec770b417bcb099959391 diff --git a/src/reverseaction.h b/src/reverseaction.h index 0330597..76ab666 100644 --- a/src/reverseaction.h +++ b/src/reverseaction.h @@ -22,6 +22,10 @@ #define __REVERSEACTION_H__ #include "sortaction.h" +#include "genealgorithms.h" + +#include + /** * Reverses an interval * @@ -35,6 +39,10 @@ class ReverseAction : public SortAction{ */ ReverseAction(size_t i, size_t j): SortAction(0),_i(i),_j(j){ } + ReverseAction(Interval i): SortAction(0){ + _i = std::min(i.first,i.second); + _j = std::max(i.first,i.second)-1; + } /** * Applies the sort action on the gene order