NRPerm::reverse
This commit is contained in:
parent
6715260da7
commit
f5d1a13a18
@ -79,6 +79,18 @@ for(T i=1; i<=this->size(); ++i) q[(*this)[i]]=i;
|
||||
return q;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
NRPerm<T> NRPerm<T>::reverse() const
|
||||
{
|
||||
#ifdef DEBUG
|
||||
if(!this->is_valid()) laerror("reverse of invalid permutation");
|
||||
#endif
|
||||
|
||||
NRPerm<T> q(this->size());
|
||||
for(T i=1; i<=this->size(); ++i) q[i]=(*this)[this->size()-i+1];
|
||||
return q;
|
||||
}
|
||||
|
||||
|
||||
template <typename T>
|
||||
NRPerm<T> NRPerm<T>::operator*(const NRPerm<T> q) const
|
||||
|
@ -52,6 +52,7 @@ public:
|
||||
bool is_valid() const; //is it really a permutation
|
||||
bool is_identity() const;
|
||||
NRPerm inverse() const;
|
||||
NRPerm reverse() const; //backward order
|
||||
NRPerm operator*(const NRPerm q) const; //q is rhs and applied first, this applied second
|
||||
NRPerm conjugate_by(const NRPerm q) const; //q^-1 p q
|
||||
int parity() const;
|
||||
|
Loading…
Reference in New Issue
Block a user