multiplication of permutations in different notation

This commit is contained in:
Jiri Pittner 2023-11-08 16:56:57 +01:00
parent c173bb6413
commit f8b2ee6e1a
2 changed files with 18 additions and 0 deletions

View File

@ -642,6 +642,22 @@ NRPerm<T> rr=pp*qq;
return CyclePerm<T>(rr);
}
//mixed type multiplications
template <typename T>
NRPerm<T> NRPerm<T>::operator*(const CyclePerm<T> &r) const
{
NRPerm<T> rr(r,this->size());
return *this * rr;
}
template <typename T>
NRPerm<T> CyclePerm<T>::operator*(const NRPerm<T> &r) const
{
NRPerm<T> tt(*this,r.size());
return tt*r;
}
template <typename T>
void CyclePerm<T>::simplify(bool keep1)
{

View File

@ -56,6 +56,7 @@ public:
NRPerm inverse() const;
NRPerm reverse() const; //backward order
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
int parity() const;
void randomize(void); //uniformly random by Fisher-Yates shuffle
@ -92,6 +93,7 @@ public:
CompressedPartition<T> cycles(const T n) const;
void readfrom(const std::string &line);
CyclePerm operator*(const CyclePerm q) const; //q is rhs and applied first, this applied second
NRPerm<T> operator*(const NRPerm<T> &r) const;
PERM_RANK_TYPE order() const; //lcm of cycle lengths
bool operator==(const CyclePerm &rhs) const {return NRPerm<T>(*this) == NRPerm<T>(rhs);}; //cycle representation is not unique, cannot inherit operator== from NRVec
void simplify(bool keep1=false); //remove cycles of size 0 or 1