|
TiledArray
0.7.0
|
Permutation of a sequence of objects indexed by base-0 indices. More...
#include <permutation.h>
Public Types | |
| typedef Permutation | Permutation_ |
| typedef unsigned int | index_type |
| typedef std::vector< index_type >::const_iterator | const_iterator |
Public Member Functions | |
| Permutation ()=default | |
| Permutation (const Permutation &)=default | |
| Permutation (Permutation &&)=default | |
| ~Permutation ()=default | |
| Permutation & | operator= (const Permutation &)=default |
| Permutation & | operator= (Permutation &&other)=default |
| template<typename InIter , typename std::enable_if< detail::is_input_iterator< InIter >::value >::type * = nullptr> | |
| Permutation (InIter first, InIter last) | |
| Construct permutation from a range [first,last) More... | |
| template<typename Integer > | |
| Permutation (const std::vector< Integer > &a) | |
| Array constructor. More... | |
| Permutation (std::vector< index_type > &&a) | |
| std::vector move constructor More... | |
| template<typename Integer , typename std::enable_if< std::is_integral< Integer >::value >::type * = nullptr> | |
| Permutation (std::initializer_list< Integer > list) | |
| Construct permutation with an initializer list. More... | |
| index_type | dim () const |
| Domain size accessor. More... | |
| const_iterator | begin () const |
| Begin element iterator factory function. More... | |
| const_iterator | cbegin () const |
| Begin element iterator factory function. More... | |
| const_iterator | end () const |
| End element iterator factory function. More... | |
| const_iterator | cend () const |
| End element iterator factory function. More... | |
| index_type | operator[] (unsigned int i) const |
| Element accessor. More... | |
| std::vector< std::vector< index_type > > | cycles () const |
| Cycles decomposition. More... | |
| Permutation | identity () const |
| Identity permutation factory function. More... | |
| Permutation | mult (const Permutation &other) const |
Product of this permutation by other. More... | |
| Permutation | inv () const |
| Construct the inverse of this permutation. More... | |
| Permutation | pow (int n) const |
| Raise this permutation to the n-th power. More... | |
| operator bool () const | |
| Bool conversion. More... | |
| bool | operator! () const |
| Not operator. More... | |
| const std::vector< index_type > & | data () const |
| Permutation data accessor. More... | |
| template<typename Archive > | |
| void | serialize (Archive &ar) |
| Serialize permutation. More... | |
Static Public Member Functions | |
| static Permutation | identity (const unsigned int dim) |
| Identity permutation factory function. More... | |
Permutation of a sequence of objects indexed by base-0 indices.
Permutation class is used as an argument in all permutation operations on other objects. Permutations can be applied to sequences of objects:
Permutations can also be composed, e.g. multiplied and inverted:
is represented in one-line form as
. This means that 0th element of a sequence is mapped by this permutation into the 0th element of the permuted sequence (hence 0 is referred to as a fixed point of this permutation; so is 4); similarly, 1st element of a sequence is mapped by this permutation into the 2nd element of the permuted sequence (hence 2 is referred as the image of 1 under the action of this Permutation; similarly, 1 is the image of 3, etc.). Set
is referred to as domain (or support) of this Permutation. Note that (by definition) Permutation maps its domain into itself (i.e. it's a bijection).
and
correspond to the same
compressed form. For an implementation using compressed form, and without fixed domain size, see TiledArray::symmetry::Permutation. Definition at line 119 of file permutation.h.
| typedef std::vector<index_type>::const_iterator TiledArray::Permutation::const_iterator |
Definition at line 123 of file permutation.h.
| typedef unsigned int TiledArray::Permutation::index_type |
Definition at line 122 of file permutation.h.
Definition at line 121 of file permutation.h.
|
default |
|
default |
|
default |
|
default |
|
inline |
Construct permutation from a range [first,last)
| InIter | An input iterator type |
| first | The beginning of the iterator range |
| last | The end of the iterator range |
| TiledArray::Exception | If the permutation contains any element that is greater than the size of the permutation or if there are any duplicate elements. |
Definition at line 167 of file permutation.h.
|
inlineexplicit |
Array constructor.
Construct permutation from an Array
| a | The permutation array to be moved |
Definition at line 178 of file permutation.h.
|
inlineexplicit |
std::vector move constructor
Move the content of the std::vector into this permutation
| a | The permutation array to be moved |
Definition at line 187 of file permutation.h.
|
inlineexplicit |
Construct permutation with an initializer list.
| Integer | an integral type |
| list | An initializer list of integers |
Definition at line 199 of file permutation.h.
|
inline |
Begin element iterator factory function.
Definition at line 211 of file permutation.h.

|
inline |
Begin element iterator factory function.
Definition at line 216 of file permutation.h.
|
inline |
End element iterator factory function.
Definition at line 226 of file permutation.h.
|
inline |
Cycles decomposition.
Certain algorithms are more efficient with permutations represented as a set of cyclic transpositions. This function returns the set of cycles that represent this permutation. For example, permutation
is represented as the following set of cycles: (0,3)(1,2). The canonical format for the cycles is:
Definition at line 248 of file permutation.h.
|
inline |
Permutation data accessor.
Definition at line 375 of file permutation.h.

|
inline |
Domain size accessor.
Definition at line 206 of file permutation.h.

|
inline |
End element iterator factory function.
Definition at line 221 of file permutation.h.

|
inlinestatic |
Identity permutation factory function.
| dim | The number of dimensions in the |
dim elements Definition at line 283 of file permutation.h.

|
inline |
Identity permutation factory function.
Definition at line 294 of file permutation.h.


|
inline |
Construct the inverse of this permutation.
The inverse of the permutation is defined as
, where
is the identity permutation.
Definition at line 320 of file permutation.h.

|
inline |
Product of this permutation by other.
| other | a Permutation |
other * this, i.e. this applied first, then other Definition at line 300 of file permutation.h.

|
inline |
Bool conversion.
true if the permutation is not empty, otherwise false. Definition at line 365 of file permutation.h.
|
inline |
Not operator.
true if the permutation is empty, otherwise false. Definition at line 370 of file permutation.h.
|
default |
|
default |
|
inline |
Element accessor.
| i | The element index |
Definition at line 232 of file permutation.h.
|
inline |
Raise this permutation to the n-th power.
Constructs the permutation
, where
is this permutation.
| n | Exponent value |
Definition at line 337 of file permutation.h.


|
inline |
Serialize permutation.
MADNESS compatible serialization function
| Archive | The serialization archive type |
| [in,out] | ar | The serialization archive |
Definition at line 383 of file permutation.h.