![]() |
CLA3P v0.3.1
Compact Linear Algebra Parallel Portable Package
|
Permutation matrix utility. More...

Constructors | |
| PxMatrix () | |
| Default constructor. | |
| PxMatrix (int_t n) | |
| Size constructor. | |
| PxMatrix (int_t n, T_Int *vals, bool bind) | |
| Buffer binding constructor. | |
| PxMatrix (const PxMatrix< T_Int > &other)=default | |
| Copy constructor. | |
| PxMatrix (PxMatrix< T_Int > &&other)=default | |
| Move constructor. | |
| ~PxMatrix () | |
| Destructor. | |
Operators | |
| PxMatrix & | operator= (const PxMatrix< T_Int > &other)=default |
| Copy assignment operator. | |
| PxMatrix< T_Int > & | operator= (PxMatrix< T_Int > &&other)=default |
| Move assignment operator. | |
| void | operator= (T_Int val) |
| Value setter. | |
Public Member Functions | |
| PxMatrix< T_Int > | inverse () const |
| Inverse permutation. | |
| PxMatrix< T_Int > | permuteLeft (const PxMatrix< T_Int > &P) const |
| Left permutation composition. | |
| void | permuteLeft (const PxMatrix< T_Int > &P, PxMatrix< T_Int > &trg) const |
| In-place left permutation composition. | |
Creators/Generators | |
| static PxMatrix< T_Int > | identity (int_t n) |
| Identity permutation generator. | |
| static PxMatrix< T_Int > | random (int_t n) |
| Random permutation generator. | |
Additional Inherited Members | |
| Public Member Functions inherited from cla3p::dns::XiVector< T_Int > | |
| T_Int & | operator() (int_t i) |
| Element access operator. | |
| void | clear () |
| Clear the vector. | |
| void | fill (T_Int val) |
| Fill all elements with a value. | |
| XiVector< T_Int > | copy () const |
| Create a deep copy of the vector. | |
| XiVector< T_Int > | rcopy () |
| Create a reference copy (shallow copy) of the vector. | |
| XiVector< T_Int > | move () |
| Move the vector's resources. | |
| std::string | info (const std::string &header="") const |
| Get information about the vector. | |
| void | print (std::streamsize prec=0) const |
| Print the vector to standard output. | |
| void | toStream (std::ostream &os, std::streamsize prec=0) const |
| Output the vector to a stream. | |
| Public Member Functions inherited from cla3p::Meta1D< int_t > | |
| int_t | size () const |
| Vector size. | |
| bool | empty () const |
| Tests whether the object has zero dimension. | |
| operator bool () const | |
| Boolean conversion operator. | |
| Public Member Functions inherited from cla3p::dns::XxContainerBase< T_Int > | |
| T_Int * | values () |
| Access the data buffer. | |
| Public Member Functions inherited from cla3p::Ownership | |
| Ownership () | |
| Default constructor. | |
| Ownership (bool owner) | |
| Ownership constructor. | |
| ~Ownership () | |
| Destructor. | |
| bool | owner () const |
| Tests memory ownership. | |
| void | unbind () |
| Relinquishes memory ownership. | |
| Static Public Member Functions inherited from cla3p::dns::XiVector< T_Int > | |
| static Guard< XiVector< T_Int > > | view (int_t n, const T_Int *vals) |
| Create a view of existing memory. | |
Permutation matrix utility.
| T_Int | Integer type for permutation indices. |
Permutation matrices are stored as a 1D array of (unsigned) integers and reorder indices based on a predefined mapping. For a size n matrix, each value lies in the range [0, n-1] using 0-based indexing.
|
explicit |
Default constructor.
Constructs an empty permutation matrix.
|
explicit |
Size constructor.
Constructs a permutation matrix of size n with uninitialized values.
| [in] | n | The permutation matrix size. |
|
explicit |
Buffer binding constructor.
Creates a permutation matrix of size n bound to external storage or copies from provided values.
| [in] | n | The permutation matrix size. |
| [in] | vals | Pointer to n entries holding the permutation values. |
| [in] | bind | If true, takes ownership of vals and manages its lifetime. |
|
default |
Copy constructor.
Constructs a permutation matrix with a copy of other; other remains unchanged.
|
default |
Move constructor.
Transfers the contents of other; other is left empty.
| cla3p::prm::PxMatrix< T_Int >::~PxMatrix | ( | ) |
Destructor.
Destroys the permutation matrix.
|
default |
Copy assignment operator.
If (*this) is empty, copies the contents of other. If (*this) is not empty, performs a deep copy of other into (*this). The two matrices must have equal size.
|
default |
Move assignment operator.
Replaces the contents with those of other; other is left empty.
| void cla3p::prm::PxMatrix< T_Int >::operator= | ( | T_Int | val | ) |
Value setter.
Sets all entries of (*this) to val.
| [in] | val | The value to assign to all entries. |
| PxMatrix< T_Int > cla3p::prm::PxMatrix< T_Int >::inverse | ( | ) | const |
Inverse permutation.
Computes and returns the inverse (transpose) of the permutation matrix.
| PxMatrix< T_Int > cla3p::prm::PxMatrix< T_Int >::permuteLeft | ( | const PxMatrix< T_Int > & | P | ) | const |
Left permutation composition.
Computes and returns the composed permutation \( P \cdot (*this) \).
| [in] | P | The left-side permutation matrix. |
| void cla3p::prm::PxMatrix< T_Int >::permuteLeft | ( | const PxMatrix< T_Int > & | P, |
| PxMatrix< T_Int > & | trg ) const |
In-place left permutation composition.
Stores the composed permutation \( P \cdot (*this) \) into trg.
| [in] | P | The left-side permutation matrix. |
| [out] | trg | Output permutation matrix receiving \( P \cdot (*this) \); must match the size of (*this). |
|
static |
Identity permutation generator.
Creates an n-sized permutation matrix with \( P(i) = i \).
| [in] | n | The permutation matrix size. |
|
static |
Random permutation generator.
Creates an n-sized permutation matrix with randomly rearranged indices.
| [in] | n | The permutation matrix size. |