PARP Research Group Universidad de Murcia


QVPermutation Class Reference
[Math functionality]

Implementation of permutations. More...

#include <QVPermutation>

List of all members.

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.

Detailed Description

Implementation of permutations.

See also:
Matrices and vectors

Definition at line 41 of file qvpermutation.h.


Constructor & Destructor Documentation

QVPermutation::QVPermutation ( const int  n = 0,
bool  initialize_with_identity = false 
) [inline]

Default constructor for QVPermutation.

Parameters:
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.


Member Function Documentation

bool QVPermutation::checkConsistency (  )  const

Check consistency of permutation.

Returns:
True if a valid permutation, false otherwise

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).

Returns:
signature of permutation

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.

Parameters:
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.

Parameters:
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.

Parameters:
index main index value for data access

Definition at line 93 of file qvpermutation.h.


The documentation for this class was generated from the following files:



QVision framework. PARP research group. Copyright © 2007, 2008, 2009, 2010, 2011.