PARP Research Group |
Universidad de Murcia ![]() |
QVPermutation Class Reference
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Public Member Functions | |
| QVPermutation (const int n=0, bool initialize_with_identity=false) | |
| Default constructor for QVPermutation. | |
| bool | checkConsistency () const |
| Check consistency of permutation. | |
| QVMatrix | toMatrix () const |
| Conversion to QVMatrix. | |
| int | signature () const |
| Signature of a permutation. | |
| int & | operator() (const int index) |
| Element access operator. | |
| int | operator() (const int index) const |
| Overloaded version of element access operator. | |
Static Public Member Functions | |
| static QVPermutation | fromMatrix (const QVMatrix &matrix) |
| Conversion from QVMatrix. | |
Implementation of permutations.
Definition at line 41 of file qvpermutation.h.
| QVPermutation::QVPermutation | ( | const int | n = 0, |
|
| bool | initialize_with_identity = false | |||
| ) | [inline] |
Default constructor for QVPermutation.
| size | size of the permutation | |
| initialize_with_identity | if true, returns an identity permutation; if false, permutation will be uninitialized |
Definition at line 47 of file qvpermutation.h.
| bool QVPermutation::checkConsistency | ( | ) | const |
Check consistency of permutation.
Definition at line 31 of file qvpermutation.cpp.
Referenced by fromMatrix(), and toMatrix().
| QVMatrix QVPermutation::toMatrix | ( | ) | const |
Conversion to QVMatrix.
This function generates a QVMatrix from a QVPermutation, which will only contain ones and zeros, with exactly one nonzero element per row and per column.
Definition at line 48 of file qvpermutation.cpp.
| int QVPermutation::signature | ( | ) | const |
Signature of a permutation.
Returns the signature of a permutation (-1 if it has odd parity, +1 otherwise).
Definition at line 58 of file qvpermutation.cpp.
Referenced by determinant().
| QVPermutation QVPermutation::fromMatrix | ( | const QVMatrix & | matrix | ) | [static] |
Conversion from QVMatrix.
This function generates a QVPermutation from a QVMatrix, where the maximum elements in each row, when substituted by ones, with the rest of elements in that row substituted by zeros, generate a permutation matrix. Otherwise it will fail and abort execution.
| matrix | matrix to get permutation from. |
Definition at line 83 of file qvpermutation.cpp.
Referenced by determinant().
| int& QVPermutation::operator() | ( | const int | index | ) | [inline] |
Element access operator.
| index | main index value for data access |
Definition at line 87 of file qvpermutation.h.
| int QVPermutation::operator() | ( | const int | index | ) | const [inline] |
Overloaded version of element access operator.
| index | main index value for data access |
Definition at line 93 of file qvpermutation.h.