#include <permutation.h>
Inheritance diagram for esso::Permutation< N >:
Public Member Functions | |
construction | |
Permutation () | |
Permutation (int r) | |
const | |
DIMT | operator[] (DIMT n) const |
bool | operator== (const Permutation< N > &src) const |
bool | operator!= (const Permutation< N > &src) const |
template<class TT> Ix< N, TT > | operator * (const Ix< N, TT > &i) const |
Permutation< N > | operator * (const Permutation< N > &p) const |
Permutation< N > | operator[] (const Permutation< N > &p) const |
bool | IsEven () const |
nonconst | |
bool | Setup (const Ix< N, DIMT > &src) |
bool | SetupSwap (DIMT n1, DIMT n2) |
Permutation< N > & | Invert () |
Permutation< N > | operator~ () const |
template<int N1> Permutation< N > & | Concat (const Permutation< N1 > &p1, const Permutation< N-N1 > &p2) |
template<int M> Permutation< N+M > | operator| (const Permutation< M > &p2) const |
If n is a dimension, then the transformed dimension is p[n] where p is a Permutation object.
|
Default constructor. Creates unity permutation. |
|
Create a permutation that is a cyclic rotation of dimensions, that is p[n] == (n+r) modulo N. Negative values for r are allowed |
|
Concatenate two permutations. if p1 has dim n1 and p2 has dim n2 then (p1|p2)[n] == p1[n] if n<n1 and p2[n-n1]+n1 otherwise
|
|
Set this object to it's own inverse
|
|
Find out if this is an 'even' permutation, that is if it can be composed by an even number of 'elementary permutations'. An elementary permutation in this context is a permutation of two consecutive dimensions e.g. (1,2)->(2,1). Knowing the 'even' property of a permutation is important in many applications.
|
|
Compose a Permutation from two objects. I.e. if if p1 and p2 are permutations and n is a dimension then (p1*p2)[n] == p1[p2[n]] Note that this works just like matrix-matrix multiplication where the Permutation object acts like a permutation matrix with respect to multiplication.
|
|
Transform an Ix object by this permutation. I.e. if n is a dimension then (p*i)[p[n]] = i[n] Note that this works just like matrix-vector multiplication where the Permutation object acts like a permutation matrix with respect to multiplication.
|
|
|
|
|
|
Transform a permutation by another permutation. I.e. if p1 and p2 are permutations and n is a dimension then (p1[p2])[n] == p1[p2[~p1[n]]] Note that this means that p1[p2] is equivalent to p1*p2*~p1.
|
|
Reimplemented from esso::Ix< N, DIMT >. |
|
|
|
|
|
Create object.and checks so that arguments are ok. On failure the contents of this object is unchanged.
|
|
Create object as single permutation of two dimensions. Checks so that arguments are ok. On failure this object is unchanged.
|