]> ruin.nu Git - germs.git/blobdiff - src/geneorder.h
more documentation
[germs.git] / src / geneorder.h
index b29a1acc2ceefc15d700f9720f09a2ad9f22568a..4659e0efee62ca5194a3505b75d868bfe865c416 100644 (file)
 #include "misc.h"
 
 /**
- * Stores a gene order permutation and ensures that all genes are present and not duplicated.
+ * Stores a gene order permutation and ensures that all genes are present 
+ * and not duplicated.
+ *
+ * It has limited support for acting as an STL container, but still maintaining
+ * the invariant of a permutation starting with 0 and ending with n, with all
+ * genes present.
+ *
  * \author Michael Andreen
 */
 class GeneOrder{
@@ -104,6 +110,14 @@ class GeneOrder{
                 */
                iterator end() const;
 
+               /**
+                * Reverserses the interval [i,j], changing the sign on all elements
+                * affected.
+                *
+                * \throws std::out_of_range if i is smaller than 0 or bigger than n.
+                */
+               void reverse(size_type i, size_type j);
+
 
        private:
                GeneList _geneorder;