#define __REVERSEACTION_H__
#include "sortaction.h"
+#include "genealgorithms.h"
+
+#include <algorithm>
+
/**
* Reverses an interval
*
/**
* Creates a new reverse action for the interval [i,j]
*/
- ReverseAction(size_t i, size_t j):_i(i),_j(j){}
+ 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;
+ }
/**
- * Sort SortActions by score
+ * Applies the sort action on the gene order
*/
virtual GeneOrder& operator()(GeneOrder& go) const{
go.reverse(_i,_j);