cgv
|
a permutation matrix type More...
#include <perm_mat.h>
Public Member Functions | |
perm_mat () | |
standard constructor | |
perm_mat (unsigned n) | |
create an nxn identity permutation matrix (storage is only n) | |
perm_mat (vec< unsigned > p) | |
creates a permutation from a given permutation vector | |
unsigned | size () const |
number of stored elements | |
unsigned | nrows () const |
number of rows | |
unsigned | ncols () const |
number of rows | |
void | resize (unsigned n) |
resize the permutation matrix | |
void | transpose () |
compute the transpose permutation matrix (equal to inverse permutation) | |
template<typename T > | |
operator const mat< T > () const | |
perm_mat | operator* (const perm_mat &m) |
product with another permutation matrix | |
void | identity () |
set to identity matrix | |
void | swap (unsigned i, unsigned j) |
unsigned & | operator() (unsigned i) |
unsigned & | operator[] (unsigned i) |
unsigned | operator() (unsigned i) const |
unsigned | operator[] (unsigned i) const |
Public Attributes | |
vec< unsigned > | _data |
internal storage of the permutation | |
a permutation matrix type
Definition at line 12 of file perm_mat.h.
|
inline |
standard constructor
Definition at line 18 of file perm_mat.h.
|
inlineexplicit |
create an nxn identity permutation matrix (storage is only n)
Definition at line 21 of file perm_mat.h.
References identity(), and resize().
|
inline |
creates a permutation from a given permutation vector
Definition at line 28 of file perm_mat.h.
References _data.
|
inline |
set to identity matrix
Definition at line 102 of file perm_mat.h.
References _data, and cgv::math::vec< T >::size().
Referenced by perm_mat().
|
inline |
number of rows
Definition at line 46 of file perm_mat.h.
References _data, and cgv::math::vec< T >::size().
|
inline |
number of rows
Definition at line 40 of file perm_mat.h.
References _data, and cgv::math::vec< T >::size().
|
inline |
Definition at line 73 of file perm_mat.h.
|
inline |
Definition at line 115 of file perm_mat.h.
|
inline |
Definition at line 127 of file perm_mat.h.
product with another permutation matrix
Definition at line 85 of file perm_mat.h.
References size().
|
inline |
Definition at line 121 of file perm_mat.h.
|
inline |
Definition at line 133 of file perm_mat.h.
|
inline |
resize the permutation matrix
Definition at line 55 of file perm_mat.h.
References _data, and cgv::math::vec< T >::resize().
Referenced by perm_mat().
|
inline |
number of stored elements
Definition at line 34 of file perm_mat.h.
References _data, and cgv::math::vec< T >::size().
Referenced by operator*(), and cgv::math::random::uniform().
|
inline |
Definition at line 109 of file perm_mat.h.
|
inline |
compute the transpose permutation matrix (equal to inverse permutation)
Definition at line 64 of file perm_mat.h.
References _data, and cgv::math::vec< T >::size().
vec<unsigned> cgv::math::perm_mat::_data |
internal storage of the permutation
Definition at line 15 of file perm_mat.h.
Referenced by identity(), ncols(), nrows(), perm_mat(), resize(), size(), and transpose().