X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=src%2Fgeneorder.h;h=4659e0efee62ca5194a3505b75d868bfe865c416;hb=43b1052d74a207fe667b75e41d0c70c1189c2cc8;hp=b29a1acc2ceefc15d700f9720f09a2ad9f22568a;hpb=c0c87c4e18985ba969174716f7576f291b0fd6a6;p=germs.git diff --git a/src/geneorder.h b/src/geneorder.h index b29a1ac..4659e0e 100644 --- a/src/geneorder.h +++ b/src/geneorder.h @@ -27,7 +27,13 @@ #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;