All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines
To perfom permutations in a matrix. More...
#include <PermutationVector.h>
Public Member Functions | |
| PermutationVector | inverted () |
| int | newIndex (int oldIndex) const |
| PermutationVector (int n) | |
| PermutationVector (const PermutationVector &o) | |
| void | setNewIndex (int oldIndex, int newIndex) |
| QString | toString () const |
To perfom permutations in a matrix.
| QGpCoreTools::PermutationVector::PermutationVector | ( | int | n | ) | [inline] |
: QVector<int>(n) {}
| QGpCoreTools::PermutationVector::PermutationVector | ( | const PermutationVector & | o | ) | [inline] |
: QVector<int>(o) {}
Returns a permutation vector that can de-sort matrix sorted so far.
References newIndex(), and setNewIndex().
{
int n=count();
PermutationVector tmp(n);
for(int i=0; i<n; i++) {
tmp.setNewIndex(newIndex(i), i);
}
return tmp;
}
| int QGpCoreTools::PermutationVector::newIndex | ( | int | oldIndex | ) | const [inline] |
Referenced by inverted(), QGpCoreTools::MatrixData< T >::sortedColumns(), QGpCoreTools::MatrixData< T >::sortedRows(), and toString().
{return at(oldIndex);}
| void QGpCoreTools::PermutationVector::setNewIndex | ( | int | oldIndex, |
| int | newIndex | ||
| ) | [inline] |
Referenced by inverted().
{operator[](oldIndex)=newIndex;}
| QString QGpCoreTools::PermutationVector::toString | ( | ) | const |
References newIndex(), and str.