small additions to permutations

This commit is contained in:
2024-01-24 13:41:39 +01:00
parent 13c23fb85d
commit 1ee984eda2
2 changed files with 42 additions and 5 deletions

View File

@@ -67,7 +67,9 @@ public:
NRPerm operator|(const NRPerm &rhs) const; //concatenate the permutations rhs,this, renumbering rhs (not commutative)
NRPerm operator*(const NRPerm &q) const; //q is rhs and applied first, this applied second
NRPerm operator*(const CyclePerm<T> &r) const;
NRPerm conjugate_by(const NRPerm &q) const; //q^-1 p q
NRPerm multiply(const NRPerm<T> &q, bool inverse) const; //multiplication but optionally q inversed
NRPerm conjugate_by(const NRPerm &q, bool reverse=false) const; //q^-1 p q or q p q^-1
NRPerm commutator(const NRPerm &q, bool inverse=false) const; //p^-1 q^-1 p q or q^-1 p^-1 q p
int parity() const; //returns +/- 1
void randomize(void); //uniformly random by Fisher-Yates shuffle
bool next(); //generate next permutation in lex order